pyrfu.pyrf.dec_par_perp module#
- pyrfu.pyrf.dec_par_perp.dec_par_perp(inp, b_bgd, flag_spin_plane: bool = False)[source]#
Decomposes a vector into par/perp to B components. If flagspinplane decomposes components to the projection of
b0
into the XY plane.alpha
gives the angle betweenb0
and the XY. plane.- Parameters:
inp (xarray.DataArray) – Time series of the field to decompose.
b_bgd (xarray.DataArray) – Time series of the background magnetic field.
flag_spin_plane (bool, Optional) – Flag if True gives the projection in XY plane.
- Returns:
a_para (xarray.DataArray) – Time series of the input field parallel to the background magnetic field.
a_perp (xarray.DataArray) – Time series of the input field perpendicular to the background magnetic field.
alpha (xarray.DataArray) – Time series of the angle between the background magnetic field and the XY plane.
Examples
>>> from pyrfu import mms, pyrf
Time interval
>>> tint = ["2019-09-14T07:54:00.000", "2019-09-14T08:11:00.000"]
Spacecraft index
>>> mms_id = 1
Load magnetic field (FGM) and electric field (EDP)
>>> b_xyz = mms.get_data("B_gse_fgm_brst_l2", tint, mms_id) >>> e_xyz = mms.get_data("E_gse_edp_brst_l2", tint, mms_id)
Decompose e_xyz into parallel and perpendicular to b_xyz components
>>> e_para, e_perp, _ = pyrf.dec_par_perp(e_xyz, b_xyz)