:py:mod:`pytmosph3r.interface.io` ================================= .. py:module:: pytmosph3r.interface.io Module Contents --------------- .. py:class:: Input(filename) Bases: :py:obj:`pytmosph3r.log.Logger` Base class to read input data. :class:`~pytmosph3r.interface.HDF5Input` and :class:`~pytmosph3r.interface.ncInput` inherit from it. .. py:method:: open() .. py:method:: close() .. py:method:: keys(path='.') .. py:method:: get(path) :abstractmethod: .. py:method:: getclass(path) :abstractmethod: .. py:method:: read(path, class_obj=None) Read a class (:attr:`class_obj`) from :attr:`path` in HDF5. The keys in :attr:`path` have to match the class arguments. .. note:: If you have parameters to read that are not inputs, you probably want to use a dict as `class_obj`. :param path: Path to class :type path: string :param class_obj: Class to read :type class_obj: Class .. py:class:: Output(filename, append=False) Bases: :py:obj:`Input` Base class to write outputs. :class:`~pytmosph3r.interface.HDF5Output` and :class:`~pytmosph3r.interface.ncOutput` inherit from it. .. py:attribute:: group_func Function pointer to the method creating a group .. py:attribute:: group_class Class pointer to the subclass handling groups .. py:method:: get(path) :abstractmethod: .. py:method:: getclass(path) :abstractmethod: .. py:method:: create_group(group_name) .. py:method:: createGroup(group_name) .. py:method:: close() .. py:method:: write_list(list_array, list_name=None, metadata=None) .. py:method:: write_item(item, key=None, metadata=None, to_write='inputs', verbose=False) .. py:method:: write_dictionary(dic) Recursively write a dictionary into output. .. py:method:: write_obj(obj, to_write='inputs', items=None) Write an object. .. py:method:: write_output(obj, items=None) Write outputs. .. py:class:: Group(f) Bases: :py:obj:`Output`, :py:obj:`abc.ABC` Base class to write outputs. :class:`~pytmosph3r.interface.HDF5Output` and :class:`~pytmosph3r.interface.ncOutput` inherit from it. .. py:function:: write_spectrum(output_file='pytmosph3r_spectrum.dat', model=None) Save a spectrum to a .dat file using a :attr:`model`. The first column lists the wavelengths, the second the value of the flux, the third the noise errorbar, and the fourth the widths of the wavelength edges.