:py:mod:`exo_k.util.spectral_object` ==================================== .. py:module:: exo_k.util.spectral_object .. autoapi-nested-parse:: @author: jeremy leconte A class with some basic functions for all objects with a spectral dimension Module Contents --------------- .. py:class:: Spectral_object Bases: :py:obj:`object` A class with some basic functions for all objects with a spectral dimension Initializes some attributes to None .. py:property:: wls Returns the wavelength array for the bin centers (in micron) .. py:property:: wledges Returns the wavelength array for the bin edges (in micron) .. py:property:: wnrange Returns the limits of the wavenumber range. First tries with wnedges (for Ktables) and then wns (Xtables). .. py:property:: wlrange Returns the limits of the wavelength range .. py:method:: _compute_spectral_range(wn_range=None, wl_range=None) Converts an unordered spectral range in either wavenumber or wavelength in an ordered wavenumber range. :param wn_range: Minimum and maximum wavenumber (in cm^-1). :type wn_range: :class:`list` or :class:`array` of :class:`size 2` :param wl_range: Minimum and maximum wavelength (in micron) :type wl_range: :class:`list` or :class:`array` of :class:`size 2` .. py:method:: select_spectral_range(wn_range=None, wl_range=None) Select spectral range, without restricting the data (but the spectral axes are modified in place). Should use either wn_range OR wl_range, not both. To be selected, the whole bin must be inside the range. :param wn_range: Wavenumber range in cm^-1. :type wn_range: :class:`array`, :class:`np.ndarray` :param wl_range: Wavelength range in micron. :type wl_range: :class:`array`, :class:`np.ndarray` :returns: tuple: iw_min, iw_max the boundary indices of the spectral range .. py:method:: blackbody(Temperature, integral=True) Computes the surface black body flux (in W/m^2/cm^-1) at Temperature. :param Temperature; float: Blackbody temperature :param integral: * If true, the black body is integrated within each wavenumber bin. * If not, only the central value is used. False is faster and should be ok for small bins, but True is the correct version. :type integral: :class:`boolean`, *optional* :returns: Spectrum object Spectral flux in W/m^2/cm^-1