pyrfu.pyrf.new_xyz#
- pyrfu.pyrf.new_xyz(inp, trans_mat, coordinate_system: str | None = None)[source]#
Transform the input field to the new frame.
- Parameters:
inp (xarray.DataArray) – Time series of the input field in the original coordinate system.
trans_mat (array_like) – Transformation matrix, with the unit vectors of the new frame as columns.
coordinate_system (str, Optional) – Name of the new coordinate system (e.g., “lmn”), stored in the
COORDINATE_SYSTEMattribute of the output. Default is None, which removes that attribute: the name of an arbitrary frame is unknown, and keeping the original one would let functions relying on it, likepyrfu.pyrf.cotrans(), treat the output as still being in the original frame.
- Returns:
out – Time series of the input in the new frame.
- Return type:
Examples
>>> from pyrfu import mms, pyrf
Time interval
>>> tint = ["2019-09-14T07:54:00.000", "2019-09-14T08:11:00.000"]
Spacecraft indices
>>> mms_id = 1
Load magnetic field and electric field
>>> b_xyz = mms.get_data("B_gse_fgm_srvy_l2", tint, mms_id) >>> e_xyz = mms.get_data("E_gse_edp_fast_l2", tint, mms_id)
Compute MVA frame
>>> b_lmn, l, mva = pyrf.mva(b_xyz)
Move electric field to the MVA frame
>>> e_lmn = pyrf.new_xyz(e_xyz, mva, "lmn")