irfpy.mexpvat.domain

Domain of the spacecraft

Domains (solar wind, induced magnetosphere, magnetosheath) are handled.

irfpy.mexpvat.domain.inside_bowshock(t, model=None, model_param=None)[source]

Return if the spacecraft is inside the bow shock.

Parameters
  • t

  • model – The model used. As default, use the Vignes model https://irfpy.irf.se/projects/planets/api/api_irfpy.mars.bowshock.html is used. As a default, Vignes original model is used, and only implemented

  • model_param – Parameter to pass to the model. Dictionary. For example, {“scale”: 1.3} will give the scale parameter to Vignes model.

Returns

True if the MEX is inside the bow shock. It include the magnetosheath, induced magnetosphere, magnetotail, or innosphere

>>> import datetime
>>> t = datetime.datetime(2009, 2, 13, 8)
>>> print(inside_bowshock(t))
True
>>> t = datetime.datetime(2009, 2, 13, 12)
>>> print(inside_bowshock(t))
False
>>> inside_bowshock(t, model_param={"scale": 4.5})
True
irfpy.mexpvat.domain.inside_mpb(t, model=None)[source]

Return if the spacecraft is inside MPB

Parameters
Returns

True if the MEX is inside the MPB. It include the induced magnetosphere, magnetotail, or ionosphere.

>>> import datetime
>>> t = datetime.datetime(2009, 2, 13, 9)
>>> print(inside_mpb(t))
True
>>> t = datetime.datetime(2009, 2, 13, 12)
>>> print(inside_mpb(t))
False
irfpy.mexpvat.domain.inside_eclipse(t)[source]

Return if the spacecraft is inside the geometric eclipse.

Parameters

t – Time

Returns

Boolean value, True if the spacecraft is in the eclipse.

The definition of the eclipse is just geometric: \(R(=\sqrt{x^2+y^2+z^2})\ge 1 [Rm]\) and \(x<0\) and \(r(=\sqrt{y^2+z^2})\le 1 [Rm]\) where R is the radius and r is the distance from x-axis.

>>> import datetime
>>> t = datetime.datetime(2009, 2, 13, 10)
>>> print(inside_eclipse(t))
True
>>> t = datetime.datetime(2009, 2, 13, 11)
>>> print(inside_eclipse(t))
False
irfpy.mexpvat.domain.bowshock_crossings(orbit_number, dt_survey=600, tolerance=0.1, model=None, model_param=None)[source]

Return the list of bowshock crossing time for the specific orbit

Parameters
  • orbit_number – Orbit nubmer. Int.

  • dt_survey – Time difference for surveying the position. Every dt_survey seconds, the function calculates the position and evaluate if the spacecraft cross the boundary. If crossed, the detailed calculation is done when it is crossed, down to tolerance seconds accuracy.

  • tolerance – The tolerance in seconds.

  • model – Model name, while only Vignes model is implemented.

  • model_param – Model parameter. {“scale”: 1.3} gives larger bowshock by 30%.

Returns

List of bow shock crossing times

This function returns the bowshock crossing times as a list.

>>> bowshock_crossings(900)
[datetime.datetime(2004, 10, 1, 17, 45, 20, 301269), datetime.datetime(2004, 10, 1, 20, 29, 27, 859863)]
>>> bowshock_crossings(900, model_param={"scale": 0.8})
[datetime.datetime(2004, 10, 1, 17, 56, 3, 807129), datetime.datetime(2004, 10, 1, 20, 6, 19, 554199)]
>>> bowshock_crossings(900, model_param={"scale": 1.2})
[datetime.datetime(2004, 10, 1, 17, 32, 27, 962402), datetime.datetime(2004, 10, 1, 20, 54, 43, 460449)]
>>> bowshock_crossings(900, model_param={"scale": 4}) # Unreasonably wide bow shock
[]
irfpy.mexpvat.domain.mpb_crossings(orbit_number, dt_survey=600, tolerance=0.1)[source]

Return the list of MPB crossing time for the specific orbit

Parameters
  • orbit_number – Orbit nubmer. Int.

  • dt_survey – Time difference for surveying the position. Every dt_survey seconds, the function calculates the position and evaluate if the spacecraft cross the boundary. If crossed, the detailed calculation is done when it is crossed, down to tolerance seconds accuracy.

  • tolerance – The tolerance in seconds.

Returns

List of MPB crossing times

This function returns the MPB crossing times as a list.

>>> mpb_crossings(900)
[datetime.datetime(2004, 10, 1, 18, 9, 57, 449707), datetime.datetime(2004, 10, 1, 19, 16, 18, 235840)]