helium
- helium.radiative_processes(spectrum_at_planet, combined_ionization=False)[source]
Calculate the photoionization rate of helium at null optical depth based on the EUV spectrum arriving at the planet.
- Parameters:
- spectrum_at_planet
dict
Spectrum of the host star arriving at the planet covering fluxes at least up to the wavelength corresponding to the energy to ionize helium (4.8 eV, or 2593 Angstrom).
- spectrum_at_planet
- Returns:
- phi_1
float
Ionization rate of helium singlet at null optical depth in unit of 1 / s. This is returned if
combined_ionization
is set toFalse
.- phi_3
float
Ionization rate of helium triplet at null optical depth in unit of 1 / s. This is returned if
combined_ionization
is set toFalse
.- a_1
float
Flux-averaged photoionization cross-section of helium singlet in unit of cm ** 2. This is returned if
combined_ionization
is set toFalse
.- a_3
float
Flux-averaged photoionization cross-section of helium triplet in unit of cm ** 2. This is returned if
combined_ionization
is set toFalse
.- a_h_1
float
Flux-averaged photoionization cross-section of hydrogen in the range absorbed by helium singlet in unit of cm ** 2. This is returned if
combined_ionization
is set toFalse
.- a_h_3
float
Flux-averaged photoionization cross-section of hydrogen in the range absorbed by helium triplet in unit of cm ** 2. This is returned if
combined_ionization
is set toFalse
.- phi
float
Ionization rate of helium at null optical depth in unit of 1 / s. This is returned if
combined_ionization
is set toTrue
.- a_he
float
Flux-averaged photoionization cross-section of helium in unit of cm ** 2. This is returned if
combined_ionization
is set toTrue
.- a_h
float
Flux-averaged photoionization cross-section of hydrogen in the range absorbed by helium atoms in unit of cm ** 2. This is returned if
combined_ionization
is set toTrue
.
- phi_1
- helium.radiative_processes_mono(flux_euv, flux_fuv, average_euv_photon_wavelength=242.0, average_fuv_photon_wavelength=2348.0)[source]
Calculate the photoionization rate of helium at null optical depth based on the EUV spectrum arriving at the planet.
- Parameters:
- flux_euv
float
Monochromatic extreme-ultraviolet (0 - 504 Angstrom) flux arriving at the planet in units of erg / s / cm ** 2. Attention: notice that this
flux_euv
is different from the one used for hydrogen, since helium ionization happens at a shorter wavelength.- flux_fuv
float
Monochromatic far- to middle-ultraviolet (911 - 2593 Angstrom) flux arriving at the planet in units of erg / s / cm ** 2.
- average_euv_photon_wavelength
float
Average wavelength of EUV photons ionizing the He singlet state, in unit of Angstrom. Default value is 242 Angstrom. The default value is based on a flux-weighted average of the solar spectrum between 0 and 504 Angstrom.
- average_fuv_photon_wavelength
float
Average wavelength of FUV-NUV photons ionizing the He triplet state, in unit of Angstrom. Default value is 2348 Angstrom. The default value is based on a flux-weighted average of the solar spectrum between 911 and 2593 Angstrom.
- flux_euv
- Returns:
- phi_1
float
Ionization rate of helium singlet at null optical depth in unit of 1 / s.
- phi_3
float
Ionization rate of helium triplet at null optical depth in unit of 1 / s.
- a_1
float
Flux-averaged photoionization cross-section of helium singlet in unit of cm ** 2.
- a_3
float
Flux-averaged photoionization cross-section of helium triplet in unit of cm ** 2.
- a_h_1
float
Flux-averaged photoionization cross-section of hydrogen in the range absorbed by helium singlet in unit of cm ** 2.
- a_h_3
float
Flux-averaged photoionization cross-section of hydrogen in the range absorbed by helium triplet in unit of cm ** 2.
- phi_1
- helium.recombination(temperature)[source]
Calculates the helium singlet and triplet recombination rates for a gas at a certain temperature.
- Parameters:
- temperature
float
Isothermal temperature of the upper atmosphere in unit of Kelvin.
- temperature
- Returns:
- alpha_rec_1
float
Recombination rate of helium singlet in units of cm ** 3 / s.
- alpha_rec_3
float
Recombination rate of helium triplet in units of cm ** 3 / s.
- alpha_rec_1
- helium.recombination_all(temperature)[source]
Calculates the helium recombination rates for a gas at a certain temperature, with no distinction between singlet and triplet states.
- Parameters:
- temperature
float
Isothermal temperature of the upper atmosphere in unit of Kelvin.
- temperature
- Returns:
- alpha_rec
float
Recombination rate of helium in units of cm ** 3 / s.
- alpha_rec
- helium.collision(temperature)[source]
Calculates the helium singlet and triplet collisional population rates for a gas at a certain temperature.
- Parameters:
- temperature
float
Isothermal temperature of the upper atmosphere in unit of Kelvin.
- temperature
- Returns:
- q_13
float
Rate of helium transition from singlet (1^1S) to triplet (2^3S) due to collisions with free electrons in units of cm ** 3 / s.
- q_31a
float
Rate of helium transition from triplet (2^3S) to 2^1S due to collisions with free electrons in units of cm ** 3 / s.
- q_31b
float
Rate of helium transition from triplet (2^3S) to 2^1P due to collisions with free electrons in units of cm ** 3 / s.
- big_q_he
float
Rate of charge exchange between helium singlet and ionized hydrogen in units of cm ** 3 / s.
- big_q_he_plus
float
Rate of charge exchange between ionized helium and atomic hydrogen in units of cm ** 3 / s.
- q_13
- helium.population_fraction(radius_profile, velocity, density, hydrogen_ion_fraction, planet_radius, temperature, h_fraction, speed_sonic_point, radius_sonic_point, density_sonic_point, spectrum_at_planet=None, flux_euv=None, flux_fuv=None, initial_state=array([0.5, 0.5]), relax_solution=False, convergence=0.01, max_n_relax=10, method='odeint', return_rates=False, **options_solve_ivp)[source]
Calculate the fraction of helium in singlet and triplet state in the upper atmosphere in function of the radius in unit of planetary radius.
- Parameters:
- radius_profile
numpy.ndarray
Radius in unit of planetary radii.
- velocity
numpy.ndarray
Velocities sampled at the values of
radius_profile
in units of sound speed. Similar to the output ofparker.structure()
.- density
numpy.ndarray
Densities sampled at the values of
radius_profile
in units of density at the sonic point. Similar to the output ofparker.structure()
.- hydrogen_ion_fraction
numpy.ndarray
Number fraction of H ion over total H in the upper atmosphere in function of radius. Similar to the output of
hydrogen.ion_fraction()
.- planet_radius
float
Planetary radius in unit of Jupiter radius.
- temperature
float
Isothermal temperature of the upper atmosphere in unit of Kelvin.
- h_fraction
float
Total (ion + neutral) H number fraction of the atmosphere.
- speed_sonic_point
float
Speed of sound in the outflow in units of km / s.
- radius_sonic_point
float
Radius of the sonic point in unit of Jupiter radius.
- density_sonic_point
float
Density at the sonic point in units of g / cm ** 3.
- spectrum_at_planet
dict
, optional Spectrum of the host star arriving at the planet covering fluxes at least up to the wavelength corresponding to the energy to populate the helium states (4.8 eV, or 2593 Angstrom). Can be generated using
tools.make_spectrum_dict
. IfNone
, thenflux_euv
andflux_fuv
must be provided instead. Default isNone
.- flux_euv
float
, optional Monochromatic extreme-ultraviolet (0 - 1200 Angstrom) flux arriving at the planet in units of erg / s / cm ** 2. If
None
, thenspectrum_at_planet
must be provided instead. Default isNone
.- flux_fuv
float
, optional Monochromatic far- to middle-ultraviolet (1200 - 2600 Angstrom) flux arriving at the planet in units of erg / s / cm ** 2. If
None
, thenspectrum_at_planet
must be provided instead. Default isNone
.- initial_state
numpy.ndarray
, optional The initial state is the y0 of the differential equation to be solved. This array has two items: the initial value of the fractions of singlet and triplet state in the inner layer of the atmosphere. The default value for this parameter is
numpy.array([0.5, 0.5])
, i.e., fully neutral at the inner layer with 50% in singlet and 50% in triplet states.- relax_solution
bool
, optional The first solution is calculating by initially assuming the entire atmosphere is in neutral state. If
True
, the solution will be re-calculated in a loop until it converges to a delta_f of 1%, or for a maximum of 10 loops (default parameters). Default isFalse
.- convergence
float
, optional Value of delta_f at which to stop the relaxation of the solution for
f_r
. Default is 0.01.- max_n_relax
int
, optional Maximum number of loops to perform the relaxation of the solution for
f_r
. Default is 10.- method
str
, optional If method is
'odeint'
, thenscipy.integrate.odeint()
is used instead ofscipy.integrate.solve_ivp()
to calculate the steady-state distribution of helium. The first seems to be at least twice faster than the second in some situations. Any other method will fall back to an option ofsolve_ivp()
methods. For example, ifmethod
is set to'Radau'
, then usesolve_ivp(method='Radau')
. Default is'odeint'
.- return_rates
bool
, optional If
True
, then this function also returns adict
object containing the various reaction rates in function of radius and in units of 1 / s. Default isFalse
.- **options_solve_ivp:
Options to be passed to the
scipy.integrate.solve_ivp()
solver. You may want to change the optionsatol
(absolute tolerance; default is 1E-6) orrtol
(relative tolerance; default is 1E-3). If you are having numerical issues, you may want to decrease the tolerance by a factor of 10 or 100, or 1000 in extreme cases.
- radius_profile
- Returns:
- f_1_r
numpy.ndarray
Fraction of helium in singlet state in function of radius.
- f_3_r
numpy.ndarray
Fraction of helium in triplet state in function of radius.
- reaction_rates
dict
Dictionary containing the reaction rates in function of radius and in units of 1 / s. Only returned when
return_rates
is set toTrue
. Here is a short description of the dict keys:ionization_1: Photoionization of He singlet atoms
ionization_3: Photoionization of He triplet atoms
recombination_1: Recombination of He ions into He singlet
recombination_3: Recombination of He ions into He triplet
radiative_transition: Radiative transition of He triplet into singlet
transition_1_to_3: Transition of He singlet to triplet due to collisions with electrons
transition_3_to_21s: Transition of He triplet to 2$^1$S due to collisions with electrons
transition_3_to_21p: Transition of He triplet to 2$^1$P due to collisions with electrons
other_ionization: Combined rate of associative ionization and Penning ionization
charge_exchange_1: Charge exchange between helium singlet and ionized hydrogen
charge_exchange_he_ion: Charge exchange between ionized helium and atomic hydrogen
- f_1_r
- helium.ion_fraction(radius_profile, velocity, density, hydrogen_ion_fraction, planet_radius, temperature, h_fraction, speed_sonic_point, radius_sonic_point, density_sonic_point, spectrum_at_planet, initial_f_he_ion=0.0, relax_solution=False, convergence=0.01, max_n_relax=10, method='Radau', **options_solve_ivp)[source]
Sometimes we need to calculate only the fraction of ionized helium and not necessarily the triplet and singlet fractions. This function does that, which is faster than
population_fraction()
. The result is in function of the radius in unit of planetary radius.- Parameters:
- radius_profile
numpy.ndarray
Radius in unit of planetary radii.
- velocity
numpy.ndarray
Velocities sampled at the values of
radius_profile
in units of sound speed. Similar to the output ofparker.structure()
.- density
numpy.ndarray
Densities sampled at the values of
radius_profile
in units of density at the sonic point. Similar to the output ofparker.structure()
.- hydrogen_ion_fraction
numpy.ndarray
Number fraction of H ion over total H in the upper atmosphere in function of radius. Similar to the output of
hydrogen.ion_fraction()
.- planet_radius
float
Planetary radius in unit of Jupiter radius.
- temperature
float
Isothermal temperature of the upper atmosphere in unit of Kelvin.
- h_fraction
float
Total (ion + neutral) H number fraction of the atmosphere.
- speed_sonic_point
float
Speed of sound in the outflow in units of km / s.
- radius_sonic_point
float
Radius of the sonic point in unit of Jupiter radius.
- density_sonic_point
float
Density at the sonic point in units of g / cm ** 3.
- spectrum_at_planet
dict
Spectrum of the host star arriving at the planet covering fluxes at least up to the wavelength corresponding to the energy to ionize helium (4.8 eV, or 2593 Angstrom). Can be generated using
tools.make_spectrum_dict
.- initial_f_he_ion
numpy.ndarray
, optional The initial helium ion fraction at the layer near the surface of the planet. Default is 0.0, i.e., 100% neutral.
- relax_solution
bool
, optional The first solution is calculating by initially assuming the entire atmosphere is in neutral state. If
True
, the solution will be re-calculated in a loop until it converges to a delta_f of 1%, or for a maximum of 10 loops (default parameters). Default isFalse
.- convergence
float
, optional Value of delta_f at which to stop the relaxation of the solution for
f_r
. Default is 0.01.- max_n_relax
int
, optional Maximum number of loops to perform the relaxation of the solution for
f_r
. Default is 10.- method
str
, optional If method is
'odeint'
, thenscipy.integrate.odeint()
is used instead ofscipy.integrate.solve_ivp()
to calculate the steady-state distribution of helium. The first seems to be at least twice faster than the second in some situations. Any other method will fall back to an option ofsolve_ivp()
methods. For example, ifmethod
is set to'Radau'
, then usesolve_ivp(method='Radau')
. Default is'Radau'
.- **options_solve_ivp:
Options to be passed to the
scipy.integrate.solve_ivp()
solver. You may want to change the optionsatol
(absolute tolerance; default is 1E-6) orrtol
(relative tolerance; default is 1E-3). If you are having numerical issues, you may want to decrease the tolerance by a factor of 10 or 100, or 1000 in extreme cases.
- radius_profile
- Returns:
- f_r
numpy.ndarray
Fraction of ionized helium in function of radius.
- f_r