ModelSets: The interface to models in the Toolbox#

PDRT supports a variety of PDR models to be used to fit your data. These are represented in the Python class ModelSet. Broadly three classes are available:

  1. Wolfire/Kaufman 2020 models for constant density media (metallicities Z=0.5,1) and viewing angles 0 (face-on), 30, 45, 60, 75 degrees.

  2. Wolfire/Kaufman 2006 face-on models for constant density media (Z=0.1,1,3)

  3. Kosma-\(\tau\) 2013 models for clumpy and non-clumpy media (Z=1)

The viewing angle models calculate the emitted line intensity along a line-of-sight at angle, theta, with respect to the illuminated face of the PDR. The angle theta=0 is a line that is perpendicular to the face while the angle theta=90 is a line that is parallel to the face. The line intensity for each transition as well as the integrated far-infrared intensity is calculated as in Pabst et al. 2017, A&A, 606, A29. We make the assumption that each line of sight passes through all layers of the PDR to an optical depth of Av=7 from the face. This means that the integral along the line-of-sight as well as Av increases as 7/cos(theta), and the thickness of the PDR increases as 7*tan(theta). The user should keep in mind that this assumption may lead to unrealistically large Av that should be checked against observations if possible. The different angles and Avs are given in the fits headers as follows LOSANGLE angle in degrees with respect to illuminated face of PDR.

Note that the face-on intensity is angle averaged over intensities emitted from the PDR face as in Tielens & Hollenbach 1985, but the angle-on intensity is the intensity along the ray at the given angle.

Models are stored in FITS format as ratios of intensities as a function of radiation field and hydrogen nucleus volume density. The FITS headers list three different extinction values:

  • AV: optical depth in magnitudes of visual extinction of PDR along a line through the illuminated face to the deepest layers. All models are fixed at \(A_V = 7\).

  • AVPERP: optical depth in magnitudes of visual extinction of the PDR perpendicular to Av.

  • AVLOS: optical depth in magnitudes of visual extinction of the PDR along the line-of-sight.

For example how to use ModelSets, see the notebook PDRT_Example_ModelSets.ipynb


Manage pre-computed PDR models

class pdrtpy.modelset.ModelSet(name, z, medium='constant density', losangle=0, mass=None, modelsetinfo=None, format='ipac', debug=False)[source]#

Bases: object

Class for computed PDR Model Sets. ModelSet provides interface to a directory containing the model FITS files and the ability to query details about.

Parameters:
namestr

Identifying name, e.g., ‘wk2006’.

zfloat

Metallicity in solar units.

mediumstr

Medium type, e.g. ‘constant density’, ‘clumpy’, ‘non-clumpy’.

losanglefloat

The line-of-sight inclination angle (aka viewing angle), losangle=0 is face-on, losangle=90 is edge-on. Valid values are 0, 30, 45, 60, 75, 90.

massfloat

Maximum clump mass (for KosmaTau models). Default: None (appropriate for Wolfire/Kaufman models).

modelsetinfostr or Table

For adding user specified ModelSet, this parameter specifies the file with information about the ModelSet. It can be a pathname to an external tabular file in an astropy-recognized format or an astropy Table object. If an external tabular file, its format should be given by the format keyword. The columns are:

['PDRcode','name', 'version','path','filename','medium','z','inc', 'mass','description']

z, ‘inc’, and mass should be numbers, the rest should be strings. The name, version, medium, z, ‘inc’, and mass columns contain the values available in the input ModelSet as described above. PDRcode is the originator of the code e.g., “KOSMA-tau”, version is the code version, path is the full-qualified pathname to the FITS files, filename is the tabular file which contains descriptions of individual FITS files. This must also be in the format specified by the format keyword. description is a description of the input ModelSet.

formatstr

If modelsetinfo is a file, give the format of file. Must be an astropy recognized Table format. e.g., ascii, ipac, votable. Default is IPAC format

Attributes:
avlos

The visual extinction along the line of sight, expressed in magnitudes.

avperp

The PDR thickness for inclined viewing angle models, expressed in visual magnitudes.

code

The PDR code that created this ModelSet, e.g.

description

The description of this model

identifiers

Table of lines and continuum that are included in ratio models of this ModelSet.

is_wk2006

Indicate this is a wk2006 model, to deal with quirks of that modelset.

is_wk2020

Indicate this is a wk2020 model, to deal with quirks of that modelset.

losangle

The inclination (viewing) angle with respect to the line of sight, in degrees.

medium

The medium type of this model, e.g.

metallicity

The metallicity of this ModelSet

name

The name of this ModelSet

supported_intensities

Table of lines and continuum that are covered by this ModelSet and have models separate from the any ratio model they might be in.

supported_ratios

The emission ratios that are covered by this ModelSet

table

The table containing details of the models in this ModelSet.

user_added_models

Show which models have been added to this ModelSet by the user

version

The version of this ModelSet

viewangle

The viewing angle (inclination) with respect to the line of sight, in degrees.

z

The metallicity of this ModelSet

Methods

add_model(identifier, model, title[, overwrite])

Add your own model to this ModelSet.

all_sets([debug])

Return a table of the names and descriptions of available ModelSets (not just this one)

find_files(m[, ext])

Find the valid model ratios files in this ModelSet for a given list of measurement IDs.

find_pairs(m)

Find the valid model ratios labels in this ModelSet for a given list of measurement IDs

get_model(identifier[, unit, ext])

Get a specific model by its identifier

get_models(identifiers[, model_type, ext])

Get the models from this ModelSet that match the input list of identifiers

list()

Print the names and descriptions of available ModelSets (not just this one)

model_intensities(m)

Return the model intensities in this ModelSet that match the input Measurement ID list.

model_ratios(m)

Return the model ratios that match the input Measurement ID list.

ratiocount(m)

The number of valid ratios in this ModelSet, given a list of observation (Measurement) identifiers.

Raises:
ValueError

If model set not recognized/found.

add_model(identifier, model, title, overwrite=False)[source]#

Add your own model to this ModelSet.

Parameters:
identifierstr

A Measurement ID. It can be an intensity or a ratio, e.g., “CII_158”,”CI_609/FIR”.

modelstr or Measurement

The model to add. If a string, this must be the fully-qualified path of a FITS file. If a Measurement it must have the same CTYPEs and CUNITs as the models in the ModelSet.

titlestr

A formatted string (e.g., LaTeX) describing this observation that can be used for plotting. Python r-strings are accepted, e.g., r’$^{13}$CO(3-2)’ would give \(^{13}{\rm CO(3-2)}\).

overwritebool

Whether to overwrite the model if the identifier already exists in the ModelSet or has been previously added. Default: False.

static all_sets(debug=False)[source]#

Return a table of the names and descriptions of available ModelSets (not just this one)

Returns:
Table
property avlos#

The visual extinction along the line of sight, expressed in magnitudes. Returns None for non-wk2020 models.

Returns:
float or None
property avperp#

The PDR thickness for inclined viewing angle models, expressed in visual magnitudes. Returns None for face-on geometry (losangle=0) and for non-wk2020 models.

Returns:
float or None
property code#

The PDR code that created this ModelSet, e.g. ‘KOSMA-tau’

Returns:
str
property description#

The description of this model

Returns:
str
find_files(m, ext='fits')[source]#

Find the valid model ratios files in this ModelSet for a given list of measurement IDs. See id()

Parameters:
mlist

List of string Measurement IDs, e.g. [“CII_158”,”OI_145”,”FIR”].

extstr

File extension. Default: “fits”.

Returns:
iterator

An iterator of model ratio files for the given list of Measurement IDs.

find_pairs(m)[source]#

Find the valid model ratios labels in this ModelSet for a given list of measurement IDs

Parameters:
mlist

List of string Measurement IDs, e.g. [“CII_158”,”OI_145”,”FIR”].

Returns:
iterator

An iterator of model ratio labels for the given list of measurement IDs.

get_model(identifier, unit=None, ext='fits')[source]#

Get a specific model by its identifier

Parameters:
identifierstr

A Measurement ID. It can be an intensity or a ratio, e.g., “CII_158”,”CI_609/FIR”.

Returns:
Measurement

The model matching the identifier.

Raises:
KeyError

If identifier not found in this ModelSet.

get_models(identifiers, model_type='ratio', ext='fits')[source]#

Get the models from this ModelSet that match the input list of identifiers

Parameters:
identifierslist

List of string Measurement IDs, e.g., [“CII_158”,”OI_145”,”CS_21”].

model_typestr

Indicates which type of model is requested: one of ‘ratio’ or ‘intensity’.

Returns:
list

The matching models as a list of Measurement.

Raises:
KeyError

If identifiers not found in this ModelSet.

property identifiers#

Table of lines and continuum that are included in ratio models of this ModelSet. Only lines and continuum that are part of ratios are included in this list. For a separate list of line and continuum intensity models see supported_intensities().

Returns:
astropy.table.Table
property is_wk2006#

Indicate this is a wk2006 model, to deal with quirks of that modelset.

Returns:
bool

True if it is.

property is_wk2020#

Indicate this is a wk2020 model, to deal with quirks of that modelset.

Returns:
bool

True if it is.

static list()[source]#

Print the names and descriptions of available ModelSets (not just this one)

property losangle#

The inclination (viewing) angle with respect to the line of sight, in degrees. A value of 0 means face-on.

Returns:
float
property medium#

The medium type of this model, e.g. ‘constant density’, ‘clumpy’, ‘non-clumpy’

Returns:
str
property metallicity#

The metallicity of this ModelSet

Returns:
float
model_intensities(m)[source]#

Return the model intensities in this ModelSet that match the input Measurement ID list. This method will return the intersection of the input list and the list of supported lines.

Parameters:
mlist

List of string Measurement IDs, e.g., [“CII_158”,”OI_145”,”CS_21”].

Returns:
list

List of string identifiers of intensity IDs, e.g., [‘CII_158’,’OI_145’].

model_ratios(m)[source]#

Return the model ratios that match the input Measurement ID list. You must provide at least 2 Measurements IDs

Parameters:
mlist

List of string Measurement IDs, e.g., [“CII_158”,”OI_145”,”FIR”].

Returns:
list

List of string identifiers of ratio IDs, e.g., [‘OI_145/CII_158’, ‘OI_145+CII_158/FIR’].

property name#

The name of this ModelSet

Returns:
str
ratiocount(m)[source]#

The number of valid ratios in this ModelSet, given a list of observation (Measurement) identifiers.

Parameters:
mlist

List of string Measurement IDs, e.g. [“CII_158”,”OI_145”,”FIR”].

Returns:
int

The number of model ratios found for the given list of measurement IDs.

property supported_intensities#

Table of lines and continuum that are covered by this ModelSet and have models separate from the any ratio model they might be in.

Returns:
astropy.table.Table
property supported_ratios#

The emission ratios that are covered by this ModelSet

Returns:
astropy.table.Table
property table#

The table containing details of the models in this ModelSet.

Returns:
astropy.table.Table
property user_added_models#

Show which models have been added to this ModelSet by the user

Returns:
list
property version#

The version of this ModelSet

Returns:
str
property viewangle#

The viewing angle (inclination) with respect to the line of sight, in degrees. A value of 0 means face-on.

Returns:
float
property z#

The metallicity of this ModelSet

Returns:
float