Read routines for a molecular cloud model

Routines to read the output of a (time-dependent) molecular cloud (mc,0D chemistry) ProDiMo model. All the data belonging to a mc ProDiMo model is put into a hierachical data structure (Data_mc). Those kind of ProDiMo models are 0D chemistry models which provide the abundances for a given set of parameters (e.g. density,temperature etc.)

The module provides routines to read only the final abundances (last age or steady-state model) or the abundances for all ages (as a function of time). Also the according ages and species names are read.

Usage example

Reads the time-dependent results of a molecular cloud ProDiMo model from the current working directory..

import prodimopy.read_mc as pread_mc

model=pread_mc.read_mc("MC_Results.out")

print(model)

Source documentation

class prodimopy.read_mc.Data_mc(name)[source]

Data structure for molecular cloud (0D chemistry) ProDiMo models.

Can be used for time-dependent abundances or for steady-state (or final) abundances.

Parameters:

name (string) – The name of the model.

name

string: The name of the model (can be empty)

directory

string: The directory from which the model was read. Is e.g. set read_mc() Can be a relative path.

species

array_like(string,ndim=1): an ordered list of species names.

ages

array_like(float,ndim=1): the output ages of the model.

ratecoefficients

array_like(float,ndim=1): The rate coefficients (just the rates as an array)

abundances

array_like(float,ndim=2): the abundances for each species and each age DIMS: (number of ages,number of species).

prodimopy.read_mc.read_tdep_file(filename)[source]

Trys to read the MC_conc_tdep.out file and returns the ages and and abundances of that file.

This file actually includes the number densities and not abundances. Try to estimate the abundances by adding up H, H2 and H+

Currently this file does not include the initial abundances!

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.

Returns:

Returns a tuple containen the list of species, the list of ages, and the species abundances (in that order)

Return type:

tuple

prodimopy.read_mc.read_mc_final(filename='Molecular_cloud.out', directory='.', name=None)[source]

Reads the final (last timestep) molecular cloud abundances.

Parameters:
  • filename (string) – The name of the file containing the abundances (optional).

  • directory (string) – The model directory (optional).

  • name (string) – The name of the model. Will be shown in the plots (optional).

FIXME: ist not consistent with read_mc, e.g. the species names such as N2H+ are not adapted here

FIXME: use numpy arrays for the abundances such as for time-dependent models.

prodimopy.read_mc.read_mc(filename='mc_output.txt', directory='.', agesfile='mc_ages.txt', speciesfile='mc_species.txt', rcfile='MC_rate_coefficients.txt', name=None)[source]

Read routine for molecular cloud ProDiMo models including the ages and the species list.

Parameters:
  • filename (string) –

    The name of the file containing the abundances for all ages. Please check what output file you have in your particular model and adapt it here. (default: mc_output.txt)

    It is rather confusing how it is done in ProDiMo. So it is hard to find a clean solution here.

    The routine also try now to read the MC_conc_tdep.out if there is not agesfile (i.e. “mc_ages.txt”). However, in that file the initial abundances are not included.

  • directory (string) – The model directory.

  • agesfile (string) – The file with the ages (default: mc_ages.txt)

  • speciesfile (string) – The file with the species names (default: mc_species.txt)

  • rcfile (string) – The file with the calculated rate coefficients (default: MC_rate_coefficients.txt)

prodimopy.read_mc.read_umist(directory, filename='dc_molecules.dat', name=None)[source]

Reads the results of a UMIST rate13 code model. Uses the output produced by dc.pl script provided by the UMIST code distribution.

The data is provided as a prodimopy.read_mc.Data_mc object.