From 3e3e08180da05621dc4c64b7096a8b59e55a19fe Mon Sep 17 00:00:00 2001 From: JonasSuni Date: Fri, 13 Sep 2024 20:22:15 +0300 Subject: [PATCH] Change reducer name to p_magnetic and bug fix --- pyVlsv/reduction.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyVlsv/reduction.py b/pyVlsv/reduction.py index a995604e..59bd56f4 100644 --- a/pyVlsv/reduction.py +++ b/pyVlsv/reduction.py @@ -609,10 +609,10 @@ def gyrotropy(variables): Q = 1 - 4 * I2 / ( (I1 - Ppar)*(I1 + 3* Ppar) ) return Q -def magnetic_pressure( variables ): +def MagneticPressure( variables ): ''' Data reducer for finding the magnetic pressure ''' - Magneticfield = variables[1] + Magneticfield = variables[0] return np.sum(np.asarray(Magneticfield)**2,axis=-1) / 2.0 / mu_0 def beta( variables ): @@ -927,7 +927,7 @@ def makelambda(index): datareducers["pdyn"] = DataReducerVariable(["v", "rhom"], Pdyn, "Pa", 1, latex=r"$P_\mathrm{dyn}$",latexunits=r"$\mathrm{Pa}$") datareducers["pdynx"] = DataReducerVariable(["v", "rhom"], Pdynx, "Pa", 1, latex=r"$P_\mathrm{dyn,x}$",latexunits=r"$\mathrm{Pa}$") -datareducers["pmag"] = DataReducerVariable(["b"], magnetic_pressure, "Pa", 1, latex=r"$P_\mathrm{mag}$",latexunits=r"$\mathrm{Pa}$") +datareducers["p_magnetic"] = DataReducerVariable(["b"], MagneticPressure, "Pa", 1, latex=r"$P_\mathrm{mag}$",latexunits=r"$\mathrm{Pa}$") datareducers["poynting"] = DataReducerVariable(["e", "b"], Poynting, "W/m2", 3, latex=r"$S$", latexunits=r"\mathrm{W}\,\mathrm{m}^{-2}$") datareducers["hallterm"] = DataReducerVariable(["e", "v", "b"], Hallterm, "V/m", 3, latex=r"$E_\mathrm{Hall}$", latexunits=r"\mathrm{V}\,\mathrm{m}^{-1}$") @@ -1142,7 +1142,7 @@ def makelambda(index): v5reducers["vg_pdyn"] = DataReducerVariable(["vg_v", "vg_rhom"], Pdyn, "Pa", 1, latex=r"$P_\mathrm{dyn}$",latexunits=r"$\mathrm{Pa}$") v5reducers["vg_pdynx"] = DataReducerVariable(["vg_v", "vg_rhom"], Pdynx, "Pa", 1, latex=r"$P_\mathrm{dyn,x}$",latexunits=r"$\mathrm{Pa}$") -v5reducers["vg_pmag"] = DataReducerVariable(["vg_b_vol"], magnetic_pressure, "Pa", 1, latex=r"$P_\mathrm{mag}$",latexunits=r"$\mathrm{Pa}$") +v5reducers["vg_p_magnetic"] = DataReducerVariable(["vg_b_vol"], MagneticPressure, "Pa", 1, latex=r"$P_\mathrm{mag}$",latexunits=r"$\mathrm{Pa}$") v5reducers["vg_di"] = DataReducerVariable(["proton/vg_rho"], ion_inertial, "m", 1, latex=r"$d_\mathrm{i}$",latexunits=r"$\mathrm{m}$")