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 saved

  • exomol_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 files

  • res (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.

Parameters:
  • path (str) – Name of the directory to be created and saved, the one that will contain all the necessary files

  • band (str) – The band you are computing: ‘IR’ or ‘VI’

  • fmt (str) – Fortran format for the corrk file.

read_nemesis(filename=None, mol=None)[source]

Initializes k coeff table and supporting data from a Nemesis binary file (.kta)

Parameters:
  • file (str) – Name of the input Nemesis binary file.

  • mol (str, optional) – Name of the molecule.

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_exorem(filename, mol=None)[source]

Reads data in an ExoREM .dat format

Parameters:
  • filename (str) – Name of the input file.

  • mol (str, optional) – Name of the molecule.

read_arcis(filename=None, mol=None)[source]

Initializes k coeff table and supporting data from an ARCI fits file (.fits)

Parameters:
  • file (str) – Name of the input fits file.

  • mol (str, optional) – Name of the molecule.

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

Parameters:
  • filename (str) – Name of the input pickle file

  • mol (str, optional) – Force the name of the molecule

write_pickle(filename)[source]

Saves data in a pickle format

Parameters:

filename (str) – Name of the file to be created and saved

abstract spectrum_to_plot(p=1e-05, t=200.0, x=1.0, g=None)[source]

Dummy function to be defined in inheriting classes

exo_k.ktable_io.read_nemesis_binary(filename)[source]

reads a nemesis binary file.