# parker

parker.sound_speed(temperature, h_fraction, ion_fraction=0.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).

h_fraction (``float``):

Average H number fraction of the upper atmosphere.

ion_fraction (``float``):

Average ionization fraction of the upper atmosphere.

Returns
sound_speed (`float`):

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

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`):

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.

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)[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.

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.