exo_k.xtable
@author: jeremy leconte
Module Contents
- class exo_k.xtable.Xtable(*filename_filters, filename=None, p_unit='unspecified', file_p_unit='unspecified', kdata_unit='unspecified', file_kdata_unit='unspecified', remove_zeros=False, search_path=None, mol=None, **kwargs)[source]
Bases:
exo_k.data_table.Data_table
A class that handles tables of cross sections.
Initializes cross section table and supporting data from a file based on its extension.
- Parameters:
filename (
str
) – Relative or absolute path to the input file.filename_filters (
sequence
ofstring
) – As many strings as necessary to uniquely define a file in the global search path defined inSettings
. This path will be searched for a file with all the filename_filters in the name. The filename_filters can contain ‘*’.
If there is no filename or filename_filters provided, just creates an empty object to be filled later
See
Ktable
__init__ mehthod for documentation on p_unit, file_p_unit, kdata_unit, file_kdata_unit, remove_zeros, search_path, and mol keywords.- read_hdf5(filename=None, mol=None, wn_range=None, wl_range=None)[source]
Initializes k coeff table and supporting data from an Exomol hdf5 file
- write_hdf5(filename, compression='gzip', compression_level=9, kdata_unit=None, p_unit=None, exomol_units=False)[source]
Saves data in a hdf5 format
- Parameters:
filename (
str
) – Name of the file to be created and savedexomol_units (
bool (optional)
) – If True, data are converted back to cm^2 and bar units before being written.
- read_exo_transmit(filename, mol=None)[source]
Creates an xsec object from an exo_transmit like spectra. See https://github.com/elizakempton/Exo_Transmit or Kempton et al. (2016) for details. Pressures are expected to be in Pa and cross sections in m^2/molecule
- hires_to_xtable(path=None, filename_grid=None, logpgrid=None, tgrid=None, write=0, mol=None, grid_p_unit='Pa', p_unit='unspecified', kdata_unit='unspecified', file_kdata_unit='unspecified', **kwargs)[source]
Loads an Xtable from high-resolution spectra (inplace).
Warning
By default, log pressures are specified in Pa in logpgrid!!! If you want to use another unit, do not forget to specify it with the grid_p_unit keyword.
see
exo_k.ktable.Ktable.hires_to_ktable()
method for details on the arguments and options.
- bin_down(wnedges=None, remove_zeros=False, write=0)[source]
Method to bin down a xsec table to a new grid of wavenumbers (inplace).
- Parameters:
wnedges (
array
,np.ndarray
) – Edges of the new bins of wavenumbers (cm-1) onto which the xsec should be binned down. if you want Nwnew bin in the end, wngrid.size must be Nwnew+1 wnedges[0] should be greater than self.wnedges[0] wnedges[-1] should be lower than self.wnedges[-1]remove_zeros (
bool
, optional) – If True, remove zeros in kdata.
- sample(wngrid, remove_zeros=False, log_interp=None)[source]
Method to re sample a xsec table to a new grid of wavenumbers (inplace).
- Parameters:
wngrid (
array
,np.ndarray
) – Location of the new wavenumbers points (cm-1)
- spectrum_to_plot(p=1e-05, t=200.0, x=1.0, g=None)[source]
provide the spectrum for a given point to be plotted