petitRADTRANS.opacities.load#

Attributes#

Functions#

load_cia_opacity(file_path_hdf5[, ...])

Load a CIA opacity file.

load_cloud_opacity(file_path_hdf5[, ...])

Load a cloud opacity file.

load_hdf5_line_opacity_table(file_path_hdf5, frequencies)

Load LBL opacities into a host-side (g, frequency, temperature-pressure) table.

get_line_opacity_file(path_input_data, species, category)

load_line_opacities_pressure_temperature_grid(hdf5_file)

Load line opacities temperature grids.

get_frequency_grids_intersection_indices(...)

Get the indices to fill frequencies from a file within the Radtrans frequency grid.

get_opacity_sources_dict()

_get_default_rebinning_wavelength_range()

rebin_ck_line_opacities(input_file, target_resolving_power)

rebin_multiple_ck_line_opacities(target_resolving_power)

Module Contents#

petitRADTRANS.opacities.load._MISSING_FLOAT#
petitRADTRANS.opacities.load._MISSING_NEG_INF#
petitRADTRANS.opacities.load.load_cia_opacity(file_path_hdf5, return_radtrans_opacities=True)#

Load a CIA opacity file.

petitRADTRANS.opacities.load.load_cloud_opacity(file_path_hdf5, return_radtrans_opacities=True)#

Load a cloud opacity file.

petitRADTRANS.opacities.load.load_hdf5_line_opacity_table(file_path_hdf5, frequencies, line_by_line_opacity_sampling=1, return_radtrans_opacities=True)#

Load LBL opacities into a host-side (g, frequency, temperature-pressure) table.

The returned array stays on the host as a NumPy array so callers can build the final stacked runtime layout first and only convert to JAX once.

petitRADTRANS.opacities.load.get_line_opacity_file(path_input_data, species, category)#
petitRADTRANS.opacities.load.load_line_opacities_pressure_temperature_grid(hdf5_file)#

Load line opacities temperature grids.

petitRADTRANS.opacities.load.get_frequency_grids_intersection_indices(frequencies: jax.typing.ArrayLike, file_frequencies: jax.typing.ArrayLike, tolerate_grid_misalignment: bool = False) tuple[numpy.typing.NDArray[numpy.bool_], numpy.typing.NDArray[numpy.bool_]]#

Get the indices to fill frequencies from a file within the Radtrans frequency grid.

For example, if the Radtrans frequency grid is [0.1, …, 0.3, …, 3] and some loaded opacity frequency grid is in the interval [0.3, …, 3, …, 28], then the output indices will be the indices corresponding to [0.3, …, 3] on the Radtrans frequency grid, and on the file frequency grid.

Args:

frequencies: the Radtrans frequency grid file_frequencies: the file frequency grid tolerate_grid_misalignment: if True, do not raise an error if the intersection indices sizes differ by at most 1.

Returns:

The indices of the intersection between both grids, for the Radtrans grid and the file grid0

petitRADTRANS.opacities.load.get_opacity_sources_dict()#
petitRADTRANS.opacities.load._get_default_rebinning_wavelength_range()#
petitRADTRANS.opacities.load.rebin_ck_line_opacities(input_file, target_resolving_power, wavenumber_grid=None, rewrite=False)#
petitRADTRANS.opacities.load.rebin_multiple_ck_line_opacities(target_resolving_power, paths=None, species=None, rewrite=False)#