diff --git a/pyVlsv/reduction.py b/pyVlsv/reduction.py index 4a72379d..74a215b0 100644 --- a/pyVlsv/reduction.py +++ b/pyVlsv/reduction.py @@ -687,6 +687,19 @@ def gyrophase_relstddev( variables, velocity_cell_data, velocity_coordinates ): histo = pl.hist(gyrophase_data[0].data, weights=gyrophase_data[1].data, bins=36, range=[-180.0,180.0], log=False, normed=1) return np.std(histo[0])/np.mean(histo[0]) +def vspace_dummy( variables, velocity_cell_data, velocity_coordinates ): + # This reducer needs to be verified + #B = variables[0] + #print('B: ', B.shape) + velocity_cellids = np.array(list(velocity_cell_data.keys())) + psd = np.array(list(velocity_cell_data.values())) + print(velocity_cellids.shape) + print(psd.shape) + print(velocity_coordinates.shape) + #print('vcelldata: ', list(velocity_cell_data.keys())[0], list(velocity_cell_data.values())[0]) + #print('vcoord: ', velocity_coordinates.shape) + return np.sum(velocity_coordinates) + def Dng( variables ): # This reducer needs to be verified # This routine is still very slow due to for-loops @@ -1195,6 +1208,9 @@ def makelambda(index): v5reducers["vg_jacobian_bper"] = DataReducerVariable(["vg_dperbxvoldx","vg_dperbxvoldy","vg_dperbxvoldz","vg_dperbyvoldx","vg_dperbyvoldy","vg_dperbyvoldz","vg_dperbzvoldx","vg_dperbzvoldy","vg_dperbzvoldz"], TensorFromScalars, "T/m", 1, latex=r"$\vec{J}$",latexunits=r"$\mathrm{A}\,\mathrm{m}^{-2}$") v5reducers["vg_j"] = DataReducerVariable(["vg_jacobian_bper"], J, "A/m^2", 1, latex=r"$\vec{J}$",latexunits=r"$\mathrm{A}\,\mathrm{m}^{-2}$") +#reducers with useVspace +v5reducers["vg_vspace_dummy"] = DataReducerVariable([], vspace_dummy, "", 1, useVspace=True) + #multipopv5reducers multipopv5reducers = {} multipopv5reducers["pop/vg_rhom"] = DataReducerVariable(["pop/vg_rho"], rhom, "kg/m3", 1, latex=r"$\rho_{m,\mathrm{REPLACEPOP}}$",latexunits=r"$\mathrm{kg}\,\mathrm{m}^{-3}$")