pyrfu.pyrf.calc_agyro module#
- pyrfu.pyrf.calc_agyro.calc_agyro(p_xyz: DataArray) DataArray[source]#
Compute agyrotropy coefficient as
\[A\Phi = \frac{|P_{\perp 1} - P_{\perp 2}|}{P_{\perp 1} + P_{\perp 2}}\]- Parameters:
p_xyz (DataArray) – Time series of the pressure tensor
- Returns:
Time series of the agyrotropy coefficient of the specie.
- Return type:
DataArray
- Raises:
TypeError – If input is not a xarray.DataArray.
ValueError – If input is not a time series of a tensor (n_time, 3, 3).
Examples
>>> from pyrfu import mms, pyrf
Time interval
>>> tint = ["2019-09-14T07:54:00.000","2019-09-14T08:11:00.000"]
Spacecraft index
>>> ic = 1
Load magnetic field and electron pressure tensor
>>> b_xyz = mms.get_data("b_gse_fgm_srvy_l2", tint, 1) >>> p_xyz_e = mms.get_data("pe_gse_fpi_fast_l2", tint, 1)
Rotate electron pressure tensor to field aligned coordinates
>>> p_fac_e_qq = mms.rotate_tensor(p_xyz_e, "fac", b_xyz, "qq")
Compute agyrotropy coefficient
>>> agyro_e = pyrf.calc_agyro(p_fac_e_qq)