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:
object
Plot 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
,
xunit
=
'years'
,
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
) – a
prodimopy.read_mc.Data_mc
object 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.
xunit
(
str
) – The unit for the x-axis (age). Default is “years”. Options are
“years”
and
“days”
todo::
(
..
) – the x axis (ages) is always plotted in log-scale so the zero age (
initial abundance) is not shown. Needs more flexibility.
plot_reac
(
rtype
,
chemanas
,
chemana_steadystate
=
None
,
ax
=
None
,
**
kwargs
)
[source]

Plots the rates for the most important reactions at the point
ix
,
iz
for the
given chemanalysis list, which usually come from a time-dependent
ProDiMo
disk model (i.e time steps).
That ages (x-axis) are taken from the model connected the the chemanalysis objects.
Parameters
:
rtype
(
str
) –
f
for formation reactions,
d
for destruction reactions.
chemanas
(
list
[
Chemistry
]
) – A list of chemanalysis objects (e.g. for each
age in a time-dependent model). All have to be for the same species.
chemana_steadystate
(
Chemistry
|
None
) – The chemistry analysis of an equivalent steady-state model (i.e. same grid, etc.) for the
same species. Optional
class
prodimopy.plot_mc.
PlotMcModels
(
pdf
=
None
,
colors
=
None
,
styles
=
None
,
markers
=
None
,
fs_legend
=
6
,
ncol_legend
=
0
)
[source]

Bases:
object
Plot routines for a molecular cloud
ProDiMo
models (0D chemistry).
Parameters
:
name
– a
PdfPages
object 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)
pdf
(
PdfPages
|
None
)
plot_species
(
models
,
spname
,
ms
=
None
,
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
(
list
[
Data_mc
]
) – list of molecular cloud models
spname
(
str
) – The name fo the species to plot^
ms
(
int
|
list
[
int
]
|
None
) – The maker size(s) for the plot.
plot_species_diff
(
models
,
spname
,
ax
=
None
,
**
kwargs
)
[source]

Plot the difference of the species abundance relative to the last model.
The relative difference is defined as
modelval/modelrefval-1.0.
One can also pass further arguments such as
xlim (Array)
,
ylim (Array)
,
xlog
,
ylog
,
grid
.
Please note, that the y-axis uses the
symlog
scale.
Parameters
:
models
(
list
[
Data_mc
]
) – list of molecular cloud models
spname
(
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 models
spname1
(
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)
prodimopy.plot_mc.
load_style
(
style
=
'prodimopy'
)
[source]

Simple wrapper that calls
load_mplstyle()
with the given style.
Parameters
:
style
(
str
) – The name of the style to load. Default: “prodimopy”