:py:mod:`exo_k.ktable_io` ========================= .. py:module:: exo_k.ktable_io .. autoapi-nested-parse:: @author: jeremy leconte Module Contents --------------- .. py:class:: Ktable_io Bases: :py:obj:`exo_k.data_table.Data_table` A class to handle the input-output methods of the :class:`~exo_k.ktable.Ktable` class. Initializes all attributes to `None` .. py:method:: read_hdf5(filename=None, mol=None, wn_range=None, wl_range=None) Initializes k coeff table and supporting data from an hdf5 file (compatible with Exomol format) :param file: Name of the input hdf5 file :type file: :class:`str` .. py:method:: write_hdf5(filename, compression='gzip', compression_level=9, kdata_unit=None, p_unit=None, exomol_units=False) Saves data in a hdf5 format :param filename: Name of the file to be created and saved :type filename: :class:`str` :param exomol_units: If True, data are converted back to cm^2 and bar units before being written. :type exomol_units: :class:`bool (optional)` .. py:method:: read_LMDZ(path=None, res=None, band=None, mol=None) 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. :param path: Name of the directory with the various input files :type path: :class:`str` :param res: "IRxVI" where IR and VI are the numbers of bands in the infrared and visible of the k table to load. :type res: :class:`str` :param band: "IR" or "VI" to specify which band to load. :type band: :class:`str` :param mol: Name of the molecule to be saved in the Ktable object. :type mol: :class:`str` .. py:method:: write_LMDZ(path, band='IR', fmt='%22.15e', write_only_metadata=False) Saves data in a LMDZ friendly format. The gcm requires p in mbar and kdata in cm^2/molec. The conversion is done automatically. :param path: Name of the directory to be created and saved, the one that will contain all the necessary files :type path: :class:`str` :param band: The band you are computing: 'IR' or 'VI' :type band: :class:`str` :param fmt: Fortran format for the corrk file. :type fmt: :class:`str` .. py:method:: read_nemesis(filename=None, mol=None) Initializes k coeff table and supporting data from a Nemesis binary file (.kta) :param file: Name of the input Nemesis binary file. :type file: :class:`str` :param mol: Name of the molecule. :type mol: :class:`str`, *optional* .. py:method:: write_nemesis(filename) Saves data in a nemesis format. Based on a routine provided by K. Chubb. :param filename: Name of the file to be created and saved :type filename: :class:`str` .. py:method:: read_exorem(filename, mol=None) Reads data in an ExoREM .dat format :param filename: Name of the input file. :type filename: :class:`str` :param mol: Name of the molecule. :type mol: :class:`str`, *optional* .. py:method:: read_arcis(filename=None, mol=None) Initializes k coeff table and supporting data from an ARCI fits file (.fits) :param file: Name of the input fits file. :type file: :class:`str` :param mol: Name of the molecule. :type mol: :class:`str`, *optional* .. py:method:: write_arcis(filename) Saves data in an ARCIS fits format. :param filename: Name of the file to be created and saved :type filename: :class:`str` .. py:method:: read_pickle(filename=None) Initializes k coeff table and supporting data from an Exomol pickle file :param filename: Name of the input pickle file :type filename: :class:`str` :param mol: Force the name of the molecule :type mol: :class:`str`, *optional* .. py:method:: write_pickle(filename) Saves data in a pickle format :param filename: Name of the file to be created and saved :type filename: :class:`str` .. py:method:: spectrum_to_plot(p=1e-05, t=200.0, x=1.0, g=None) :abstractmethod: Dummy function to be defined in inheriting classes .. py:function:: read_nemesis_binary(filename) reads a nemesis binary file.