Routines for running slab models

This module provides several routines to run 0D and 1D (radial) ProDiMo slab model. More robust and efficient implementation can be found in ProDiMo Fortran package, which also includes multiple species. The QTpy directory provided in the python zip (available here: https://hitran.org/suppl/TIPS/TIPS2021/) should be separately downloaded and the path should be provided for running the slab routines. The HITRAN line data files (the .par files) should also be downloaded (https://hitran.org/lbl/). If you have ProDiMo FORTRAN package installed, these files are also available in the ‘data/HITRAN2020/’ directory.

Also check the example notebook.

Usage example

The following example runs 0D and 1D slab model. The run_0D_slab() function runs 0D ProDiMo slab. The run_1D_radial_slab() function runs 1D radial ProDiMo slab.

# the prodimopy modules for running
import prodimopy.run_slab as runs

runs.run_0D_slab(1e17,250,2.0,'CO2',44,'/path/to/prodimo/data/HITRAN2020/CO2.par',1e5,'/path/to/directory/containing/QTpy','CO2_0D.fits.gz',isotopolog=[1],wave_mol=[4,30],wave_spec=[4.9,28])
runs.run_1D_radial_slab([1e17,1e16,1e15],[250,200,150],[0.1,0.2,1.0],190,2.0,'CO2',44,'/path/to/prodimo/data/HITRAN2020/CO2.par',1e5,'/path/to/directory/containing/QTpy','CO2_0D.fits.gz',width='infer',Rin_limit=0.07,Rout_limit=600,isotopolog=[1],wave_mol=[4,30],wave_spec=[4.9,28]):

Source documentation

prodimopy.run_slab.boltzmann_distribution(E_level, g, Temperature, Partition_sum)[source]

Calculates LTE level population

Parameters:
  • E_level (scalar or numpy array) – Energy level (cm-1)

  • g (scalar or numpy array) – Statistical weight or degeneracy of the level

  • Temperature (scalar or numpy array) – Gas temperature in Kelvin

  • Partition_sum (scalar or numpy array) – (HITRAN) Partition sum

prodimopy.run_slab.profile_function(nu, nu0, dnu)[source]

Calculates the profile function at a given spectral location. Assumes a Gaussian profile. Note that here the factor 1/(dnu*pi**0.5) is left out and is required to be multiplied wherever this function is used. All the input parameters should be in the same units.

Parameters:
  • nu (scalar or numpy array) – Spectral location where the profile function needs to be calculated

  • nu0 (scalar or numpy array) – Spectral location of the line center

  • dnu (scalar or numpy array) – The Doppler frequency shift

prodimopy.run_slab.planck(T, nu)[source]

Calculates the Planck function at a given frequency for a given temperature

Parameters:
  • T (scalar or numpy array) – Temperature of the Planck curve in Kelvin

  • nu (scalar or numpy array) – Frequency in Hz

prodimopy.run_slab.fetch_QT(mol, iso, T, QTpath, T_limit='warn', verbose=True)[source]

Retrieve the partition sum from HITRAN QTpy files

Parameters:
  • mol (string) – Molecule name, e.g. ‘CO2’

  • iso (integer) – Isotopologue number, see hitran.org for more information

  • T (float) – Temperature in Kelvin

  • QTpath (string) – Path pointing to directory containing the directory QTpy provided by HITRAN (see hitran.org)

prodimopy.run_slab.run_0D_slab(Ng, Tg, vturb, molecule, mol_mass, HITRANfile, R_grid, QTpath, output_filename, isotopolog=[1], wave_mol=[4, 30], wave_spec=[4.9, 28])[source]

This is a python implementation of 0D slab models, based on the FORTRAN version of 0D slab models in ProDiMo (https://prodimo.iwf.oeaw.ac.at/) This runs models with line overlap. More robust and efficient code is available on Fortran, please check the above website (especially for running large grids of models). The Fortran code also supports OMP and supports including multiple species.

Ngfloat

Gas column density (cm-2)

Tg: float

Gas temperature (K)

vturbfloat

Turbulent velocity of the gas (km/s)

moleculestring

Molecule name, e.g. ‘CO2’

mol_massfloat or int

Molecular mass in atomic mass units (amu)

HITRANfilestring

Path to the HITRAN ‘.par’ file containing the line data downloaded from HITRAN

R_gridfloat

High resolution grid on which the spectra has to be calculated initially Recommend minimum of 1e5

QTpathstring

Path pointing to directory containing the directory QTpy provided by HITRAN (see hitran.org)

output_filename: string

Filename(+path) for the fits output file Use the extension ‘.fits.gz’

isotopologlist

List containing isotopologue numbers (HITRAN format)

wave_mollist

Wavelength limits in microns to select the lines from the HITRAN file

wave_speclist

Wavelength limits in microns for calculating the spectra

prodimopy.run_slab.run_0D_point(Ng, Tg, vturb, molecule, mol_mass, nu_0, Aul, E_u, E_l, gu, gl, QTpath, isotopolog, nu_grid)[source]

This runs a RT on a single point with line overlap. All variables use SI unit

Ngfloat

Gas column density (m-2)

Tg: float

Gas temperature (K)

vturbfloat

Turbulent velocity of the gas (m/s)

moleculestring

Molecule name, e.g. ‘CO2’

mol_massfloat or int

Molecular mass in atomic mass units (amu)

nu_0numpy array

Line frequencies (Hz)

Aulnumpy array

Einstein A coefficient

E_unumpy array

Upper energy level

E_lnumpy array

Lower energy level

gunumpy array

Statistical weight / degeneracy of upper level

glnumpy array

Statistical weight / degeneracy of lower level

QTpathstring

Path pointing to directory containing the directory QTpy provided by HITRAN (see hitran.org)

isotopologlist

List containing isotopologue numbers (HITRAN format)

nu_gridnumpy array

Array containing spectral grid for the final spectra

prodimopy.run_slab.write_0D_output(output_filename, nu_grid, I_nu_line, tau_ret, R_grid, Ng, Tg, vturb)[source]

Writes output file containing the output of the 0D slab model

prodimopy.run_slab.run_1D_radial_slab(Ng, Tg, R, d, vturb, molecule, mol_mass, HITRANfile, R_grid, QTpath, output_filename, width='area_given', Rin_limit=0, Rout_limit=1e+99, isotopolog=[1], wave_mol=[4, 30], wave_spec=[4.9, 28])[source]

This is a python implementation of 1D radial slab models, based on the FORTRAN version of 1D slab models in ProDiMo (https://prodimo.iwf.oeaw.ac.at/) This runs models with line overlap. More robust and efficient code (including vertical slab model) is available in Fortran, please check the above website (especially for running large grids of models). The Fortran code also supports OMP and supports including multiple species.

Ngnumpy array or list

Gas column density (cm-2)

Tgnumpy array or list

Gas temperature (K)

Rnumpy array or list

Radius (AU)

dfloat

Distance of the disk (parsec)

vturbfloat

Turbulent velocity of the gas (km/s)

moleculestring

Molecule name, e.g. ‘CO2’

mol_massfloat or int

Molecular mass in atomic mass units (amu)

HITRANfilestring

Path to the HITRAN ‘.par’ file containing the line data downloaded from HITRAN

R_gridfloat

High resolution grid on which the spectra has to be calculated initially Recommend minimum of 1e5

QTpathstring

Path pointing to directory containing the directory QTpy provided by HITRAN (see hitran.org)

output_filenamestring

Filename(+path) for the fits output file Use the extension ‘.fits.gz’

widthstring or list or float

‘area_given’ - the provided radii array is used as the emitting area equivalent radius ‘infer’ - Assumes the provided radius as radial distance from the star and calculates the width of individual rings of slab grids list - List containing emitting area equivalent radii float - Constant emitting area equivalent radius, used for all grid points

Rin_limitfloat

Inner radius limit of the disk (AU)

Rout_limitfloat

Outer radius limit of the disk (AU)

isotopologlist

List containing isotopologue numbers (HITRAN format)

wave_mollist

Wavelength limits in microns to select the lines from the HITRAN file

wave_speclist

Wavelength limits in microns for calculating the spectra