petitRADTRANS.radtrans_core.physics_core#

JAX implementation of fortran_core.physics

Functions#

_as_planck_temperature_array(temperatures)

_compute_planck_frequency_cubed_term(frequencies)

_compute_planck_spectral_radiance_matrix(temperatures, ...)

_compute_boole_sample_frequencies(frequencies)

_compute_boole_planck_flux_matrix(temperatures, ...)

compute_rosseland_opacities_core(...)

Calculate the Rosseland mean opacity as a function of temperature.

compute_rosseland_opacities(opacities, temperature, ...)

_summary_

compute_planck_function(T, nu)

Calculates B_ν https://en.wikipedia.org/wiki/Planck%27s_law

compute_planck_function_temperature_derivative(T, ...)

Calculates the gradient of B_ν (Planck's Law) with respect to temperature for

compute_planck_function_integral(temperatures, frequencies)

Compute mean using Boole's method

_compute_planck_function_integral(temperatures, ...)

star_planck(T, nu)

Calculates B_ν https://en.wikipedia.org/wiki/Planck%27s_law

compute_pressure_hydrostatic_equilibrium(...[, rk4])

Module Contents#

petitRADTRANS.radtrans_core.physics_core._as_planck_temperature_array(temperatures)#
petitRADTRANS.radtrans_core.physics_core._compute_planck_frequency_cubed_term(frequencies)#
petitRADTRANS.radtrans_core.physics_core._compute_planck_spectral_radiance_matrix(temperatures, frequencies)#
petitRADTRANS.radtrans_core.physics_core._compute_boole_sample_frequencies(frequencies)#
petitRADTRANS.radtrans_core.physics_core._compute_boole_planck_flux_matrix(temperatures, frequencies)#
petitRADTRANS.radtrans_core.physics_core.compute_rosseland_opacities_core(clouds_final_absorption_opacities, frequencies_bin_edges, temperature, weights_gauss)#

Calculate the Rosseland mean opacity as a function of temperature.

Args:

clouds_final_absorption_opacities (DeviceArray): Absorption opacities with shape (N_g, N_frequency_edges - 1, N_temperature). frequencies_bin_edges (DeviceArray): Frequency bin edges with shape (N_frequency_edges,). temperature (DeviceArray): Temperature with shape (N_temperature,). weights_gauss (DeviceArray): Gauss weights with shape (N_g,).

Returns:

DeviceArray: Rosseland opacity with shape (N_temperature,).

petitRADTRANS.radtrans_core.physics_core.compute_rosseland_opacities(opacities, temperature, weights_gauss, frequencies_bin_edges, scattering_in_emission, continuum_opacities_scattering)#

_summary_

Args:

total_opacity (_type_): _description_ temperature (_type_): _description_ w_gauss (_type_): _description_ border_freqs (_type_): _description_ do_scat_emis (_type_): _description_ continuum_opacity_scattering_emis (_type_): _description_

Returns:

_type_: _description_

petitRADTRANS.radtrans_core.physics_core.compute_planck_function(T, nu)#

Calculates B_ν https://en.wikipedia.org/wiki/Planck%27s_law For every temperature and frequency provided.

Args:

T (ndarray): 1D array of temperature in Kelvin nu (ndarray): 1D array of frequencies in Hertz

Returns:
B_nu (ndarray): (len(nu),len(T)) matrix of the spectral radiance (ie flux) as calculated from

Planck’s law for each frequency and temperature.

petitRADTRANS.radtrans_core.physics_core.compute_planck_function_temperature_derivative(T, frequency_bin_edges)#

Calculates the gradient of B_ν (Planck’s Law) with respect to temperature for each temperature and frequency provided using JAX.

Args:

T (DeviceArray): 1D JAX array of temperatures in Kelvin. frequency_bin_edges (DeviceArray): 1D JAX array of frequency bin edges in Hertz.

Returns:

B_nu_dT (DeviceArray): (len(T), len(nu)) JAX array of the derivative of the spectral radiance.

petitRADTRANS.radtrans_core.physics_core.compute_planck_function_integral(temperatures, frequencies)#

Compute mean using Boole’s method TODO: possibly a faster integration method?

petitRADTRANS.radtrans_core.physics_core._compute_planck_function_integral(temperatures, frequencies)#
petitRADTRANS.radtrans_core.physics_core.star_planck(T, nu)#

Calculates B_ν https://en.wikipedia.org/wiki/Planck%27s_law For every temperature and frequency provided. Approximates the integral using Boole’s method

Args:

T (ndarray): 1D array of temperature in Kelvin nu (ndarray): 1D array of frequencies in Hertz

Returns:
B_nu (ndarray): (len(nu),len(T)) matrix of the spectral radiance (ie flux) as calculated from

Planck’s law for each frequency and temperature.

petitRADTRANS.radtrans_core.physics_core.compute_pressure_hydrostatic_equilibrium(mean_molar_masses, reference_gravity, planet_radius, p0, temperature, radii, rk4=True)#