Microphysics#

The pyathena.microphysics module contains classes and functions for ISM microphysics: cooling functions, chemical equilibrium, dust properties, photoionization cross-sections, and recombination rates.

Solar Abundances#

class pyathena.microphysics.abundance_solar.AbundanceSolar(xHe=0.0955, Zprime=1.0)[source]#

Class to read protosolar abundances of the elements with Z <= 32 (Table 1.4 in Draine 2011; based on Asplund et al. 2009) and compute mean molecular weight, etc.

Properties#

dfpandas DataFrame

Table 1.4 in Draine (2011)

param xHe

Elemental abundance of helium. Default value is 0.0955 (Asplund+2009)

type xHe

float

param Zprime

Metallicity scaled to solar abundances.

type Zprime

float

get_XYZ_muH_mu(verbose=False)[source]#

Compute mass fractions of hydrogen (X), helium (Y), and metals (Z), mean molecular weight per H (muH), and mean molecular weight per particle (mu). Dust depletion is ignored.

Parameters

verbose (bool) – Print summary of results.

Cooling Functions#

class pyathena.microphysics.cool_gnat12.CoolGnat12(abundance='Asplund09', Zprime=1.0, read_all=True)[source]#

Class to read ion-by-ion cooling function Gnat & Ferland (2012)

Properties#

infopandas DataFrame

basic information

tempfloat array

tempreature array (10^4 K to 10^8 K)

cool_ciefloat array

cooling

ion_fracfloat array

cooling

download_data(url='http://wise-obs.tau.ac.il/~orlyg/ion_by_ion/')[source]#

Download ion-by-ion cooling efficiency tables

get_cool_cie(element)[source]#

Parameter#

elementstr

Name of ion (e.g., )

static num_to_roman(n)[source]#

Convert an integer to a Roman numeral

class pyathena.microphysics.cool_rosen95.CoolRosen95[source]#

Compute Lambda from Rosen & Bregman (1995)

static LambdaRosen95(T)[source]#

Original definition (zero below 300 K)

static LambdaRosen95_extrapolate(T)[source]#

Extrapolation in log-log space below 300 K

class pyathena.microphysics.cool_wiersma09.CoolWiersma09(z=0.0, CIE=False)[source]#

Class to read Wiersma cooling tables Need to first run idl scripts to generate tables or download hdf5 files (for non-zero redshift)

# Data from: # https://www.strw.leidenuniv.nl/WSS08 # https://www.strw.leidenuniv.nl/WSS08/z_collis.txt # https://www.strw.leidenuniv.nl/WSS08/coolingtables_highres.tar.gz

pyathena.microphysics.cool_grackle.cool_grackle(Z=1.0)[source]#

Function to read equilibrium cooling function in grackle

Parameters

Z (float) – Metallicity

Dust#

class pyathena.microphysics.dust_draine.DustDraine(basedir='/tigress/jk11/pyathena')[source]#

Class to read dust extinction, scattering, and absorption properties computed for carbonaceous-silicate model for interstellar dust with R_V=3.1 (Draine 2003)

Tabulated quantities in DataFrame: lwav = wavelength in vacuo (micron) lwavAA = wavelength in vacuo (Anstrom) albedo = (scattering cross section)/(extinction cross section) cos = <cos(theta)> for scattered light cossq = <cos^(theta)> for scattered light Cext = extinction cross section per H nucleon (cm^2/H) K_abs = absorption cross section per mass of dust (cm^2/gram) kappa_abs = absorption cross section per mass of gas (cm^2/gram)

https://www.astro.princeton.edu/~draine/dust/dustmix.html

Example

dfa (dictionary) has all data.

>>> d = DustDraine()
>>> print(d.dfa.keys())

Print gas-to-dust ratio >>> d = DustDraine() >>> print(d.GTD)

Photoionization Cross-Sections#

class pyathena.microphysics.photx.PhotX(datadir=None)[source]#

Computes photoionization cross-sections as described in Verner 96 http://adsabs.harvard.edu/abs/1996ApJ…465..487V Original python code from Rabacus implementation galtay/rabacus (Released under GNU GPL3 v.30; JKIM: is it okay to copy snippets of their code? what to do with license?)

get_Eth(Z, N, unit='eV')[source]#

Threshold ionization energy in eV for ions defined by Z and N.

Parameters
  • Z (int) – Atomic number (number of protons)

  • N (int) – Electron number

Returns

Eth – Threshold ionization energy in eV

Return type

float

get_sigma(Z, N, E)[source]#

Returns a photo-ionization cross-section for an ion defined by Z and N at energies E in eV.

Parameters
  • Z (int) – Atomic number (number of protons)

  • N (int) – Electron number (number of electrons)

  • E (array of floats) – Calculate cross-section at these energies [eV]

Returns

sigma – Photoionization cross-sections [cm^-2]

Return type

array of floats

Recombination Rates#

class pyathena.microphysics.rec_rate.RecRate[source]#

Class to compute Badnell (radiative/dielectronic) recombination rates, Draine (2011)’s recombination rates

get_dr_rate(Z, N, T, M=1)[source]#

Calculate dielectronic recombination rate coefficient

Parameters
  • Z (int) – Nuclear Charge

  • N (int) – Number of electrons of the initial target ion (before recombination)

  • T (array of floats) – Temperature [K]

  • M (int) – Initial metastable levels (M=1 for the ground state) of the ground and metastable terms. The defualt value is 1.

Returns

rr – Dielectronic recombination coefficients [cm^3 s^-1]

Return type

array of floats

get_rec_rate(Z, N, T, M=1, kind='badnell')[source]#

Calculate radiative + dielectronic recombination rate coefficient

Parameters
  • Z (int) – Nuclear Charge

  • N (int) – Number of electrons of the initial target ion (before recombination)

  • T (array of floats) – Temperature [K]

  • M (int) – Initial metastable levels (M=1 for the ground state) of the ground and metastable terms. The defualt value is 1.

  • kind (str) – Set to ‘badnell’ to use fits Badnell fits or ‘dr11’ to use Draine (2011)’s formula.

Returns

rrate – Recombination rate coefficient [cm^3 s^-1]

Return type

array of floats

static get_rec_rate_H_caseA_Dr11(T)[source]#

Compute case A recombination rate coefficient for H Table 14.1 in Draine (2011)

static get_rec_rate_H_caseB(T)[source]#

Compute case B recombination rate coefficient for H This is what we use in Athena-TIGRESS (fit to Ferland)

static get_rec_rate_H_caseB_Dr11(T)[source]#

Compute case B recombination rate coefficient for H Table 14.1 in Draine (2011)

static get_rec_rate_grain(ne, G0, T, Z)[source]#

Compute grain assisted recombination coefficient Ch 14.8 in Draine (2011)

get_rr_rate(Z, N, T, M=1)[source]#

Calculate radiative recombination rate coefficient

Parameters
  • Z (int) – Nuclear Charge

  • N (int) – Number of electrons of the initial target ion

  • T (array of floats) – Temperature [K]

  • M (int) – Initial metastable levels (M=1 for the ground state) of the ground and metastable terms. The defualt value is 1.

Returns

rr – Radiative recombination coefficients [cm^3 s^-1]

Return type

array of floats

H2 Chemistry#

pyathena.microphysics.h2.calc_xH2eq(nH, xi_H=2e-16, k_gr=3e-17, zeta_LW=0.0)[source]#

Calculate equilibrium H2 fraction xH2_eq (Gong et al. 2018)

Parameters
  • nH (floats) – number density of hydrogen [cm^-3]

  • xi_H (floats) – primary cosmic ray ionization rate [H^-1 s^-1]

  • k_gr (floats) – H2 formation rate on grain surface [cm^3 s^-1]

  • zeta_LW (floats) – photodissociation rate [s^-1] For Draine’s ISRF in the solar neighborhood: 5.7e-11 s^-1

Return type

Equilibrium H2 fraction