Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added v5 reducers for the Hall field + keyword for field line colour in plot_colormap #308

Merged
merged 2 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions pyPlots/plot_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def plot_colormap(filename=None,
symmetric=False,
pass_vars=None, pass_times=None, pass_full=False,
fluxfile=None, fluxdir=None, flux_levels=None,
fluxthick=1.0, fluxlines=1,
fluxthick=1.0, fluxlines=1,fluxlinecolor='k',
fsaved=None,
nomask=False,
Earth=None,
Expand Down Expand Up @@ -176,6 +176,7 @@ def plot_colormap(filename=None,
:kword fluxdir: Directory in which fluxfunction files can be found
:kword fluxthick: Scale fluxfunction line thickness
:kword fluxlines: Relative density of fluxfunction contours
:kword fluxlinecolor: Set flux line color (default black)
:kword fsaved: Overplot locations of fSaved. If keyword is set to a string, that will be the colour used.
:kword nomask: Do not mask plotting based on proton density

Expand Down Expand Up @@ -220,7 +221,6 @@ def exprMA_cust(exprmaps, requestvariables=False):
MA = custombulkspeed/va
return MA
plot_colormap(filename=fileLocation, vmin=1 vmax=40, expression=exprMA_cust,lin=True)

'''

# Switch None-keywords to empty lists (this way subsequent calls get correct empty default values
Expand Down Expand Up @@ -1017,7 +1017,7 @@ def exprMA_cust(exprmaps, requestvariables=False):
flux_levels = np.linspace(-10,10,fluxlines*60)
else:
pass #This was given, do nothing
fluxcont = ax1.contour(XmeshCentres,YmeshCentres,flux_function,flux_levels,colors='k',linestyles='solid',linewidths=0.5*fluxthick,zorder=2)
fluxcont = ax1.contour(XmeshCentres,YmeshCentres,flux_function,flux_levels,colors=fluxlinecolor,linestyles='solid',linewidths=0.5*fluxthick,zorder=2)

# add fSaved identifiers
if fsaved:
Expand Down
3 changes: 3 additions & 0 deletions pyVlsv/reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,9 @@ def makelambda(index):
v5reducers["vg_egradpe_parallel"] = DataReducerVariable(["vg_e_gradpe", "vg_b_vol"], ParallelVectorComponent, "V/m", 1, latex=r"$E_{\nabla Pe,\parallel}$",latexunits=r"$\mathrm{V}\,\mathrm{m}^{-1}$")
v5reducers["vg_egradpe_perpendicular"] = DataReducerVariable(["vg_e_gradpe", "vg_b_vol"], PerpendicularVectorComponent, "V/m", 1, latex=r"$E_{\nabla Pe,\perp}$",latexunits=r"$\mathrm{V}\,\mathrm{m}^{-1}$")

v5reducers["vg_hallterm"] = DataReducerVariable(["vg_e_vol", "vg_v", "vg_b_vol"], Hallterm, "V/m", 3, latex=r"$E_\mathrm{Hall}$", latexunits=r"\mathrm{V}\,\mathrm{m}^{-1}$")


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}$")

Expand Down