Built-in opacity sources

Pyharp ships with a number of opacity sources that can be used to compute the optical properties of the plantary atmosphere.

Sonora2020 molecular opacities

This is a database of pre-mixed Correlated-K hydrogen-helium opacities with abundances given by equilibrium chemistry for each metallicity-C/O combination (version 3) [1]. It has been used for brown dwarf atmospheres [2]. View this document for references of opacities included in the database.

Use the following script to checkout options and download the Sonora2020 database:

fetch-sonora -h

By default, fetch-sonora downloads the database with [Fe/H] = 0.0 and C/O = 1 times solar abundances.

The following functions are available to process the original Sonora2020 opacities and load/save them in the torch’s pt format.

load_sonora_abundances(filename: str) Tuple[List[str], ndarray][source]

Returns the abundances from the Sonora 2020 database.

Parameters:

filename (str) – Path to the abundances file.

Returns:

List of species and their abundances.

Return type:

tuple[list[str], numpy.ndarray]

load_sonora_atm() Tuple[ndarray, ndarray][source]

Returns the atmospheric pressure and temperature from the Sonora 2020 database.

Returns:

Atmospheric pressure (Pa) and temperature (K).

Return type:

tuple[numpy.ndarray, numpy.ndarray]

load_sonora_data(ck_name: str) dict[source]

This functions calls the get_legacy_data_1460

Parameters:

ck_name (str) – The name of the ck file without the .tar.gz extension.

Returns:

A dictionary containing the loaded data.

Return type:

dict

load_sonora_window() Tuple[ndarray, ndarray][source]

Returns the Sonora 2020 spectral window (start, end) in nm.

Returns:

Start and end wavelengths (nm).

Return type:

tuple[numpy.ndarray, numpy.ndarray]

save_sonora_multiband(ck_name: str, data: dict, clean: bool = True) None[source]

Save the Sonora 2020 data to a .pt file.

Parameters:
  • ck_name (str) – The name of the ck file.

  • data (dict) – The data to save.

  • clean (bool) – Whether to clean up the original tar.gz file.

Returns:

None

Return type:

None

Hydrogen and Helium continuum

Pyharp ships with the following continuum opacity sources for H2 and He:

  • H2-H2-eq.xiz.pt

  • H2-He-eq.xiz.pt

  • H2-H2-nm.xiz.pt

  • H2-He-nm.xiz.pt

  • H2-H2-eq.orton.pt

  • H2-He-eq.orton.pt

  • H2-H2-nm.orton.pt

  • H2-He-nm.orton.pt

These are legacy files that have been used the original HARP publication [3]. They are used here in Pyharp to compute the collisional induced absorption (CIA) of H2 and He molecules. The following functions have been used to process the legacy CIA data files:

load_orton_legacy_data(fname: str) dict[source]
Parameters:

fname (str)

Return type:

dict

load_xiz_legacy_data(fname: str) dict[source]
Parameters:

fname (str)

Return type:

dict

save_cia_legacy_wave_temp(fname: str, data: dict) None[source]
Parameters:
Return type:

None

NetCDF dump-backed molecular opacities

Pyharp also supports NetCDF dump-backed molecular absorption through the molecule-line and cia opacity types. These readers consume cross-section fields on (del_temperature, pressure, wavenumber) or any equivalent variable-dimension ordering, convert them into the runtime units used by the C++ radiative-transfer core, and interpolate on the requested band grid.

References