improver.generate_ancillaries.generate_svp_table module#
A module for creating a saturated vapour pressure table
- class SaturatedVapourPressureTable(t_min=183.15, t_max=338.25, t_increment=0.1, water_only=False, ice_only=False)[source]#
Bases:
BasePluginPlugin to create a saturated vapour pressure lookup table.
- MAX_VALID_TEMPERATURE_ICE = 273.15#
- MAX_VALID_TEMPERATURE_WATER = 373.0#
- MIN_VALID_TEMPERATURE_ICE = 173.0#
- MIN_VALID_TEMPERATURE_WATER = 223.0#
- __init__(t_min=183.15, t_max=338.25, t_increment=0.1, water_only=False, ice_only=False)[source]#
Create a table of saturated vapour pressures that can be interpolated through to obtain an SVP value for any temperature within the range t_min –> (t_max - t_increment).
The default min/max values create a table that provides SVP values covering the temperature range -90C to +65.1C. Note that the last bin is not used, so the SVP value corresponding to +65C is the highest that will be used.
- Parameters:
t_min (
float) – The minimum temperature for the range, in Kelvin.t_max (
float) – The maximum temperature for the range, in Kelvin.t_increment (
float) – The temperature increment at which to create values for the saturated vapour pressure between t_min and t_max.water_only (
bool) – The table will only create values for the saturated vapour pressure with respect to water. Values for temperatures outside the range 223 K < T < 373 K have not been experimentally validated.ice_only (
bool) – The table will only create values for the saturated vapour pressure with respect to ice. Values for temperatures outside the range 173 K < T < 273.15 K have not been experimentally validated.
- _abc_impl = <_abc._abc_data object>#
- _check_temperature_limits(temperature)[source]#
Raise exception if temperature values fall outside the range for which the method is considered valid (see reference).
- Parameters:
temperature (ndarray) – Array of temperature values to be validated.
- Raises:
UserWarning – If any temperature value is outside the valid range defined by self.MIN_VALID_TEMPERATURE_ICE and self.MAX_VALID_TEMPERATURE_WATER, a warning is issued. If either self.water_only or self.ice_only has been set to True, the warning will use the corresponding minimum and maximum temperature values.
- Returns:
None
- as_cube(svp_data, temperatures)[source]#
Converts saturation vapor pressure data and corresponding temperatures into an Iris Cube.
- Parameters:
svp_data (np.ndarray) – Array containing saturation vapor pressure values.
temperatures (np.ndarray) – Array of temperature values (in Kelvin) corresponding to the svp_data.
- Return type:
- Returns
- Cube:
An Iris Cube containing the saturation vapor pressure data with temperature as a dimension coordinate. The cube is converted to SI units for vapor pressure and includes attributes for the minimum temperature, maximum temperature, and temperature increment used in the data.
- constants = {1: 10.79574, 2: 5.028, 3: 0.000150475, 4: -8.2969, 5: 0.00042873, 6: 4.76955, 7: 0.78614, 8: -9.09685, 9: 3.56654, 10: 0.87682, 11: 0.78614}#
- cube_name = 'saturated_vapour_pressure'#
- process()[source]#
Creates a lookup table of saturation vapour pressure in a pure water vapour system for a specified temperature range.
- Parameters:
self.t_min (float) – Minimum temperature (inclusive) for the lookup table.
self.t_max (float) – Maximum temperature (inclusive) for the lookup table.
self.t_increment (float) – Temperature increment for the lookup table.
self.saturation_vapour_pressure_goff_gratch (callable) – Method to calculate saturation vapour pressure for given temperatures.
self.as_cube (callable) – Method to convert data and temperatures into a Cube object.
- Returns:
A cube of saturated vapour pressure values at temperature points defined by t_min, t_max, and t_increment.
- Return type:
Cube
- saturation_vapour_pressure_goff_gratch(temperature)[source]#
Saturation Vapour pressure in a water vapour system calculated using the Goff-Gratch Equation (WMO standard method).
- Parameters:
temperature (
ndarray) – Temperature values in Kelvin. Valid from 173 K to 373 K- Return type:
- Returns:
Corresponding values of saturation vapour pressure for a pure water vapour system, in hPa.
References
Numerical data and functional relationships in science and technology. New series. Group V. Volume 4. Meteorology. Subvolume b. Physical and chemical properties of the air, P35.
- svp_si_units = 'Pa'#
- svp_units = 'hPa'#