pyrfu.pyrf.cotrans module#

pyrfu.pyrf.cotrans.cotrans(inp, flag, hapgood: bool = True)[source]#

Coordinate transformation GE0/GEI/GSE/GSM/SM/MAG as described in [1]

Parameters:
  • inp (xarray.DataArray or ndarray) – Time series of the input field.

  • flag (str) – Coordinates transformation “{coord1}>{coord2}”, where coord1 and coord2 can be geo/gei/gse/gsm/sm/mag.

  • hapgood (bool, Optional) – Indicator if original Hapgood sources should be used for angle computations or if updated USNO-AA sources should be used. Default = true, meaning original Hapgood sources.

Examples

>>> from pyrfu.mms import get_data
>>> from pyrfu.pyrf import cotrans

Time interval

>>> tint = ["2019-09-14T07:54:00.000", "2019-09-14T08:11:00.000"]

Spacecraft index

>>> mms_id = 1

Load magnetic field in GSE coordinates

>>> b_gse = get_data("b_gse_fgm_srvy_l2", tint, mms_id)

Transform to GSM assuming that the original coordinates system is part of the inp metadata

>>> b_gsm = cotrans(b_gse, 'GSM')

If the original coordinates is not in the meta

>>> b_gsm = cotrans(b_gse, 'GSE>GSM')

Compute the dipole direction in GSE

>>> dipole = cotrans(b_gse.time, 'dipoledirectiongse')

References

[1]

Hapgood 1997 (corrected version of Hapgood 1992) Planet.Space Sci..Vol. 40, No. 5. pp. 71l - 717, 1992