Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pyVlsv/reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}$")
Expand Down