Thermodynamic Functions

Contains functions for derived thermodynamic variables

pyrams.thermo.mslp(temp, press, height)[source]

Calculate the mean sea level pressure

Parameters
Returns

p0 – The MSLP pressure (hPa)

Return type

numpy.ndarray

pyrams.thermo.pressure(pi)[source]

Calculates pressure from Exner function

Parameters

pi (ndarray) – Exner function * Cp (J/(kg*K))

Returns

pressure – Pressure (hPa)

Return type

ndarray

pyrams.thermo.rh(rv, theta, pi)[source]

Calculate relative humidity

Parameters
  • rv (ndarray) – Water vapor pressure from RAMS output (hPa)

  • theta (ndarray) – Potential temperature (Kelvin)

  • pi (ndarray) – Exner function * Cp (J/(kg*K))

Returns

relative humidity – Relative humidity (fraction)

Return type

ndarray

pyrams.thermo.temperature(theta, pi, celsius=False)[source]

Calculates temperature from RAMS output (Exner function)

Parameters
  • theta (ndarray) – Potential temperature (Kelvin)

  • pi (ndarray) – Exner function * Cp (J/(kg*K))

  • celsius (bool) – Default=False, return values in degrees Celsius

Returns

temperature – Temperature (Kelvin or Celsius)

Return type

ndarray

pyrams.thermo.wsat(theta, pi)[source]

Calculates saturation water vapor pressure from temperature and pressure (RAMS specific calculation)

Parameters
  • theta (ndarray) – Potential temperature (Kelvin)

  • pi (ndarray) – Exner function * Cp (J/(kg*K))

Returns

wsat – Saturation water vapor pressure (hPa)

Return type

ndarray