Equation of State

The eos module contains data structures to compute and hold equation of state variables used throughout pyRT_DISORT.

class pyrt.eos.Hydrostatic(altitude_grid, pressure_grid, temperature_grid, altitude_boundaries, particle_mass, gravity)[source]

A data structure that computes a hydrostatic equation of state.

Hydrostatic accepts equation of state variables and regrids them to a user-specified altitude grid using linear interpolation. Then, it computes number density and scale height at the new boundaries, and the column density within the new boundaries, assuming the atmosphere is in hydrostatic equilibrium.

Parameters
  • altitude_grid (numpy.ndarray) – The altitude grid [km] over which the equation of state variables are defined. See the note below for additional conditions.

  • pressure_grid (numpy.ndarray) – The pressure [Pa] at all values in altitude_grid.

  • temperature_grid (numpy.ndarray) – The temperature [K] at all values in altitude_grid.

  • altitude_boundaries (numpy.ndarray) – The desired boundary altitude [km]. See the note below for additional conditions.

  • particle_mass (float) – The average mass [kg] of atmospheric particles.

  • gravity (float) – The gravitational acceleration [\(\frac{\text{kg m}}{\text{s}^2}\)] of the atmosphere.

Raises
  • TypeError – Raised if altitude_grid, pressure_grid, temperature_grid, or altitude_boundaries are not all numpy.ndarrays; or if particle_mass or gravity are not floats.

  • ValueError – Raised if: * altitude_grid, pressure_grid, or temperature_grid do not have the same shapes * altitude_grid or altitude_boundaries have incompatible pixel dimensions * altitude_grid or altitude_boundaries are not monotonically decreasing along the 0 th axis; * pressure_grid, or temperature_grid contain non-positive, finite values * altitude_boundaries does not contain at least 2 boundaries * particle_mass or gravity are not positive, finite

Return type

None

Notes

This class assumes the atmosphere follows the equation

(1)\[P = n k_B T\]

where \(P\) is the pressure, \(n\) is the number density, \(k_B\) is Boltzmann’s constant, and \(T\) is the temperature.

The inputs can be ND arrays, as long as they have compatible shapes. In this scenario, altitude_grid, pressure_grid, and temperature_grid must be of shape Mx(pixels) whereas altitude_boundaries must be of shape Nx(pixels), as long as N > 1 to ensure that the model has at least 1 layer.

To keep with DISORT’s convention, altitude_grid and altitude_boundaries must be monotonically decreasing. If these are ND arrays, this condition only applies to the 0 th axis.

Also, scipy’s Gaussian quadrature routine becomes less accurate the smaller the atmosphere’s scale height is. I’m working to reduce the errors. In the meantime the column density is fairly close to analytical results but should be improved.

property altitude: numpy.ndarray

Get the input boundary altitude [km].

property column_density: numpy.ndarray

Get the column density [\(\frac{\text{particles}}{\text{m}^2}\)] of the boundary layers.

Notes

This is obtained by getting the number density at the boundary altitude, then integrating (using Gaussian quadrature) between the boundary altitude such that

\[N = \int n(z) dz\]

is satisfied, where \(N\) is the column density and \(n(z)\) is the number density.

property n_layers: int

Get the number of layers in the model.

Notes

This value is inferred from the 0 th axis of altitude_boundaries.

In DISORT, this variable is named MAXCLY (though in the disort package, this variable is optional).

property number_density: numpy.ndarray

Get the number density [\(\frac{\text{particles}}{\text{m}^3}\)] at the boundary altitude.

Notes

This variable is obtained by getting the pressure and temperature at the boundary altitude, then solving (1).

property pressure: numpy.ndarray

Get the pressure [Pa] at the boundary altitude.

Notes

This variable is obtained by linearly interpolating the input pressure onto altitude_boundaries.

property scale_height: numpy.ndarray

Get the scale height [km] at the boundary altitude.

Notes

For a hydrostatic atmosphere, the scale height is defined as

\[H = \frac{k_B T}{mg}\]

where \(H\) is the scale height, \(k_B\) is Boltzmann’s constant, \(T\) is the temperature, \(m\) is the average mass of an atmospheric particle, and \(g\) is the planetary gravity.

In DISORT, this variable is named H_LYR. Despite the name, this variable should have length of n_layers + 1. It is only used if do_pseudo_sphere is set to True.

property temperature: numpy.ndarray

Get the temperature [K] at the boundary altitude.

Notes

This variable is obtained by linearly interpolating the input temperature onto altitude_boundaries.

In DISORT, this variable is named TEMPER. It is only needed by DISORT if thermal_emission is set to True.