Opacity#

class shone.opacity.Opacity(path=None, grid=None)[source]#

Bases: object

Load and interpolate from a pre-computed opacity grid.

Parameters:
  • path (str, path-like) – File path for an opacity file.

  • grid (Dataset) – The Dataset of an already-loaded opacity grid.

Methods Summary

get_available_species([shone_directory])

Get a table of available opacity files.

get_binned_interpolator(wavelength, ...)

Return a jitted opacity interpolator binned onto wavelength axis wavelength.

get_interpolator()

Return a jitted opacity interpolator for any number of wavelength points, and one temperature and pressure.

load_demo_species(name)

Load a demo opacity archive.

load_species_from_index(idx)

Load an opacity file from its index listed in the output of get_available_species.

load_species_from_name(name)

Load an opacity file from its name listed in the output of get_available_species.

Methods Documentation

classmethod get_available_species(shone_directory=None)[source]#

Get a table of available opacity files.

Parameters:

shone_directory (str, path-like (optional)) – Directory containing opacity files.

Returns:

table – Table containing entries for every opacity file available on disk.

Return type:

Table

get_binned_interpolator(wavelength, temperature, pressure)[source]#

Return a jitted opacity interpolator binned onto wavelength axis wavelength.

Returns:

interp – A just-in-time compiled opacity interpolator.

Return type:

function

get_interpolator()[source]#

Return a jitted opacity interpolator for any number of wavelength points, and one temperature and pressure.

Returns:

interp – A just-in-time compiled opacity interpolator.

Return type:

function

classmethod load_demo_species(name)[source]#

Load a demo opacity archive.

Parameters:

name (str) – Name of the opacity archive to load.

classmethod load_species_from_index(idx)[source]#

Load an opacity file from its index listed in the output of get_available_species.

Parameters:

idx (int) – Index of the opacity file to load.

classmethod load_species_from_name(name)[source]#

Load an opacity file from its name listed in the output of get_available_species.

Parameters:

name (str) – Name of the opacity species to load. Since the “name” entry isn’t guaranteed to be unique, an error is raised if more than one file is available by this name.