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/files/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.

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]):
prodimopy.run_slab.read_partition_sums(custom_partition_sum_file)[source]
prodimopy.run_slab.run_0D_slab(Ng, Tg, vturb, molecule, mol_mass, HITRANfile, cdn_scale_fac=[1], custom_partition_sum_file='', isotopolog=[1], wave_mol=[4, 30], wave_spec=[4.9, 28], R_grid=100000.0, output='both', output_filename='default.out', mode='both', convolve_R=None, verbose=True)[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/without 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 or list of strings

Molecule name, e.g. ‘CO2’ or [‘CO2’,’C2H2’,’HCN’]

mol_massfloat or list of floats

Molecular mass(es) in atomic mass units (amu)

HITRANfilestring or listt of strings

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

cdn_scale_faclist of floats

Column density of the molecules are scaled by these factors (useful for including isotopologue ratios)

custom_partition_sum_filestring

Path pointing to file containing custom partition sum (2 columns: temperature, partition sums)

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

R_gridfloat

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

output: string

‘file’ to write output to file, ‘return’ to return a slab type, ‘both’ for both

output_filename: string

Filename(+path) for the output file

modestring

‘overlap’ or ‘line_by_line’ or ‘both’

convolve_Rfloat

Specrtal resolving power to which the spectra has to be convolved (3500 for JWST/MIRI)

verboseboolean

Whether or not to print progress log

prodimopy.run_slab.run_0D_slab_grid(Ng, Tg, vturb, molecule, mol_mass, HITRANfile, cdn_scale_fac=[1], custom_partition_sum_file='', isotopolog=[1], wave_mol=[4, 30], wave_spec=[4.9, 28], R_grid=100000.0, output='both', output_directory='.', output_filename_prefix='default', mode='both', convolve_R=None, write_index_file=True, number_of_cores=1, verbose=True)[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/without 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.

Nglist or numpy.ndarray

Gas column density (cm-2)

Tg: list or numpy.ndarray

Gas temperature (K)

vturblist or numpy.ndarray

Turbulent velocity of the gas (km/s)

moleculestring or list of strings

Molecule name, e.g. ‘CO2’ or [‘CO2’,’C2H2’,’HCN’]

mol_massfloat or list of floats

Molecular mass(es) in atomic mass units (amu)

HITRANfilestring or listt of strings

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

cdn_scale_faclist of floats

Column density of the molecules are scaled by these factors (useful for including isotopologue ratios)

custom_partition_sum_filestring

Path pointing to file containing custom partition sum (2 columns: temperature, partition sums)

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

R_gridfloat

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

outputstring

‘file’ to write output to file, ‘return’ to return a slab type, ‘both’ for both

output_directorystring

Directory path where the output files should be written

output_filename_prefixstring

Filename prefix for the output file without file extension, a number will be appended to this corresponding to each slab model grid point

modestring

‘overlap’ or ‘line_by_line’ or ‘both’

convolve_Rfloat

Specrtal resolving power to which the spectra has to be convolved (3500 for JWST/MIRI)

write_index_filestring

Write an index file containing the index number of each file and the corresponding Ng, Tg, vturb settings for that model

number_of_coresint or string

Number of cores to use to parallelize the grid run. A number or ‘max’, ‘half’, or ‘quarter’ can be specified

verboseboolean

Whether or not to print progress log

prodimopy.run_slab.run_0D_point(Ng, Tg, vturb, molecule, mol_mass, cdn_scale_fac, N_sp_lines, nu0, Aul, E_u, E_l, gu, gl, isotopolog, nu_grid, mode, custom_partition_sum_int=[None])[source]

This runs a RT on a single point with/without 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 or list of strings

Molecule name, e.g. ‘CO2’ or [‘CO2’,’C2H2’,’HCN’]

mol_massfloat or list of floats

Molecular mass(es) in atomic mass units (amu)

cdn_scale_faclist

Column density scaling factor

N_sp_lineslist

List of number of lines of each molecule

nu0numpy 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

isotopologlist

List containing isotopologue numbers (HITRAN format)

nu_gridnumpy array

Array containing spectral grid for the final spectra

modestring

‘line_by_line’ or ‘overlap’ or ‘both’

custom_partition_sum_filestring

Path pointing to file containing custom partition sum (2 columns: temperature, partition sums)

prodimopy.run_slab.convert_to_slab_format(nu_grid, I_nu_line, tau_ret, I_nu, tau_lbl, R_grid, Ng, Tg, cdn_scale_fac, vturb, pop_l, pop_u, mol_data, molecule, N_sp_lines, mode)[source]

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

prodimopy.run_slab.run_1D_radial_slab(Ng, Tg, R, d, vturb, R_grid, output_filename, molecule, mol_mass, HITRANfile, cdn_scale_fac=[1], custom_partition_sum_file='', width='area_given', Rin_limit=0, Rout_limit=1e+99, isotopolog=[1], wave_mol=[4, 30], wave_spec=[4.9, 28], verbose=False)[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)

R_gridfloat

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

output_filenamestring

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

moleculestring

Molecule name, e.g. ‘CO2’

moleculestring or list of strings

Molecule name, e.g. ‘CO2’ or [‘CO2’,’C2H2’,’HCN’]

mol_massfloat or list of floats

Molecular mass(es) in atomic mass units (amu)

HITRANfilestring or listt of strings

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

cdn_scale_faclist of floats

Column density of the molecules are scaled by these factors (useful for including isotopologue ratios)

custom_partition_sum_filestring

Path pointing to file containing custom partition sum (2 columns: temperature, partition sums)

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

prodimopy.run_slab.growth_function(tau)[source]

This function returns the growth function, or the flux growth for the given line optical depth(s)

taunumpy array or list

line optical depth

prodimopy.run_slab.get_dust_opacity_provider(dust_sizes, wavelengths, Q_abs_table)[source]

Factory that returns a pre-configured interpolation function.

class prodimopy.run_slab.slab_model_1D[source]

Bases: object

class:: slab_model_1D Class to run 1D forward slab models

unit_conversions()[source]
reset_units()[source]
init_grid()[source]
read_Qmatrix()[source]
init_dust()[source]
solve_dust_settle(r_au=1.0, M_star=1.0, grain_density=3000)[source]

r_au: Distance from star in AU M_star: Stellar mass in Solar Masses grain_density: kg/m^3 (e.g., 3000 for silicates)

init_gas()[source]
calculate_source(igrid)[source]
calculate_dust_source(igrid)[source]

Calculates source function and tau for dust only.

calculate_spectrum(I_background=None)[source]

Calculates the emergent intensity I_nu from the 1D slab. I_background: Optional array of size (NLAMBDA) for radiation

entering from the bottom (e.g., stellar/disk midplane).

calculate_dust_continuum(I_background=None)[source]
run_model()[source]
convolve(R=1, lambda_0=1, lambda_n=1)[source]
convolve_custom(values, R=1, lambda_0=1, lambda_n=1)[source]
from_prodimo(model_path, r, species=[], LineSelectionFile='LineSelection.in', MieFile='', lambda_0=4.9, lambda_n=28, R_grid=100000.0)[source]