Skip to content

pencil.ism_dyn

Illa edited this page Feb 24, 2021 · 1 revision

pencil.ism_dyn package

Submodules

pencil.ism_dyn.derived_h5 module

Derive auxilliary data and other diagnostics from var.h5 file and save to new h5 file

uses:

compute ‘data’ arrays of size [nz,ny,nx] as required
store ‘time’ of snapshot
compute ‘masks’ for example by temperature phase
compute summary statistics ‘stats’
compute ‘structure’ functions as required

pencil.ism_dyn.derived_h5.calc_derived_data(src, dst, key, par, gd, l1, l2, m1, m2, n1, n2, nghost=3)

compute from src data and existing dst data derived data

pencil.ism_dyn.derived_h5.der_limits(n1, n2, m1, m2, l1, l2, nghost)

pencil.ism_dyn.derived_h5.derive_data(sim_path, src, dst, magic=['pp', 'tt'], par=[], comm=None, gd=[], overwrite=False, rank=0, size=1, nghost=3, status='a', chunksize=1000.0, dtype=<class 'numpy.float64'>, quiet=True, nmin=32)

pencil.ism_dyn.derived_h5.is_vector(key)

Check if the variable denoted by the label key is a vector.

pencil.ism_dyn.derived_h5.under_limits(n1, m1, l1, n1shift, m1shift, l1shift, nghost)

pencil.ism_dyn.get_masks module

Derive auxilliary data and other diagnostics from var.h5 file and save to new h5 file

uses:

compute ‘data’ arrays of size [nz,ny,nx] as required
store ‘time’ of snapshot
compute ‘masks’ for example by temperature phase
compute summary statistics ‘stats’
compute ‘structure’ functions as required

pencil.ism_dyn.get_masks.derive_masks(sim_path, src, dst, data_key='data/ss', par=[], comm=None, overwrite=False, rank=0, size=1, nghost=3, status='a', chunksize=1000.0, quiet=True, nmin=32, ent_cuts=[2320000000.0], mask_keys=['hot'], unit_key='unit_entropy')

pencil.ism_dyn.get_masks.thermal_decomposition(ss, pars, unit_key='unit_entropy', ent_cut=[2320000000.0])

call signature:

thermal_decomposition(ss, pars, unit=’unit_entropy’, ent_cut=[2.32e9,])

  • Keyword Arguments

    • ss – dataset used for masks, default ‘ss’, alternate e.g.’tt’

    • pars – Param() object required for units rescaling

    • unit_key – label of physical units in pars to apply to code values

    • ent_cut – list of boundary mask values, default see thesis http://hdl.handle.net/10443/1755 Figure 5.10 may have multiple boundaries

pencil.ism_dyn.get_stats module

Derive auxilliary data and other diagnostics from var.h5 file and save to new h5 file

uses:

compute ‘data’ arrays of size [nz,ny,nx] as required
store ‘time’ of snapshot
compute ‘masks’ for example by temperature phase
compute summary statistics ‘stats’
compute ‘structure’ functions as required

pencil.ism_dyn.get_stats.derive_stats(sim_path, src, dst, stat_keys=['Rm', 'uu', 'Ms'], par=[], comm=None, overwrite=False, rank=0, size=1, nghost=3, status='a', chunksize=1000.0, quiet=True, nmin=32, lmask=False, mask_key='hot')

pencil.ism_dyn.get_stats.plot_hist2d(xvar, yvar, par=[], xlim=None, ylim=None, xbins=100, ybins=100, figsize=[5.663105, 3.5], xlabel='$x$', ylabel='$y$', clabel='${\\cal P}\\,(\\log\\,x,\\log\\,y)$', norm=None, cmap=None, density=True, pad=0.02, fontsize=14)

xvar: array 1D.ravel() format of variable yvar: array length and format matching xvar of complementary variable par: Param object containing simulation parameters xlim: tuple with min & max bin values for xvar ylim: tuple with min & max bin values for yvar xbins: number of bins for xvar histogram ybins: number of bins for yvar histogram figsize: list of length 2 floats with width and height of figure ylabel: plot y-axis label string xlabel: plot x-axis label string clabel: plot colorbar label string norm: color table normalization from colors cmap: color table density: normalize histogram integral to 1 for PDF fontsize: size of plot fonts

pencil.ism_dyn.ism_cooling module

pencil.ism_dyn.ism_sedov_taylor module

class pencil.ism_dyn.ism_sedov_taylor.SedovTaylor()

Bases: object

SedovTaylor – holds blast wave parameters and radial profiles.

get_st(t_sedov=0, par=[], time=[], nt=5000, startt=0.0, endt=0.005, dims=3, quiet=True, rho0=1.6728e-24, M0=10, lsnowplough=True, lcioffi=True)

Compute analytic radial time evolution of SN blast waves for comparison with numerical results

t_sedov:

Time_series object read from the simulation sn_series.dat

par:

Param object containing the simulation parameters

time:

list of time in code units

nt:

Integer size of analytic arrays

endt

Real end time in code units for the time series

dims:

Dimension of the simulation default 3D

rho0:

Ambient ISM density
*

lsnowplough:

Include original snowplough profile
*

lcioffi:

Include Cioffi et al profile

pencil.ism_dyn.ism_sedov_taylor.sedov_taylor(*args, **kwargs)

Compute analytic radial time evolution of SN blast waves for comparison with numerical results

t_sedov:

Time_series object read from the simulation sn_series.dat

par:

Param object containing the simulation parameters

time:

list of time in code units

nt:

Integer size of analytic arrays

endt

Real end time in code units for the time series

dims:

Dimension of the simulation default 3D

rho0:

Ambient ISM density

Module contents

Clone this wiki locally