Molecule: Spectral line transition data for various molecules#
For fitting of excitation diagrams, transition data (energy levels, wavelengths, temperatures, etc.) are manage via subclasses of the BaseMolecule class. Currently, \(H_2, ^{12}CO, ^{13}CO, ^{12}C^{18}O, ^{13}C^{18}O, {\rm and}~ CH^{+}\) are supported.
- class pdrtpy.molecule.BaseMolecule(name: str, path: Path | str, opr: float = 1, opr_can_vary: bool = False, **kwargs)[source]#
Bases:
objectThe base class for holding molecular transition data.
- Parameters:
- namestr
The descriptive name of the molecule, which will be used in displays. Can include LaTeX (without $ signs) e.g. ‘H_2’, ‘CO’, ‘^{13}CO’.
- pathUnion[Path, str]
Path to the table of molecular transition data.
- oprfloat
The canonical ortho-to-para ratio for molecules containing hydrogen. Default 1.
- opr_can_varybool
Can the ortho-to-para ratio vary in this molecule under different physical conditions? Default:False
- **kwargs: dict
Additional keywords to pass to Table.read
- Attributes:
canonical_oprThe canonical ortho-to-para ratio of the molecule.
line_idsThe identifiers (names) of the spectral line transitions in the data.
line_wavelengthsThe wavelengths of the spectral line transitions in the data.
nameThe descriptive name of the molecule
opr_can_varyDoes the ortho-to-para ratio vary in this molecule under different physical conditions?
transition_dataThe table fo transition data, containing columns such as transition energy, statistical weight, Einstein A coefficient, wavelength etc.
Methods
partition_function(temperature)Calculate the partition function given an excitation temperature(s)
- property canonical_opr: float#
The canonical ortho-to-para ratio of the molecule. Only used for molecules containing hydrogen (where canonical OPR=3).
- Returns:
- float
The ortho-to-para ratio
- property line_ids: list#
The identifiers (names) of the spectral line transitions in the data. These should be used to identify your Measurement data for excitation fits.
- Returns:
- list
The spectral line IDs
- property line_wavelengths: Quantity#
The wavelengths of the spectral line transitions in the data. These should be used to identify your Measurement data for excitation fits.
- Returns:
QuantityThe spectral line wavelengths
- property name#
The descriptive name of the molecule
- Returns:
- str
Descriptive name of the moelcule
- property opr_can_vary#
Does the ortho-to-para ratio vary in this molecule under different physical conditions?
- Returns:
- bool
True if OPR can vary, False otherwise.
- partition_function(temperature: Quantity) ndarray[source]#
Calculate the partition function given an excitation temperature(s)
The default calculation is
\(Q(T) = \sum g_j~e^{-E_j/kT}\)
where \(g_j\) is the statistical weight, \(E_j\) is the transition energy, \(T\) is the excitation temperature, and \(k\) is Boltzmann’s constant.
Sub-classes should override this method for custom (and likely more accurate) partition function calculation.
- class pdrtpy.molecule.C13O(name='^{13}CO', path='13co_transition.tab', opr=1.0, opr_can_vary=False)[source]#
Bases:
BaseMoleculeCarbon Monoxide isotopologue \(^{13}C^{16}O\). This uses the molecular Lines and Levels data from the Meudon PDR7 code.
- Attributes:
canonical_oprThe canonical ortho-to-para ratio of the molecule.
line_idsThe identifiers (names) of the spectral line transitions in the data.
line_wavelengthsThe wavelengths of the spectral line transitions in the data.
nameThe descriptive name of the molecule
opr_can_varyDoes the ortho-to-para ratio vary in this molecule under different physical conditions?
transition_dataThe table fo transition data, containing columns such as transition energy, statistical weight, Einstein A coefficient, wavelength etc.
Methods
partition_function(temperature)Calculate the partition function for 13CO at the given temperature using the HITRAN partition function.
- partition_function(temperature: Quantity) ndarray[source]#
Calculate the partition function for 13CO at the given temperature using the HITRAN partition function. https://hitran.org/data/Q/q27.txt The HITRAN function is evaluated at 1K intervals; this function performs a linear interpolation on those data.
- class pdrtpy.molecule.C13O18(name='^{13}C^{18}O', path='13c18o_transition.tab', opr=1.0, opr_can_vary=False)[source]#
Bases:
BaseMoleculeCarbon Monoxide isotopologue \(^{12}C^{18}O\). This uses the molecular Lines and Levels data from the Meudon PDR7 code.
- Attributes:
canonical_oprThe canonical ortho-to-para ratio of the molecule.
line_idsThe identifiers (names) of the spectral line transitions in the data.
line_wavelengthsThe wavelengths of the spectral line transitions in the data.
nameThe descriptive name of the molecule
opr_can_varyDoes the ortho-to-para ratio vary in this molecule under different physical conditions?
transition_dataThe table fo transition data, containing columns such as transition energy, statistical weight, Einstein A coefficient, wavelength etc.
Methods
partition_function(temperature)Calculate the partition function for 13C18O at the given temperature using the HITRAN partition function.
- partition_function(temperature: Quantity) ndarray[source]#
Calculate the partition function for 13C18O at the given temperature using the HITRAN partition function. https://hitran.org/data/Q/q30.txt The HITRAN function is evaluated at 1K intervals; this function performs a linear interpolation on those data.
- class pdrtpy.molecule.CHplus(name='CH^+', path='CH_p_transition.tab', opr=3.0, opr_can_vary=True)[source]#
Bases:
BaseMoleculeMethyl Cation isotopologue \(^{12}CH^{+}\). This uses the molecular data from both the Meudon PDR7 code and EXOMOL database
- Attributes:
canonical_oprThe canonical ortho-to-para ratio of the molecule.
line_idsThe identifiers (names) of the spectral line transitions in the data.
line_wavelengthsThe wavelengths of the spectral line transitions in the data.
nameThe descriptive name of the molecule
opr_can_varyDoes the ortho-to-para ratio vary in this molecule under different physical conditions?
transition_dataThe table fo transition data, containing columns such as transition energy, statistical weight, Einstein A coefficient, wavelength etc.
Methods
partition_function(temperature)Calculate the partition function for \(^{12}CH^{+}\) at the given temperature using the EXOMOL partition function (Pearce et al., 2024, MNRAS, 527, 10736).
- partition_function(temperature: Quantity) ndarray[source]#
Calculate the partition function for \(^{12}CH^{+}\) at the given temperature using the EXOMOL partition function (Pearce et al., 2024, MNRAS, 527, 10736). The EXOMOL function is evaluated at 1K intervals; this function performs a linear interpolation on those data.
Note
As described in Pearce+2024, “The ExoMol convention, in accordance with HITRAN (Gamache et al. 2017, J. Quant. Spectrosc. Radiat. Transfer, 203, 70) , is to provide partition functions that include full atomic nuclear spin degeneracy, \(g_{nu}\).”
This results in a factor of 2 increase over the partition functions of Barklem and Collet (2016, A&A,588,A96) and of Godard and Cernicharo (2013) A&A, 550, A8. Be aware of this when comparing total column densities with papers that use those partition functions.
- class pdrtpy.molecule.CO(name='^{12}CO', path='12co_transition.tab.gz', opr=1.0, opr_can_vary=False)[source]#
Bases:
BaseMoleculeCarbon Monoxide isotopologue \(^{12}C^{16}O\). This uses the molecular Lines and Levels data from the Meudon PDR7 code.
- Attributes:
canonical_oprThe canonical ortho-to-para ratio of the molecule.
line_idsThe identifiers (names) of the spectral line transitions in the data.
line_wavelengthsThe wavelengths of the spectral line transitions in the data.
nameThe descriptive name of the molecule
opr_can_varyDoes the ortho-to-para ratio vary in this molecule under different physical conditions?
transition_dataThe table fo transition data, containing columns such as transition energy, statistical weight, Einstein A coefficient, wavelength etc.
Methods
partition_function(temperature)Calculate the partition function for CO at the given temperature using the HITRAN partition function.
- partition_function(temperature: Quantity) ndarray[source]#
Calculate the partition function for CO at the given temperature using the HITRAN partition function. https://hitran.org/data/Q/q26.txt The HITRAN function is evaluated at 1K intervals; this function performs a linear interpolation on those data.
- class pdrtpy.molecule.CO18(name='^{12}C^{18}O', path='c18o_transition.tab', opr=1.0, opr_can_vary=False)[source]#
Bases:
BaseMoleculeCarbon Monoxide isotopologue \(^{12}C^{18}O\). This uses the molecular Lines and Levels data from the Meudon PDR7 code.
- Attributes:
canonical_oprThe canonical ortho-to-para ratio of the molecule.
line_idsThe identifiers (names) of the spectral line transitions in the data.
line_wavelengthsThe wavelengths of the spectral line transitions in the data.
nameThe descriptive name of the molecule
opr_can_varyDoes the ortho-to-para ratio vary in this molecule under different physical conditions?
transition_dataThe table fo transition data, containing columns such as transition energy, statistical weight, Einstein A coefficient, wavelength etc.
Methods
partition_function(temperature)Calculate the partition function for \(^{12}C^{18}O\) at the given temperature using the HITRAN partition function.
- partition_function(temperature: Quantity) ndarray[source]#
Calculate the partition function for \(^{12}C^{18}O\) at the given temperature using the HITRAN partition function. https://hitran.org/data/Q/q28.txt The HITRAN function is evaluated at 1K intervals; this function performs a linear interpolation on those data.
- class pdrtpy.molecule.H2(name='H_2', path='RoueffEtAl.tab', opr=3.0, opr_can_vary=True)[source]#
Bases:
BaseMoleculeMolecular hydrogen. This uses the \(H_2\) line calculations from Roueff et al 2019, A&A, 630, 58, Table 2.
- Attributes:
canonical_oprThe canonical ortho-to-para ratio of the molecule.
line_idsThe identifiers (names) of the spectral line transitions in the data.
line_wavelengthsThe wavelengths of the spectral line transitions in the data.
nameThe descriptive name of the molecule
opr_can_varyDoes the ortho-to-para ratio vary in this molecule under different physical conditions?
transition_dataThe table fo transition data, containing columns such as transition energy, statistical weight, Einstein A coefficient, wavelength etc.
Methods
partition_function(temperature)Calculate the \(H_2\) partition function given an excitation temperature(s).
- partition_function(temperature: Quantity) ndarray[source]#
Calculate the \(H_2\) partition function given an excitation temperature(s). This function uses the expression from Herbst et al 1996 http://articles.adsabs.harvard.edu/pdf/1996AJ….111.2403H
\(Q(T) = 0.247 ~T / [1 - exp(6000 / T)]\)
where \(T\) is the excitation temperature.