EppicPlotterManager

class PlasmaCalcs.hookups.eppic.eppic_plotters.eppic_plotter_manager.EppicPlotterManager

Bases: EppicPlotterManagerSam, EppicPlotterManagerSave

PlotterManager inheriting from everyone’s plotter manager codes here.

Methods

get_plotter(name[, who])

gets the Plotter associated with this name and who.

get_plotters([who, kind, name, all_whos, ...])

return list of all plotters associated with these inputs.

plot(name[, who, save, show, close])

makes a single plot using the relevant plotter.

plot_E_mod2_abs_radfft_manytimes(...)

abs_radfft_delta_mod2_E at "many" times (ec.sam_defaults['manytimes']).

plot_E_mod2_blurk_abs_radfft_manytimes(...)

abs_radfft_delta_mod2_E at "many" times (ec.sam_defaults['manytimes']).

plot_E_mod_sometimes(**kw_plot_settings)

mod_E at some times (ec.sam_defaults['sometimes'])

plot_E_mod_stats(**kw_plot_settings)

E-field (mod) stats timelines.

plot_E_stats(**kw_plot_settings)

E-field (vector) stats timelines.

plot_T_box(**kw_plot_settings)

T_box timelines for all fluids.

plot_T_sometimes(**kw_plot_settings)

T at some times (ec.sam_defaults['sometimes'])

plot_Ta_from_moment2(**kw_plot_settings)

Ta_from_moment2 timelines for all fluids.

plot_ddt_ln_std_blur_deltafrac_n(...)

ddt_ln_std_blur_deltafrac_n timelines for all fluids, for blur_sigma in [0, 1, 10, 20]

plot_ddt_ln_std_deltafrac_n(**kw_plot_settings)

ddt_ln_std_deltafrac_n timelines for all fluids.

plot_deltafrac_n(**kw_plot_settings)

deltafrac_n movie for all fluids, all current snaps (in self.snap).

plot_deltafrac_n_abs_radfft(**kw_plot_settings)

abs_radfft_deltafrac_n movie for all fluids, all current snaps (in self.snap).

plot_deltafrac_n_abs_radfft_full_sometimes(...)

abs_radfft_deltafrac_n at some times (ec.sam_defaults['sometimes']) for all fluids.

plot_deltafrac_n_abs_radfft_sometimes(...)

abs_radfft_deltafrac_n at some times (ec.sam_defaults['sometimes']) for all fluids.

plot_deltafrac_n_blurk_abs_radfft(...)

blurk_abs_radfft_deltafrac_n movie for all fluids, all current snaps (in self.snap).

plot_deltafrac_n_blurk_abs_radfft_sometimes(...)

blurk_abs_radfft_deltafrac_n at some times (ec.sam_defaults['sometimes']) for all fluids.

plot_deltafrac_n_sometimes(**kw_plot_settings)

deltafrac_n at some times (ec.sam_defaults['sometimes']) for all fluids.

plot_deltafrac_ne_manytimes(**kw_plot_settings)

deltafrac_n for electrons at "many" times (ec.sam_defaults['manytimes']).

plot_ln_std_blur_deltafrac_n(**kw_plot_settings)

ln_std_blur_deltafrac_n timelines for all fluids, for blur_sigma in [0, 1, 10, 20]

plot_ln_std_deltafrac_n(**kw_plot_settings)

ln_std_deltafrac_n timelines for all fluids.

plot_moment1(**kw_plot_settings)

moment1 timelines for all fluids.

plot_moment1_specie0(**kw_plot_settings)

plot the first moment of the simulation for specie0

plot_n_stats(**kw_plot_settings)

number density stats timelines for all fluids.

plot_u_mod_sometimes(**kw_plot_settings)

mod_u at some times (ec.sam_defaults['sometimes'])

plot_u_mod_stats(**kw_plot_settings)

stats of u (mod) timelines for all ions and electrons.

plot_u_std(**kw_plot_settings)

std of u (vector) timelines for all ions and electrons.

plot_u_std_mod(**kw_plot_settings)

std of u (mod) timelines for all ions and electrons.

sam_plots_highres(*[, dst, dpi, ...])

save sam's plots in highres mode.

sam_plots_lowres(*[, dst, dpi, bbox_inches, ...])

save sam's plots in lowres mode.

sam_plots_midres(*[, dst, dpi, bbox_inches, ...])

save sam's plots in midres mode.

save_plots([kind, who, name, all_whos, ...])

saves all plots from plotters associated with these inputs.

_default_sam_defaults()

returns a copy of self.SAM_DEFAULTS.

_extra_coords_with_title()

return self.extra_coords with {'title': repr(self.title)} added,

_sam_timeline_defaults(*[, title])

sets sam's defaults for timelines plots.

Attributes

KNOWN_PATTERNS

KNOWN_PLOTTERS

KNOWN_SETTERS

KNOWN_VARS

SAM_DEFAULTS

UNIQUE_PLOTTERS

cls_behavior_attrs

known_pattern

known_plotter

known_setter

known_var

sam_defaults

various defaults for sam's plotting.

_default_sam_defaults()

returns a copy of self.SAM_DEFAULTS.

Uses a somewhat hacky deepcopy for dicts - copies down 1 layer of dicts.
E.g. ec.sam_defaults[‘fft_calcs’] is a copy of ec.SAM_DEFAULTS[‘fft_calcs’],
but ec.sam_defaults[‘sometimes_style’][‘title_kw’] is the same object
as ec.SAM_DEFAULTS[‘sometimes_style’][‘title_kw’], so, e.g.,
ec.sam_defaults[‘sometimes_style’][‘title_kw’][‘fontsize’] = ‘large’
would affect all instances, while
ec.sam_defaults[‘sometimes_style’][‘title_kw’] = {‘fontsize’: ‘large’}
would affect only the current instance, ec.
_extra_coords_with_title()

return self.extra_coords with {‘title’: repr(self.title)} added,

if self.title exists and ‘title’ not in self.extra_coords yet.
else, just return self.extra_coords.
_sam_timeline_defaults(*, title=True)

sets sam’s defaults for timelines plots.

calls plt.grid(), and plt.title(ec.title).
get_plotter(name, who=UNSET)

gets the Plotter associated with this name and who.

Roughly equivalent: self.KNOWN_PLOTTERS[(name, who)]
name: str or Plotter
name of the plotter to use, or a Plotter instance.
who: UNSET, None, or str
person associated with the plotter.
UNSET –> use the plotter with this name; crash if found multiple same-named plotters.
see also: self.get_plotters(), which is good if you don’t know ‘who’, or want multiple plotters.
get_plotters(who=UNSET, kind=UNSET, *, name=None, all_whos=UNSET, all_kinds=UNSET, skip_who=[], skip_kinds=[], min_cost=None, max_cost=None, sortby=None, returns='plotters')

return list of all plotters associated with these inputs.

If called with no inputs, just returns a copy of self.UNIQUE_PLOTTERS.
who: UNSET, None, str, or list.
person associated with the plotter.
UNSET –> include plotters regardless of ‘who’.
None –> require len(plotter.who) == 0.
str –> require this name to be in plotter.who.
list –> require at least one of these to be in plotter.who
(or, if None in list, allow len(plotter.who)==0, too)
kind: UNSET, str, or list.
kind associated with the plotter.
UNSET –> include plotters regardless of ‘kind’.
str –> require this kind to be in plotter.kinds.
list –> require at least one of these to be in plotter.kinds.
name: None or str
plotter name. E.g. ‘deltafrac_n’.
None –> include all plotters regardless of ‘name’.
all_whos: UNSET or list.
include only plotters with ALL of these people in plotter.who.
all_kinds: UNSET or str.
include only plotters with ALL of these kinds in plotter.kinds.
skip_who: list
exclude plotters with any of these people in plotter.who.
skip_kinds: list
exclude plotters with any of these kinds in plotter.kinds.
min_cost: None or number
exclude plotters with cost < min_cost.
None –> no minimum.
max_cost: None or number
exclude plotters with cost > max_cost.
None –> no maximum.
sortby: None or ‘cost’
tells how to sort the result (if returns==’plotters’).
None –> keep in order they appear in self.UNIQUE_PLOTTERS.
‘cost’ –> sort by plotter.cost values.
returns: ‘plotters’, ‘names’, ‘who’, ‘kind’, or ‘kinds’
‘plotters’ –> returns list of plotters
‘names’ –> returns set of all names associated with at least 1 plotter in result.
‘who’ –> returns set of all people associated with at least 1 plotter in result.
‘kind’ or ‘kinds’ –> returns set of all kinds associated with at least 1 plotter in result.
plot(name, who=UNSET, *, save=False, show=False, close=False, **kw_plotter)

makes a single plot using the relevant plotter.

name: str or Plotter

name of the plotter to use, or a Plotter instance.
(if Plotter, use directly and ignore ‘who’ input.)
who: UNSET, None, or str
person associated with the plotter.
UNSET –> use the plotter with this name; crash if found multiple same-named plotters.
save: bool, str, or dict.
whether to save figure after calling plotter.
str –> filename=save.format(name=name, savename=savename), instead of default filename=name.
dict –> pass to saver as kwargs. Use kwarg ‘dst’ to also provide filename.
if plotter.ani, saver is movie_obj.ani(), else saver is plt.savefig().
show: bool
whether to plt.show() after making plot (and, after save).
if show when ani==True, return movie_obj.ani() (so it will display in jupyter)
close: bool
whether to plt.show() after making plot (and, after save).
if show when ani==True, return movie_obj.ani() (so it will display in jupyter)
additional kwargs go to plotter.plot(…)
see also: self.get_plotters(), self.save_plots().
plot_E_mod2_abs_radfft_manytimes(**kw_plot_settings)

abs_radfft_delta_mod2_E at “many” times (ec.sam_defaults[‘manytimes’]).

plot_E_mod2_blurk_abs_radfft_manytimes(**kw_plot_settings)

abs_radfft_delta_mod2_E at “many” times (ec.sam_defaults[‘manytimes’]).

plot_E_mod_sometimes(**kw_plot_settings)

mod_E at some times (ec.sam_defaults[‘sometimes’])

plot_E_mod_stats(**kw_plot_settings)

E-field (mod) stats timelines.

plot_E_stats(**kw_plot_settings)

E-field (vector) stats timelines.

plot_T_box(**kw_plot_settings)

T_box timelines for all fluids.

plot_T_sometimes(**kw_plot_settings)

T at some times (ec.sam_defaults[‘sometimes’])

plot_Ta_from_moment2(**kw_plot_settings)

Ta_from_moment2 timelines for all fluids.

plot_ddt_ln_std_blur_deltafrac_n(**kw_plot_settings)

ddt_ln_std_blur_deltafrac_n timelines for all fluids, for blur_sigma in [0, 1, 10, 20]

plot_ddt_ln_std_deltafrac_n(**kw_plot_settings)

ddt_ln_std_deltafrac_n timelines for all fluids.

plot_deltafrac_n(**kw_plot_settings)

deltafrac_n movie for all fluids, all current snaps (in self.snap).

plot_deltafrac_n_abs_radfft(**kw_plot_settings)

abs_radfft_deltafrac_n movie for all fluids, all current snaps (in self.snap).

Not the full region of k-space.
plot_deltafrac_n_abs_radfft_full_sometimes(**kw_plot_settings)

abs_radfft_deltafrac_n at some times (ec.sam_defaults[‘sometimes’]) for all fluids.

Includes the full region of k-space; see also plot_deltafrac_n_abs_radfft_full.
plot_deltafrac_n_abs_radfft_sometimes(**kw_plot_settings)

abs_radfft_deltafrac_n at some times (ec.sam_defaults[‘sometimes’]) for all fluids.

Not the full region of k-space; see also plot_deltafrac_n_abs_radfft_full.
plot_deltafrac_n_blurk_abs_radfft(**kw_plot_settings)

blurk_abs_radfft_deltafrac_n movie for all fluids, all current snaps (in self.snap).

Not the full region of k-space. Uses blur_sigma=1.
plot_deltafrac_n_blurk_abs_radfft_sometimes(**kw_plot_settings)

blurk_abs_radfft_deltafrac_n at some times (ec.sam_defaults[‘sometimes’]) for all fluids.

plot_deltafrac_n_sometimes(**kw_plot_settings)

deltafrac_n at some times (ec.sam_defaults[‘sometimes’]) for all fluids.

plot_deltafrac_ne_manytimes(**kw_plot_settings)

deltafrac_n for electrons at “many” times (ec.sam_defaults[‘manytimes’]).

plot_ln_std_blur_deltafrac_n(**kw_plot_settings)

ln_std_blur_deltafrac_n timelines for all fluids, for blur_sigma in [0, 1, 10, 20]

plot_ln_std_deltafrac_n(**kw_plot_settings)

ln_std_deltafrac_n timelines for all fluids.

plot_moment1(**kw_plot_settings)

moment1 timelines for all fluids.

plot_moment1_specie0(**kw_plot_settings)

plot the first moment of the simulation for specie0

plot_n_stats(**kw_plot_settings)

number density stats timelines for all fluids.

plot_u_mod_sometimes(**kw_plot_settings)

mod_u at some times (ec.sam_defaults[‘sometimes’])

plot_u_mod_stats(**kw_plot_settings)

stats of u (mod) timelines for all ions and electrons.

(electrons in a subplot above ions, if mean electrons |u| >> 3 * ions |u|.)
plot_u_std(**kw_plot_settings)

std of u (vector) timelines for all ions and electrons.

(electrons in a subplot above ions, if mean electrons std(u) >> 3 * ions std(u).)
plot_u_std_mod(**kw_plot_settings)

std of u (mod) timelines for all ions and electrons.

(electrons in a subplot above ions, if mean electrons std(u) >> 3 * ions std(u).)
property sam_defaults

various defaults for sam’s plotting.

Editing ec.sam_defaults directly will change values for an instance.
Editing ec.SAM_DEFAULTS directly will change values for all future instances.
sam_plots_highres(*, dst='plots_highres/{savename}', dpi=400, bbox_inches='tight', snap=None, min_cost=None, max_cost=None, **kw)

save sam’s plots in highres mode. return abspath to folder containing plots.

sam_plots_lowres(*, dst='plots_lowres/{savename}', dpi=100, bbox_inches='tight', snap=slice(None, None, 0.0333), min_cost=None, max_cost=40, **kw)

save sam’s plots in lowres mode. return abspath to folder containing plots.

sam_plots_midres(*, dst='plots_midres/{savename}', dpi=200, bbox_inches='tight', snap=slice(None, None, 0.01), min_cost=None, max_cost=None, **kw)

save sam’s plots in midres mode. return abspath to folder containing plots.

save_plots(kind=UNSET, who=UNSET, *, name=None, all_whos=UNSET, all_kinds=UNSET, skip_who=[], skip_kinds=[], min_cost=None, max_cost=None, dst='{savename}', save_log=True, log_extras=[], kw_save={}, bbox_inches=UNSET, dpi=UNSET, show=False, close=True, print_freq=0, **kw_plotter)

saves all plots from plotters associated with these inputs.

returns dict of {plotter: plotter result} for all plotters called.
Consider checking self.get_plotters() first to learn which plotters will be included.
For choosing which plotters to include:
kind: UNSET, str, or list.
kind associated with the plotter.
UNSET –> include plotters regardless of ‘kind’.
str –> require this kind to be in plotter.kinds.
list –> require at least one of these to be in plotter.kinds.
who: UNSET, None, str, or list.
person associated with the plotter.
UNSET –> include plotters regardless of ‘who’.
None –> require len(plotter.who) == 0.
str –> require this name to be in plotter.who.
list –> require at least one of these to be in plotter.who
(or, if None in list, allow len(plotter.who)==0, too)
name: None or str
plotter name. E.g. ‘deltafrac_n’.
None –> include all plotters regardless of ‘name’.
all_whos: UNSET or list.
include only plotters with ALL of these people in plotter.who.
all_kinds: UNSET or str.
include only plotters with ALL of these kinds in plotter.kinds.
skip_who: list
exclude plotters with any of these people in plotter.who.
skip_kinds: list
exclude plotters with any of these kinds in plotter.kinds.
min_cost: None or number
exclude plotters with cost < min_cost.
None –> no minimum.
max_cost: None or number
exclude plotters with cost > max_cost.
None –> no maximum.
For plotting:
dst: str
where to save plots to. Hit by dst.format(name=plotter.name, savename=plotter.savename).
if not abspath, save to os.path.join(self.unique_notes_dirname, dst) if possible,
else save to dst within current directory.
save_log: bool or str
whether to save a log of plot progress to _save_plots_log.txt file.
str –> save to this file name. If not abspath, put it in dir implied by dst (see above).
The log tells current datetime, version info about PlasmaCalcs, and plot timing updates.
log_extras: list of str
extra lines to put in the log “header”, if doing save_log.
kw_save: dict
kwargs to pass to plotter.save(…)
bbox_inches: UNSET or any value
if provided, added to kw_save.
dpi: UNSET or any value
if provided, added to kw_save.
show: bool
whether to plt.show() after making plot (and, after save).
if show when ani==True, return movie_obj.ani() (so it will display in jupyter)
close: bool
whether to plt.show() after making plot (and, after save).
if show when ani==True, return movie_obj.ani() (so it will display in jupyter)
additional kwargs go to plotter.plot(…)
Misc:
print_freq: number
minimum seconds between printing progress updates.
-1 –> never print; 0 –> always print.
see also: self.get_plotters(), self.plot().