CATPrognosticData#
- class rojak.core.data.CATPrognosticData(dataset, pressure_level_prefix, *, persist=True)[source]#
Validated container for the raw meteorological fields required to compute CAT diagnostics
This is effectively the interface that every
MetDatasource must be able to populate: any concreteMetDatasubclass (e.g. for a specific reanalysis or forecast product) adapts its own underlying dataset into aCATData(which extends this class) so that downstream turbulence diagnostics (rojak.turbulence) only ever depend on this common interface. This is what makes it possible to add support for a new data source without having to change any of the diagnostic code that consumes it.On construction, checks that the underlying dataset contains
required_variablesandrequired_coords, then exposes each required field via an accessor method. By default, each field is persisted the first time it is accessed, so that only the fields which are used are loaded into memory, and they are only loaded once.- __init__(dataset, pressure_level_prefix, *, persist=True)[source]#
- Parameters:
dataset (Dataset) – Dataset containing at least
required_variablesandrequired_coordspressure_level_prefix (float) – Multiplier applied to the pressure level coordinate to convert it to Pascals, see
pressure_level()persist (bool) – If
True(default), each field is persisted the first time it is accessed and the persisted field is returned thereafter. IfFalse, nothing is persisted and each access returns the lazy field.
- Raises:
ValueError – If
datasetis missing any ofrequired_variablesorrequired_coords- Return type:
None
Methods
__init__(dataset, pressure_level_prefix, *)altitude()Altitude
divergence()Horizontal divergence of wind in m/s
geopotential()Geopotential in m^2/s^2
potential_vorticity()Potential vorticity
pressure_level([convert_to_pascals])Pressure level coordinate
specific_humidity()Specific humidity
temperature()Air temperature in Kelvin
time_window()Minimum and maximum values of the time coordinate
u_wind()Zonal (eastward) wind speed in m/s
v_wind()Meridional (northward) wind speed in m/s
vorticity()Vertical component of vorticity in m/s
Attributes
required_coordsrequired_variables