petitRADTRANS.stellar_spectra.phoenix
=====================================

.. py:module:: petitRADTRANS.stellar_spectra.phoenix

.. autoapi-nested-parse::

   Manages the Phoenix star table.



Attributes
----------

.. autoapisummary::

   petitRADTRANS.stellar_spectra.phoenix._PHOENIX_STAR_TABLE
   petitRADTRANS.stellar_spectra.phoenix.phoenix_star_table
   petitRADTRANS.stellar_spectra.phoenix._STAR_SPECTRUM_CACHE


Classes
-------

.. autoapisummary::

   petitRADTRANS.stellar_spectra.phoenix.PhoenixStarTable


Functions
---------

.. autoapisummary::

   petitRADTRANS.stellar_spectra.phoenix._print_min_temperature_warning
   petitRADTRANS.stellar_spectra.phoenix._print_max_temperature_warning
   petitRADTRANS.stellar_spectra.phoenix._build_star_spectrum_cache_key
   petitRADTRANS.stellar_spectra.phoenix.compute_star_spectrum
   petitRADTRANS.stellar_spectra.phoenix.rebin_star_spectrum


Module Contents
---------------

.. py:function:: _print_min_temperature_warning(_)

.. py:function:: _print_max_temperature_warning(_)

.. py:class:: PhoenixStarTable

   Used to store petitRADTRANS's PHOENIX star spectrum models.

   The compute_spectrum function can be used to get a star spectrum at a given temperature.


   .. py:attribute:: _loaded
      :value: False



   .. py:attribute:: log10_effective_temperature_grid
      :value: None



   .. py:attribute:: radius_grid
      :value: None



   .. py:attribute:: flux_grid
      :value: None



   .. py:attribute:: wavelength_grid
      :value: None



   .. py:method:: compute_spectrum(temperature)

      Returns a matrix where the first column is the wavelength in cm
      and the second is the stellar flux :math:`F_\nu` in units of
      :math:`\rm erg/cm^2/s/Hz`, at the surface of the star.
      The spectra are PHOENIX models from (Husser et al. 2013), the spectral
      grid used here was described in van Boekel et al. (2012).

      Args:
          temperature (float):
              stellar effective temperature in K.



   .. py:method:: get_default_file(path_input_data=None)
      :staticmethod:



   .. py:method:: load(file=None, path_input_data=None, search_online=True)


.. py:data:: _PHOENIX_STAR_TABLE

.. py:data:: phoenix_star_table

.. py:data:: _STAR_SPECTRUM_CACHE

.. py:function:: _build_star_spectrum_cache_key(star_effective_temperature, orbit_semi_major_axis, frequencies, star_radius)

.. py:function:: compute_star_spectrum(star_effective_temperature, orbit_semi_major_axis, frequencies, star_radius=None)

   Method to get the PHOENIX spectrum of the star and rebin it
   to the wavelength points. If t_star is not explicitly written, the
   spectrum will be 0. If the distance is not explicitly written,
   the code will raise an error and break to urge the user to
   specify the value.

       Args:
           star_effective_temperature (float):
               the stellar temperature in K.
           orbit_semi_major_axis (float):
               the semi-major axis of the planet in cm.
           frequencies (float):
               the frequencies on which to interpolate the spectrum in Hz.
           star_radius (float):
               if specified, uses this radius in cm
               to scale the flux, otherwise it uses PHOENIX radius.


.. py:function:: rebin_star_spectrum(star_spectrum, star_wavelengths, wavelengths)

