Skip to content

Commit

Permalink
Merge pull request #283 from alhom/master
Browse files Browse the repository at this point in the history
Move non-population stuff out of populations init loop, fixed some jacobian vectorsizes in reduction
  • Loading branch information
alhom authored Sep 26, 2024
2 parents 3d3bff3 + 630e1e3 commit 04b62b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pyVlsv/reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,9 +1209,9 @@ def makelambda(index):
v5reducers["vg_dxs"] = DataReducerVariable(["CellID"], vg_dx, "m", 3, latex=r"$\Delta{}\vec{r}$", latexunits=r"$\mathrm{m}$", useReader=True)
v5reducers["vg_reflevel"] = DataReducerVariable(["CellID"], vg_reflevel, "", 1, latex=r"reflevel", latexunits=r"", useReader=True)

v5reducers["vg_jacobian_b"] = DataReducerVariable(["vg_dbxvoldx","vg_dbxvoldy","vg_dbxvoldz","vg_dbyvoldx","vg_dbyvoldy","vg_dbyvoldz","vg_dbzvoldx","vg_dbzvoldy","vg_dbzvoldz"], TensorFromScalars, "T/m", 1, latex=r"$\vec{J}$",latexunits=r"$\mathrm{A}\,\mathrm{m}^{-2}$")
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}$")
v5reducers["vg_jacobian_b"] = DataReducerVariable(["vg_dbxvoldx","vg_dbxvoldy","vg_dbxvoldz","vg_dbyvoldx","vg_dbyvoldy","vg_dbyvoldz","vg_dbzvoldx","vg_dbzvoldy","vg_dbzvoldz"], TensorFromScalars, "T/m", 9, latex=r"$\vec{J}$",latexunits=r"$\mathrm{A}\,\mathrm{m}^{-2}$")
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", 9, latex=r"$\vec{J}$",latexunits=r"$\mathrm{A}\,\mathrm{m}^{-2}$")
v5reducers["vg_j"] = DataReducerVariable(["vg_jacobian_bper"], J, "A/m^2", 3, latex=r"$\vec{J}$",latexunits=r"$\mathrm{A}\,\mathrm{m}^{-2}$")

#multipopv5reducers
multipopv5reducers = {}
Expand Down
6 changes: 3 additions & 3 deletions pyVlsv/vlsvreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ def __init__(self, file_name, fsGridDecomposition=None):
pop.__precipitation_centre_energy = np.asarray(energybins)
vlsvvariables.speciesprecipitationenergybins[popname] = energybins

vlsvvariables.cellsize = self.__dx
vlsvvariables.cellsize = self.__dx

if self.check_parameter("j_per_b_modifier"):
vlsvvariables.J_per_B_modifier = self.read_parameter("j_per_b_modifier")
if self.check_parameter("j_per_b_modifier"):
vlsvvariables.J_per_B_modifier = self.read_parameter("j_per_b_modifier")

self.__fptr.close()

Expand Down

0 comments on commit 04b62b3

Please sign in to comment.