exo_k.ktable_io
@author: jeremy leconte
Module Contents
- class exo_k.ktable_io.Ktable_io[source]
Bases:
exo_k.data_table.Data_table
A class to handle the input-output methods of the
Ktable
class.Initializes all attributes to None
- read_hdf5(filename=None, mol=None, wn_range=None, wl_range=None)[source]
Initializes k coeff table and supporting data from an hdf5 file (compatible with Exomol format)
- Parameters:
file (
str
) – Name of the input 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_atmo(filename=None, mol=None, wn_range=None, wl_range=None, n_bands=None)[source]
Initializes k coeff table and supporting data from an netcdf file (compatible with ATMO format)
- Parameters:
file (
str
) – Name of the input netcdf file
- write_atmo(path=None, note='t5e-3_uw1116', max_Ng=150)[source]
Write a k coeff table in a netcdf file compatible with ATMO format.
- Parameters:
path (
str
) – Name of the output netcdf file or path in which to create file. If directory, then the filename will be constructed as “{path}/{mol}_{Nw}_{note}.nc”
- read_LMDZ(path=None, res=None, band=None, mol=None)[source]
Initializes k coeff table and supporting data from a .dat file in a gcm friendly format.
Units are assumed to be cm^2 for kdata and mbar for pressure.
- Parameters:
path (
str
) – Name of the directory with the various input filesres (
str
) – “IRxVI” where IR and VI are the numbers of bands in the infrared and visible of the k table to load.band (
str
) – “IR” or “VI” to specify which band to load.mol (
str
) – Name of the molecule to be saved in the Ktable object.
- write_LMDZ(path, band='IR', fmt='%22.15e', write_only_metadata=False)[source]
Saves data in a LMDZ friendly format.
The gcm requires p in mbar and kdata in cm^2/molec. The conversion is done automatically.
- read_nemesis(filename=None, mol=None)[source]
Initializes k coeff table and supporting data from a Nemesis binary file (.kta)
- write_nemesis(filename)[source]
Saves data in a nemesis format.
Based on a routine provided by K. Chubb.
- Parameters:
filename (
str
) – Name of the file to be created and saved
- read_arcis(filename=None, mol=None)[source]
Initializes k coeff table and supporting data from an ARCI fits file (.fits)
- write_arcis(filename)[source]
Saves data in an ARCIS fits format.
- Parameters:
filename (
str
) – Name of the file to be created and saved
- read_pickle(filename=None)[source]
Initializes k coeff table and supporting data from an Exomol pickle file