:py:mod:`exo_k.atm_2band` ========================= .. py:module:: exo_k.atm_2band .. autoapi-nested-parse:: @author: jeremy leconte Module Contents --------------- .. py:class:: Atm_2band(k_database_stellar=None, cia_database_stellar=None, **kwargs) Bases: :py:obj:`exo_k.atm.Atm` Class based on :class:`Atm` that handles radiative trasnfer calculations when we want to use different radiative data to treat stellar absorption/scattering and the atmospheric emission. Only the method that change are overloaded. Initialization method that calls Atm_Profile().__init__() and links to Kdatabase and other radiative data. .. py:method:: set_k_database_stellar(k_database=None) Change the radiative database used by the :class:`Gas_mix` object handling opacities inside :class:`Atm`. See :any:`gas_mix.Gas_mix.set_k_database` for details. :param k_database: New Kdatabase to use. :type k_database: :class:`Kdatabase` object .. py:method:: set_cia_database_stellar(cia_database=None) Change the CIA database used by the :class:`Gas_mix` object handling opacities inside :class:`Atm`. See :any:`gas_mix.Gas_mix.set_cia_database` for details. :param cia_database: New CIAdatabase to use. :type cia_database: :class:`CIAdatabase` object .. py:method:: set_gas(composition_dict, Mgas=None, compute_Mgas=True) Sets the composition of the atmosphere. .. py:method:: set_T_profile(tlay) Reset the temperature profile without changing the pressure levels .. py:method:: set_adiab_profile(Tsurf=None, Tstrat=None) Initializes the logP-T atmospheric profile with an adiabat with index R/cp=rcp :param Tsurf: Surface temperature. :type Tsurf: :class:`float` :param Tstrat: Temperature of the stratosphere. If None is given, an isothermal atmosphere with T=Tsurf is returned. :type Tstrat: :class:`float`, *optional* .. py:method:: spectral_integration_stellar(spectral_var) Spectrally integrate an array, taking care of whether we are dealing with corr-k or xsec data. :param spectral_var: array to integrate :type spectral_var: :class:`array`, :class:`np.ndarray` :returns: var: array, np.ndarray array integrated over wavenumber (and g-space if relevant) .. py:method:: opacity_stellar(rayleigh=False, **kwargs) Computes the opacity of each of the radiative layers (m^2/molecule). :param rayleigh: If true, the rayleigh cross section is computed in self.kdata_scat and added to kdata(total extinction cross section) :type rayleigh: :class:`bool` See :any:`gas_mix.Gas_mix.cross_section` for details. .. py:method:: source_function_stellar(**kwargs) Dummy function to have zero source in stellar channel .. py:method:: set_incoming_stellar_flux(flux=0.0, Tstar=5778.0, **kwargs) Sets the stellar incoming flux integrated in each wavenumber channel. .. important:: If your simulated range does not include the whole spectral range where the star emits, the flux seen by the model will be smaller than the input one. :param flux: Bolometric Incoming flux (in W/m^2). :type flux: :class:`float` :param Tstar: Stellar temperature (in K) used to compute the spectral distribution of incoming flux using a blackbody. :type Tstar: :class:`float` .. py:method:: setup_emission_caculation_stellar(mu_eff=0.5, rayleigh=False, **kwargs) Computes all necessary quantities for emission calculations (opacity, source, etc.) .. py:method:: reflexion_spectrum_2stream(integral=True, mu0_stellar=0.5, method='toon', dtau_min=1e-10, flux_at_level=False, rayleigh=False, flux_top_dw=None, **kwargs) Returns the reflexion flux at the top of the atmosphere (in W/m^2/cm^-1) :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* :param mu0_stellar: Cosine of the quadrature angle use to compute output flux :type mu0_stellar: :class:`float` :param dtau_min: If the optical depth in a layer is smaller than dtau_min, dtau_min is used in that layer instead. Important as too transparent layers can cause important numerical rounding errors. :type dtau_min: :class:`float` :returns: Spectrum object A spectrum with the Spectral flux at the top of the atmosphere (in W/m^2/cm^-1) .. py:method:: flux_divergence_stellar(per_unit_mass=True, **kwargs) Computes the divergence of the net flux in the layers (used to compute heating rates). :func:`emission_spectrum_2stream` needs to be ran first. :param per_unit_mass: If True, the heating rates are normalized by the mass of each layer (result in W/kg). :type per_unit_mass: :class:`bool` :returns: H: array, np.ndarray Heating rate in each layer (Difference of the net fluxes). Positive means heating. The last value is the net flux impinging on the surface. net: array, np.ndarray Net fluxes at level surfaces .. py:method:: heating_rate(compute_kernel=False, dTmax_use_kernel=None, flux_top_dw=None, **kwargs) Computes the heating rates and net fluxes in the atmosphere. :param compute_kernel: If True, the kernel (jacobian of the heat rates) is recomputed :type compute_kernel: :class:`bool` :param dTmax_use_kernel: Maximum temperature difference between the current temperature and the temperature of the last kernel computation before a new kernel is recomputed. :type dTmax_use_kernel: :class:`float` :returns: H: array, np.ndarray Heating rate in each layer (Difference of the net fluxes). Positive means heating. The last value is the net flux impinging on the surface + the internal flux. net: array, np.ndarray Net fluxes at level surfaces .. py:method:: bolometric_fluxes_stellar(per_unit_mass=True) Computes the bolometric fluxes at levels and the divergence of the net flux in the layers (used to compute heating rates). :func:`emission_spectrum_2stream` needs to be ran first. :param per_unit_mass: If True, the heating rates are normalized by the mass of each layer (result in W/kg). :type per_unit_mass: :class:`bool` :returns: up: array, np.ndarray Upward fluxes at level surfaces dw: array, np.ndarray Downward fluxes at level surfaces net: array, np.ndarray Net fluxes at level surfaces H: array, np.ndarray Heating rate in each layer (Difference of the net fluxes). Positive means heating. The last value is the net flux impinging on the surface.