wnutils package¶
A package of python routines to read and plot webnucleo xml and hdf5 files.
Submodules¶
wnutils.base module¶
-
class
wnutils.base.
Base
[source]¶ Bases:
object
Class for setting wnutils parameters and utilities.
-
apply_class_methods
(plt, keyword_params)[source]¶ Method to apply plot functions.
- Args:
plt
(matplotlib.pyplot
): A pyplot plot instance.keyword_params
(dict
): A dictionary of functions that will be applied to the plot. The key is the function and the value is the argument of the function.- Returns:
- On successful return, the functions have been applied to the plot.
-
get_z_a_state_from_nuclide_name
(name)[source]¶ Method to get the Z, A, and state from the name of a nuclide.
-
is_non_nuclide_reaction_element_string
(name)[source]¶ Method to check if a string is that of a non-nuclide reaction element.
-
list_rcParams
()[source]¶ Method to list default rcParams.
- Returns:
- Prints the default
matplotlib.rcParams
.
-
make_time_t9_rho_title_str
(props, i)[source]¶ Method to create a default title string.
- Args:
props
(dict
): A dictionary offloat
. The dictionary must contain entries that arenumpy.array
objects containing time, the time in seconds, t9, the temperature in billions of Kelvins, and rho, the mass density in grams per cubic centimeter.i
(int
): An integer giving the location in the arrays of the properties to use to construct the string.- Returns:
str
: The default title string.
-
make_time_title_str
(time)[source]¶ Method to create a default title string.
- Args:
props
(dict
): A dictionary offloat
. The dictionary must contain at least onenumpy.array
object containing time, the time in seconds.time
(int
): A float giving the time to use to construct the string.- Returns:
str
: The default title string.
-
set_plot_params
(my_mpl, my_params)[source]¶ Method to set plot parameters.
- Args:
my_mpl
(matplotlib): A matplotlib instance.my_params
(dict
): A dictionary with rcParams to be applied.- Returns:
- On successful return, the
matplotlib.rcParams
have first been set to their defaults and then updated with the values in my_params.
-
show_or_close
(plt, kwargs)[source]¶ Method to show or close plot.
- Args:
plt
(matplotlib.pyplot
): A pyplot plot instance.keyword_params
(dict
): A dictionary of functions that will be applied to the plot. The key is the function and the value is the argument of the function.- Returns:
- On successful return, the plot has been shown or closed.
-
wnutils.h5 module¶
-
class
wnutils.h5.
H5
(file)[source]¶ Bases:
wnutils.base.Base
A class for reading and plotting webnucleo HDF5 files.
Each instance corresponds to an hdf5 file. Methods extract data and plot data from the file.
- Args:
file
(str
): The name of the hdf5 file.
-
get_group_mass_fractions
(group)[source]¶ Method to return mass fractions from a group in an hdf5 file.
-
get_group_properties_in_zones
(group, properties)[source]¶ Method to return properties in all zones for a group.
Args:
-
get_group_properties_in_zones_as_floats
(group, properties)[source]¶ Method to return properties in all zones for a group as floats.
Args:
- Returns:
dict
: A dictionary ofnumpy.array
giving the properties in the zones as floats.
-
get_group_zone_properties
(group, zone)[source]¶ Method to return all properties in a zone in a group.
Args:
- Returns:
dict
: A dictionary of strings giving all the properties in the zone in the group.
-
get_iterable_groups
()[source]¶ Method to return the non-nuclide data groups in an hdf5 file.
- Returns:
list
: A list of strings giving the names of the groups.
-
get_nuclide_data
()[source]¶ Method to return nuclide data from an hdf5 file.
Returns:
dict
: A dictionary of the nuclide data. Each entry is itself a dictionary containing the nuclide’s index, name, z, a, source (data source), state, spin, and mass excess.
-
get_zone_labels_for_group
(group)[source]¶ Method to return zone labels for a group in a webnucleo hdf5 file.
-
get_zone_mass_fractions_in_groups
(zone, species)[source]¶ Method to return zone mass fractions in all groups.
Args:
- Returns:
dict
: A dictionary ofnumpy.array
giving the mass fractions in the groups.
-
get_zone_properties_in_groups
(zone, properties)[source]¶ Method to return zone properties in all groups.
Args:
-
get_zone_properties_in_groups_as_floats
(zone, properties)[source]¶ Method to return zone properties in all groups as floats.
Args:
- Returns:
dict
: A dictionary ofnumpy.array
giving the properties in the groups as floats.
-
make_mass_fractions_movie
(species, movie_name='', property=None, fps=15, xfactor=1, use_latex_names=False, title_func=None, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to make a movie of mass fractions in the zones.
Args:
species
(list
): A list of the species to include in the movie.movie_name
(str
): A string giving the name of the resultin movie file.property
(str
, optional): A string giving property to be the x axis. Defaults to zone index.fps
(float
, optional): A float giving the frames per second in the resulting movie.xfactor
(float
, optional): A float giving the scaling of the x axis.use_latex_names
(bool
, optional): If set to True, species names converted to latex format.title_func
(optional): A function that applies the title to each frame of the movie. The function must take a single argument, anint
giving the index of the frame to which the title will be applied. Other data can be bound to the function. The function must return either astr
giving the title or a two-elementtuple
in which the first element is a string giving the title and the second element is adict
with optionalmatplotlib.pyplot.title
keyword arguments. The default is a title giving the time in seconds.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the movie. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the lines in the movie.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- The animation.
-
plot_group_mass_fractions
(group, species, use_latex_names=False, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot group mass fractions vs. zone.
Args:
group
(str
): A string giving the group.species
(list
): A list of strings giving the species to plot.use_latex_names
(bool
, optional): If set to True, species names converted to latex format.rcParams`
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements asspecies
.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
-
plot_group_mass_fractions_vs_property
(group, prop, species, xfactor=1, use_latex_names=False, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot group mass fractions vs. zone property.
Args:
group
(str
): A string giving the group.prop
(str
ortuple
): A string or tuple of up to three strings giving the property (which will serve as the plot abscissa).species
(list
): A list of strings giving the species to plot.xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.use_latex_names
(bool
, optional): If set to True, species names converted to latex format.rcParams`
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements asspecies
.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
-
plot_group_properties_vs_property
(group, prop, props, xfactor=1, yfactor=None, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot group mass fractions vs. zone property.
Args:
group
(str
): A string giving the group.prop
(str
ortuple
): A string or tuple of up to three strings giving the property (which will serve as the plot abscissa).props
(list
): A list of strings or tuples of up to three strings giving the properties (which will serve as the plot ordinates).xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.yfactor
(float
, optional): A list of floats giving the scaling for the ordinate values. Defaults to 1.rcParams`
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements asspecies
.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
-
plot_group_property_in_zones
(group, property, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot a group property vs. zone.
Args:
group
(str
): A string giving the group.property
(str
ortuple
): A string or tuple of up to three strings giving the group.rcParams`
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(dict
, optional): A dictionary of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
-
plot_zone_mass_fractions_vs_property
(zone, prop, species, xfactor=1, yfactor=None, use_latex_names=False, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot zone mass fractions vs. zone property.
Args:
zone
(tuple
): A three element tuple giving the zone.prop
(str
ortuple
): A string or tuple of up to three strings giving the property (which will serve as the plot abscissa).species
(list
): A list of strings giving the species to plot.xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.yfactor
(list
, optional): A list of floats giving factor by which to scale the mass fractions. Defaults to not scaling. If supplied, must by the same length asspecies
.use_latex_names
(bool
, optional): If set to True, species names converted to latex format.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(dict
, optional): A dictionary of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
-
plot_zone_property_vs_property
(zone, prop1, prop2, xfactor=1, yfactor=1, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot a property vs. a property in a zone.
Args:
zone
(tuple
): A three element tuple giving the zone labels.prop1
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the abscissa of the plot).prop2
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the ordinate of the plot).xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.yfactor
(float
, optional): A float giving the scaling for the ordinate values. Defaults to 1.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(dict
, optional): A dictionary of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
wnutils.multi_h5 module¶
-
class
wnutils.multi_h5.
Multi_H5
(files)[source]¶ Bases:
wnutils.base.Base
A class for reading and plotting webnucleo multiple HDF5 files.
Each instance corresponds to a set of HDF5 files. Methods plot data from the files.
- Args:
files
(list
): The names of the HDF5 files.
-
get_h5
()[source]¶ Method to return individual H5 instances.
- Returns:
list
: A list of individualwnutils.h5.H5
instances.
-
plot_zone_mass_fraction_vs_property
(zone, prop, species, xfactor=1, use_latex_names=False, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot a mass fraction versus a property.
Args:
zone
(tuple
): A three-elementtuple
giving the threestr
labels of the zone.prop
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the abscissa of the plot).species
(str
): A string giving the species.xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.use_latex_names
(bool
, optional): If set to True, converts species labels to latex format.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements number of files in the class instance.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.Returns:
A matplotlib plot.
-
plot_zone_property_vs_property
(zone, prop1, prop2, xfactor=1, yfactor=1, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot a property vs. a property in the files.
Args:
zone
(tuple
): A three-elementtuple
giving the threestr
labels of the zone.prop1
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the abscissa of the plot).prop2
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the ordinate of the plot).xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.yfactor
(float
, optional): A float giving the scaling for the ordinate values. Defaults to 1.rcParams
(dict
, optional): A dictionary of : obj: matplotlib.rcParams to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements number of files in the class instance.**kwargs
: Acceptable: obj: matplotlib.pyplot functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
wnutils.multi_xml module¶
-
class
wnutils.multi_xml.
Multi_Xml
(files)[source]¶ Bases:
wnutils.base.Base
A class for reading and plotting webnucleo multiple xml files.
Each instance corresponds to a set of xml files. Methods plot data from the files.
- Args:
files
(list
): The names of the xml files.
-
get_xml
()[source]¶ Method to return individual Xml instances.
- Returns:
list
: A list of individualwnutils.xml.Xml
instances.
-
plot_mass_fraction_vs_property
(prop, species, xfactor=1, use_latex_names=False, labels=None, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot a mass fraction versus a property.
Args:
prop
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the abscissa of the plot).species
(str
): A string orgiving the species.xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.use_latex_names
(bool
, optional): If set to True, converts species labels to latex format.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements as the number of files in the class instance.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.Returns:
A matplotlib plot.
-
plot_property_vs_property
(prop1, prop2, xfactor=1, yfactor=1, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot a property vs. a property in the files.
Args:
prop1
(str
ortuple
): A string or tuple of up to three strings giving the property(which will be the abscissa of the plot).prop2
(str
ortuple
): A string or tuple of up to three strings giving the property(which will be the ordinate of the plot).xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.yfactor
(float
, optional): A float giving the scaling for the ordinate values. Defaults to 1.rcParams
(dict
, optional): A dictionary of : obj: matplotlib.rcParams to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements as the number of files in the class instance.**kwargs
: Acceptable: obj: matplotlib.pyplot functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
wnutils.xml module¶
-
class
wnutils.xml.
New_Xml
(xml_type='nuclear_network')[source]¶ Bases:
wnutils.base.Base
A class for creating webnucleo xml files.
Each instance corresponds to new xml. Methods set the nuclide, reaction, or zone data or write the xml to a file.
- Args:
xml_type
(str
, optional): The type of xml file to be created (“nuclear_data”, “reaction_data”, “nuclear_network”, “zone_data”, or “libnucnet_input”). Defaults to “nuclear_network”.
-
set_nuclide_data
(nuclides)[source]¶ Method to set the nuclide data.
Args:
nuclides
(dict
): A dictionary containing the nuclides to be created and their data.- Returns:
- On successful return, the underlying xml has been created with
the data in
nuclides
.
-
set_reaction_data
(reactions)[source]¶ Method to set the reaction data.
Args:
reactions
(dict
): A dictionary containing the reactions to be set and their data.- Returns:
- On successful return, the underlying xml has been created with
the data in
reactions
.
-
class
wnutils.xml.
Reaction
[source]¶ Bases:
wnutils.base.Base
A class for storing and retrieving data about reactions.
-
get_data
()[source]¶ Method to return the data for a reaction.
- Returns:
dict
: A dictionary containing the rate data for the reaction.
-
-
class
wnutils.xml.
Xml
(file)[source]¶ Bases:
wnutils.base.Base
A class for reading and plotting webnucleo xml files.
Each instance corresponds to an xml file. Methods extract data and plot data from the file.
- Args:
file
(str
): The name of the xml file.
-
get_abundances_vs_nucleon_number
(nucleon='a', zone_xpath=' ')[source]¶ Method to retrieve abundances summed over nucleon number in zones.
- Args:
nucleon
(str
): String giving the nucleon number to sum over. Must be ‘z’, ‘n’, or ‘a’. Defaults to ‘a’.zone_xpath
(str
, optional): XPath expression to select zones. Defaults to all zones.- Returns:
numpy.array
: A two-dimensional array in which the first index gives the zone and the second gives the nucleon number value.
-
get_all_abundances_in_zones
(zone_xpath=' ')[source]¶ Method to retrieve all abundances in zones.
- Args:
zone_xpath
(str
, optional): XPath expression to select zones. Defaults to all zones.- Returns:
numpy.array
: A three-dimensional array in which the first index gives the zone, the second gives the atomic number, and the third gives the neutron number. The array value is the abundance in the zone given by the first index of the species with atomic number and neutron number given by the second and third indices, respectively. The abundance of the species is the sum of the abundances of all states of that species.
-
get_all_properties_for_zone
(zone_xpath)[source]¶ Method to retrieve all properties in a zone in an xml file
-
get_chain_abundances
(nucleon, zone_xpath='', vs_A=False)[source]¶ Method to retrieve the abundances in a chain (fixed Z or N).
Args:
nucleon
(tuple
, optional): A tuple giving the nucleon. The first entry must be the nucleon type (must be ‘z’ or ‘n’) while the second entry must be the value.zone_xpath
(str
, optional): A string giving the XPath expression to select the zones. Defaults to all zones.vs_A
(bool
, optional): A boolean to select whether abscissa data should be mass number.- Returns:
- A
tuple
containing an array of the nucleon values as the first element and a two-dnumpy.array
as the second element. The first index of the two-d array indicates the step and the second the abundance of the species with the corresponding nucleon number in the first element with the same index.
-
get_mass_fractions
(species, zone_xpath=' ')[source]¶ Method to retrieve mass fractions of nuclides in specified zones.
- Args:
species
(list
): List of strings giving the species to retrieve.zone_xpath
(str
, optional): XPath expression to select zones. Defaults to all zones.- Returns:
dict
: A dictionary ofnumpy.array
containing the mass fractions of the requested species in the zones as floats.
-
get_network_limits
(nuc_xpath=' ')[source]¶ Method to retrieve the network limits from the nuclide data.
- Args:
nuc_xpath
(str
, optional): XPath expression to select the nuclides. Defaults to all nuclides.- Returns:
dict
: A dictionary ofnumpy.array
containing the network limits. The array with key z gives the atomic values. The array with key n_min gives the lowest neutron number present for the corresponding atomic number. The array with key n_max gives the highest neutron number present for the corresponding atomic number.
-
get_properties
(properties, zone_xpath=' ')[source]¶ Method to retrieve properties in specified zones in an xml file
-
get_properties_as_floats
(properties, zone_xpath=' ')[source]¶ Method to retrieve properties in zones in an xml file as floats.
- Args:
properties
(list
): List of strings or tuples (each of up to three strings) giving requested properites.zone_xpath
(str
, optional): XPath expression to select zones. Defaults to all zones.- Returns:
dict
: A dictionary ofnumpy.array
containing the properties in the zones as floats.
-
get_type
()[source]¶ Method to retrieve the root type of the webnucleo XML.
- Returns:
str
: One of nuclear_data, reaction_data, nuclear_network, zone_data, libnucnet_input indicating the root type of the XML.
-
make_abundance_chain_movie
(movie_name=None, nucleon=('z', 26), zone_xpath='', plot_vs_A=False, fps=15, title_func=None, rcParams=None, plotParams=None, extraFixedCurves=None, extraCurves=None, **kwargs)[source]¶ Method to make of movie of abundances in a chain (fixed Z or N).
Args:
movie_name
(str
, optional): A string giving the name of resulting movie file.nucleon
(tuple
, optional): A tuple giving the nucleon. The first entry must be the nucleon type (must be ‘z’ or ‘n’) while the second entry must be the value.zone_xpath
(str
, optional): A string giving the XPath expression to select the zones. Defaults to all zones.plot_vs_A
(bool
, optional): A boolean to select whether abscissa should be mass number.fps
(float
, optional): A float giving the frames per second in the resulting movie.title_func
(optional): A function that applies the title to each frame of the movie. The function must take a single argument, anint
giving the index of the frame to which the title will be applied. Other data can be bound to the function. The function must return either astr
giving the title or a two-elementtuple
in which the first element is a string giving the title and the second element is adict
with optionalmatplotlib.pyplot.title
keyword arguments. The default is a title giving the time in seconds, the temperature in billions of Kelvins, and the mass density in grams / cc.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the movie. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the lines in the movie.extraFixedCurves
(list
, optional): A list oftuple
objects giving fixed curves to appear on each frame of the animation. The first element of the tuple is alist
giving the abscissa values for the curve, the second element is the ordinate values for the curve, and the third element, if present, is adict
ofmatplotlib.pyplot.plot
optional keyword arguments to be applied to the extra fixed curves in the movie.extraCurves
(list
, optional): A list oftuple
objects giving curves to appear on each frame of the animation. The first element of the tuple is alist
giving the abscissa values for the curve, the second element is a two-dnumpy.array
giving the ordinate values for the curve corresponding to each timestep in the animation, and the third element, if present, is adict
ofmatplotlib.pyplot.plot
optional keyword arguments to be applied to the extra fixed curves in the movie.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- The animation.
-
make_abundances_vs_nucleon_number_movie
(movie_name='', nucleon='a', zone_xpath='', fps=15, title_func=None, rcParams=None, plotParams=None, extraFixedCurves=None, extraCurves=None, **kwargs)[source]¶ Method to make of movie of abundances summed by nucleon number.
Args:
movie_name
(str
, optional): A string giving the name of resulting movie file.nucleon
(str
, optional): A string giving the nucleon (must be ‘z’, ‘n’, or ‘a’). Defaults to ‘a’.zone_xpath
(str
, optional): A string giving the XPath expression to select the zones. Defaults to all zones.fps
(float
, optional): A float giving the frames per second in the resulting movie file.title_func
(optional): A function that applies the title to each frame of the movie. The function must take a single argument, anint
giving the index of the frame to which the title will be applied. Other data can be bound to the function. The function must return either astr
giving the title or a two-elementtuple
in which the first element is a string giving the title and the second element is adict
with optionalmatplotlib.pyplot.title
keyword arguments. The default is a title giving the time in seconds, the temperature in billions of Kelvins, and the mass density in grams / cc.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the movie. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the lines in the movie.extraFixedCurves
(list
, optional): A list oftuple
objects giving fixed curves to appear on each frame of the animation. The first element of the tuple is alist
giving the abscissa values for the curve, the second element is the ordinate values for the curve, and the third element, if present, is adict
ofmatplotlib.pyplot.plot
optional keyword arguments to be applied to the extra fixed curves in the movie.extraCurves
(list
, optional): A list oftuple
objects giving curves to appear on each frame of the animation. The first element of the tuple is alist
giving the abscissa values for the curve, the second element is a two-dnumpy.array
giving the ordinate values for the curve corresponding to each timestep in the animation, and the third element, if present, is adict
ofmatplotlib.pyplot.plot
optional keyword arguments to be applied to the extra fixed curves in the movie.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- The animation.
-
make_network_abundances_movie
(movie_name='', zone_xpath='', fps=15, title_func=None, rcParams=None, imParams={}, show_limits=True, plotParams={'color': 'black'}, **kwargs)[source]¶ Method to make of movie of network abundances.
Args:
movie_name
(str
, optional): A string giving the name of resulting movie file.zone_xpath
(str
, optional): A string giving the XPath expression to select the zones. Defaults to all zones.fps
(float
, optional): A float giving the frames per second in the resulting movie file.title_func
(optional): A function that applies the title to each frame of the movie. The function must take a single argument, anint
giving the index of the frame to which the title will be applied. Other data can be bound to the function. The function must return either astr
giving the title or a two-elementtuple
in which the first element is a string giving the title and the second element is adict
with optionalmatplotlib.pyplot.title
keyword arguments. The default is a title giving the time in seconds, the temperature in billions of Kelvins, and the mass density in grams / cc.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the movie. Defaults to the default rcParams.imParams
(dict
, optional): A dictionary ofmatplotlib.pyplot.imshow
options to be applied to the movie. The default is equivalent to calling with imParams={‘origin’:’lower’, ‘cmap’: cm.BuPu, ‘norm’: LogNorm(), ‘vmin’: 1.e-10, ‘vmax’: 1}. cm in this call is thematplotlib.cm
namespace. Any or all of these options can be overridden or others added by setting any of them in the inputdict
.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the network limits. Defaults are shown in the usage statement.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- The animation.
-
plot_abundances_vs_nucleon_number
(nucleon='a', zone_xpath='[last()]', rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot abundances summed by nucleon number.
Args:
nucleon
(str
, optional): A string giving the nucleon (must be ‘z’, ‘n’, or ‘a’). Defaults to ‘a’.zone_xpath
(str
, optional): A string giving the XPath expression to select the zones. Defaults to the last zone.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements as the number as zones selected by the zone XPath.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.
-
plot_mass_fractions_vs_property
(prop, species, xfactor=1, use_latex_names=False, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot the mass fractions versus a property.
Args:
prop
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the abscissa of the plot).species
list
): A list of strings giving the species.xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.use_latex_names
(bool
, optional): If set to True, converts species labels to latex format.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(list
, optional): A list of dictionaries of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot. The list must have the same number of elements asspecies
.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.Returns:
A matplotlib plot.
-
plot_property_vs_property
(prop1, prop2, xfactor=1, yfactor=1, rcParams=None, plotParams=None, **kwargs)[source]¶ Method to plot a property vs. a property.
Args:
prop1
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the abscissa of the plot).prop2
(str
ortuple
): A string or tuple of up to three strings giving the property (which will be the ordinate of the plot).xfactor
(float
, optional): A float giving the scaling for the abscissa values. Defaults to 1.yfactor
(float
, optional): A float giving the scaling for the ordinate values. Defaults to 1.rcParams
(dict
, optional): A dictionary ofmatplotlib.rcParams
to be applied to the plot. Defaults to the default rcParams.plotParams
(dict
, optional): A dictionary of validmatplotlib.pyplot.plot
optional keyword arguments to be applied to the plot.**kwargs
: Acceptablematplotlib.pyplot
functions. Include directly, as adict
, or both.- Returns:
- A matplotlib plot.