prodimopy

The python package provides routines for reading and plotting the output of one or more ProDiMo model(s).

Installation

The package can be installed from a gitlab repository or if you want a stable version from pypi via pip. For details see https://gitlab.astro.rug.nl/prodimo/prodimopy. There you find also the instructions how to update the code. You will also find a binder like that allows you to try some features of the package without installing anything.

Source Documentation

The style of the plots

The plotting routines of prodimopy use matplotlib in the background. That means all matplotlib features are also available in prodimopy.

To define the style of the plots the mpatlotlib style sheets can be used. During the installation of prodimopy a prodimpy.mplstyle style sheet is installed and can be used in your own scripts (for an example see Plotting routines for a single model).

You can also use your own styles and colors. But it might be that in some plotting routines of prodimopy the colors are hardcoded and therefore cannot be easily changed.

Command-line utilities

prodimopy also installs a few command line utils which can be used without lauching a python interpreter or writing any python code.

pplot

Produces plots for a single prodimo model. Useful to check the prodimopy installation or to take a quick look on a ProDiMo model. For details see Plotting routines for a single model.

pplot_models

Produces plots for a given set of prodimo models. Useful to quickly compare visualy different ProDiMo models. For details see Plotting routines for a set of models.

pcompare

Compares the results of two ProDiMo models. For details see Compare two ProDiMo models.

pparam

Simple script to manipulte the Parameter.in file from the command line. Just call pparam from the command line and check the help.

Using Jupyter

Most prodimopy routines can also be used within a Jupyter notebook. In this example notebook it is shown how to use the reading a plotting routines for a single model.

This feature is not well tested yet. It worked with python 3.6 as part of the anaconda distribution using the local Jupyter server.

Indices and tables

TODO’s

This is a list of all the things that marked as todo in the code. Maybe you find something you would like to fix!

Todo

make it an abstract class that requires the child classes to implement the load_reactions routine. Currently this only works for the Reactions.out from ProDiMo.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/chemistry/network.py:docstring of prodimopy.chemistry.network.ReactionNetwork, line 3.)

Todo

Is not general; just a test at the moment.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/chemistry/network.py:docstring of prodimopy.chemistry.network.ReactionNetworkPout.load_rates, line 6.)

Todo

Include reading of T-dependent rates for the csv format. More sophisticated guessing of the file format.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/chemistry/network.py:docstring of prodimopy.chemistry.network.ReactionNetworkPin.load_reactions, line 5.)

Todo

does not work yet for reactions with multiple temperatures.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/chemistry/network.py:docstring of prodimopy.chemistry.network.ReactionNetworkPin.write_reactions, line 4.)

Todo

  • make tolerances configurable via config file (see punit checkModels).

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/compare.py:docstring of prodimopy.compare.CompareAbs, line 6.)

Todo

  • it might be worth to make this smarter and compare the individual line estimates. currently the comparison fails if e.g. there are more level for one line … but the rest is fine

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/compare.py:docstring of prodimopy.compare.Compare.compareLineEstimates, line 4.)

Todo

allow boolean type of parameters

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/grid.py:docstring of prodimopy.grid.genvalues, line 5.)

Todo

allow for the dust composition parameters

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/grid.py:docstring of prodimopy.grid.genvalues, line 7.)

Todo

also pass the gridname as optional parameter.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/grid.py:docstring of prodimopy.grid.get_modeldirs, line 5.)

Todo

deal with dust composition properties (e.g. carbon fraction)

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/grid.py:docstring of prodimopy.grid.make_grid, line 9.)

Todo

deal with boolean values

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/grid.py:docstring of prodimopy.grid.make_grid, line 11.)

Todo

deal with something like stellar particles and CR spectra (e.g. on/off)

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/grid.py:docstring of prodimopy.grid.make_grid, line 13.)

Todo

Applying this method can introduce some numerical errors due to a lot of conversions and interpolations. However, these should be <0.5%. And as this routint is used for fitting it should not be an issue. However, the error most likely comes from calculating the gas and dust surface densities when a ProDiMo model is read (those are not calculated within ProDiMo). So maybe this calc_surfd() should be made more accurate.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/interface1D/infile.py:docstring of prodimopy.interface1D.infile.generate_from_obsradprof, line 6.)

Todo

  • Option for passing a norm (:class:matplotlib.colors.LogNorm). But that does not work nicely with contourf and colorbars … works with imshow and pcolormesh though … maybe switch to pcolormesh.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/plot.py:docstring of prodimopy.plot.Plot.plot_cont, line 62.)

Todo

can be improved with better and smarter default values (e.g. for the colorbar)

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/plot.py:docstring of prodimopy.plot.Plot.plot_abuncont, line 12.)

Todo

  • possibility to have different oconts for the heating and cooling figures

  • possibility to map certain heating/cooling processes always to the same color

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/plot.py:docstring of prodimopy.plot.Plot.plot_heat_cool, line 17.)

Todo

  • it is not possible to set the xlim (offset) coordinate in arcsec. Requires likely the conversion form pix to arcsec or vice versa

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/plot_casasim.py:docstring of prodimopy.plot_casasim.PlotCasasim.plot_pv, line 4.)

Todo

Make this a wrapper of plot_vertical(). Just pass nmol as fieldname and species name

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/plot_models.py:docstring of prodimopy.plot_models.PlotModels.plot_abunvert, line 11.)

Todo

  • Currently all Parameters are strings. make type conversions.

  • provide utility functions to access special Parameters

  • maybe inherit from Dictionary class and mat custom getters

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/read.py:docstring of prodimopy.read.ModelParameters, line 5.)

Todo

things like SPNOERASE= 30*” “ not interpreted yet

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/read.py:docstring of prodimopy.read.ModelParameters, line 17.)

Todo

allow for different units.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/read.py:docstring of prodimopy.read.DataFLiTsSpec.convolve, line 11.)

Todo

  • This is quick and dirty. However, the problem is more in ProDiMo because it is unclear what file is for what and when (depending on parameter configuration) which file is written.

  • This does not deal with the two e- like in the normal mode. This is inconsistent.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/prodimopy/checkouts/latest/prodimopy/read_mc.py:docstring of prodimopy.read_mc.read_tdep_file, line 9.)