Plotting routines for a molecular cloud model
Routines to plot the output of a (time-dependent) molecular cloud (mc, 0D chemistry model) ProDiMo model.
import prodimopy.read_mc as pread_mc
import prodimopy.plot_mc as pplot_mc
model=pread_mc.read_mc("MC_Results.out")
print("MAKE A PLOTTING EXAMPLE)
- class prodimopy.plot_mc.PlotMcModel(pdf=None, colors=None, styles=None, markers=None, fs_legend=6, ncol_legend=0)[source]
Bases:
objectPlot routines for a single molecular cloud ProDiMo model (0D chemistry).
Todo
Redesign this. it is not very useful to have this dokwargs legend etc. routines copied all the time.
- Parameters:
pdf (PdfPages | None) – a PdfPages object used to save the plot or None to have output on screen.
colors (list) – a list of matplotlib colors used for different models. (default: None)
styles (list) – a list of matplotlib styles used for different models. (default: None)
markers (list) – a list of matplotlib markers used for different models. (default: None)
- plot_species(model, spnames, ax=None, **kwargs)[source]
Plot the species abundances as function of age (time).
One can also pass further arguments such as xlim (Array), ylim (Array), xlog, ylog, grid.
- Parameters:
model (
prodimopy.read_mc.Data_mc) – aprodimopy.read_mc.Data_mcobject used to save the plot.spnames (list or str) – The names of the species that should be plotted. Can also be a single string.
ax (
matplotlib.axes.Axes) – The axes object to plot the data on. If None a new figure is created.todo:: (..) – the x axis (ages) is always plotted in log-scale so the zero age ( initial abundance) is not shown. Needs more flexibility.
- class prodimopy.plot_mc.PlotMcModels(pdf, colors=None, styles=None, markers=None, fs_legend=6, ncol_legend=0)[source]
Bases:
objectPlot routines for a molecular cloud ProDiMo models (0D chemistry).
- Parameters:
name (pdf) – a
matplotlib.backends.backend_pdf.PdfPagesobject used to save the plot.colors (list) – a list of matplotlib colors used for different models. (default: None)
styles (list) – a list of matplotlib styles used for different models. (default: None)
markers (list) – a list of matplotlib markers used for different models. (default: None)
- plot_species(models, spname, ice=False, ax=None, **kwargs)[source]
Plot the given species (spname) for all the given models.
One can also pass further arguments such as xlim (Array), ylim (Array), xlog, ylog, grid.
- Parameters:
models (array_like(
prodimopy.read_mc.Data_mc,ndim=1)) – list of molecular cloud modelsspname (str) – The name fo the species to plot
- plot_species_diff(models, spname, ax=None, **kwargs)[source]
Plot the difference of the species abundance relative to the last model. The relative diffferencie is definded as abs(modelval/modelrefval-1.0).
One can also pass further arguments such as xlim (Array), ylim (Array), xlog, ylog, grid.
- Parameters:
models (array_like(
prodimopy.read_mc.Data_mc,ndim=1)) – list of molecular cloud modelsspname (str) – The name fo the species to plot
- plot_abunratio(models, spname1, spname2, **kwargs)[source]
Plots the ratio of species spname1 over species spname2 for all the passed models.
One can also pass further arguments such as xlim (Array), ylim (Array), xlog, ylog, grid.
- Parameters:
models (array_like(
prodimopy.read_mc.Data_mc,ndim=1)) – list of molecular cloud modelsspname1 (str) – The name of the first species used for the ratio.
spname2 (str) – The name of the second species used for the ratio (sp1/sp2)