pyrfu.mms.dsl2gse module#
- pyrfu.mms.dsl2gse.dsl2gse(inp: DataArray, defatt: Dataset | ndarray, direction: int | None = 1)[source]#
Transform time series from MMS’s DSL to GSE.
- Parameters:
inp (DataArray) – Input time series to convert.
defatt (Dataset or numpy.ndarray) – Spacecraft attitude.
direction ({1, -1}, Optional) – Direction of transformation. +1 DSL -> GSE, -1 GSE -> DSL. Default is 1.
- Returns:
out – Time series of the input field in the new coordinates systems.
- Return type:
- Raises:
TypeError – If defatt is not a Dataset or a numpy.ndarray.
Examples
>>> from pyrfu.mms import get_data, load_ancillary, dsl2gse
Define time interval
>>> tint = ["2015-05-09T14:00:000", "2015-05-09T17:59:590"]
Load magnetic field in spacecraft coordinates
>>> b_xyz = get_data("b_dmpa_fgm_brst_l2", tint, 1)
Load spacecraft attitude
>>> defatt = load_ancillary("defatt", tint, 1)
Transform magnetic field to GSE
>>> b_gse = dsl2gse(b_xyz, defatt)