parker

parker.average_molecular_weight(ion_fraction_profile, r_profile, v_profile, planet_mass, temperature, he_h_fraction=0.11111111111111112)[source]

Calculates the “average” mean molecular weight of the upper atmosphere following Eq. A.3 in Lampón et al. 2020, in unit of proton mass.

Parameters
ion_fraction_profile (``numpy.ndarray``):

Hydrogen ion fraction in function of radial distance.

r_profile (``numpy.ndarray``):

Radial distance profile in unit of Jupiter radii. This is the independent variable over which the profiles are described.

v_profile (``numpy.ndarray``):

Velocity profile in units of km / s in function of radial distance.

planet_mass (``float``):

Planetary mass in unit of Jupiter mass.

temperature (``float``):

Isothermal temperature of the outflow in unit of K.

he_h_fraction (``float``, optional):

Number fraction of He particles in relation to H particles. Default is 0.1 / 0.9.

Returns
mu_bar (float):

“Average” mean molecular weight as defined by Eq. A.3 of Lampón et al. 2020, in unit of proton mass.

parker.sound_speed(temperature, mean_molecular_weight=1.0)[source]

Speed of sound in an isothermal ideal gas.

Parameters
temperature (``float``):

Constant temperature of the gas in Kelvin. Assumed to be close to the maximum thermospheric temperature (see Oklopčić & Hirata 2018 and Lampón et al. 2020 for more details).

mean_molecular_weight (``float``):

Mean molecular weight of the atmosphere in unit of proton mass. Default value is 1.0 (100% neutral H).

Returns
cs (float):

Sound speed in the gas in unit of km / s.

parker.radius_sonic_point(planet_mass, sound_speed_0)[source]

Radius of the sonic point, i.e., where the wind speed matches the speed of sound.

Parameters
planet_mass (``float``):

Planetary mass in unit of Jupiter mass.

sound_speed (``float``):

Constant speed of sound in unit of km / s.

Returns
radius_sonic_point (float):

Radius of the sonic point in unit of Jupiter radius.

parker.density_sonic_point(mass_loss_rate, radius_sp, sound_speed_0)[source]

Density at the sonic point, where the wind speed matches the speed of sound. The input values must be astropy.Quantity.

Parameters
mass_loss_rate (``float``):

Total mass loss rate of the planet in units of g / s.

radius_sp (``float``):

Radius at the sonic point in unit of Jupiter radius.

sound_speed_0 (``float``):

Speed of sound, assumed to be constant, in units of km / s.

Returns
rho_sp (float):

Density at the sonic point in units of g / cm ** 3.

parker.structure(r, v_guess=None)[source]

Calculate the velocity and density of the atmosphere in function of radius at the sonic point (r_s), and in units of sound speed (v_s) and density at the sonic point (rho_s), respectively.

Parameters
r (``numpy.ndarray`` or ``float``):

Radius at which to sample the velocity in unit of radius at the sonic point.

v_guess (``numpy.ndarray`` or ``float``, optional):

Guessed value(s) of velocity, in unit of sound speed, corresponding to the radius(ii) r. If None, then the code assumes a standard guess for the velocity. If not None, v_guess must have the same shape as r. Default is None.

Returns
velocity_r (numpy.ndarray or float):

numpy array or a single value of velocity at the given radius or radii in unit of sound speed.

density_r (numpy.ndarray or float):

Density sampled at the radius or radii r and in unit of density at the sonic point.