Data (rojak.core.data)#

Generic infrastructure for retrieving, loading, and accessing meteorological data

This module provides:

  • DataRetriever/DataPreprocessor: abstract interfaces for downloading and preprocessing raw meteorological data files.

  • CATPrognosticData/CATData: containers validating and exposing the meteorological fields (e.g., wind, temperature, vorticity, …) required to compute CAT diagnostics, with CATData additionally deriving further quantities (potential temperature, velocity derivatives, deformation, ISSR) on demand. These effectively form the interface that every meteorological data source must be adapted into.

  • MetData: an abstract base for a source of meteorological data, handling spatial domain selection and longitude wraparound (shift_longitude()). Each concrete subclass is responsible for adapting its own underlying data into a CATData. This is the extension point of the architecture: new data sources can be added by implementing a new MetData subclass, without having to change any of the diagnostic code in rojak.turbulence, which only ever depends on the CATData/CATPrognosticData interface.

  • AmdarDataRepository/AmdarTurbulenceData: abstract interfaces for loading AMDAR (Aircraft Meteorological Data Relay) turbulence observations, spatially bucketing them onto a grid, and mapping them to their closest pressure level.

Functions

as_geo_dataframe(data_frame)

Method to convert a data frame into a GeoDataFrame.

load_from_folder(path_to_folder[, ...])

Lazily load and concatenate every file matching glob_pattern in a folder into a single Dataset

shift_longitude(data, *[, domain_bound, ...])

Shift the longitude coordinate to lie within [domain_bound, 360 + domain_bound)

Classes

AmdarDataRepository(path_to_files, ...)

Abstract AMDAR data repository interface.

AmdarTurbulenceData(data_frame, grid)

Abstract container for AMDAR turbulence observations, spatially bucketed onto a grid

CATData(dataset, pressure_level_prefix, *[, ...])

CATPrognosticData extended with the derived quantities required by CAT diagnostics

CATPrognosticData(dataset, ...[, persist])

Validated container for the raw meteorological fields required to compute CAT diagnostics

DataPreprocessor()

Abstract interface for preprocessing raw data files before they are used

DataRetriever()

Abstract interface for downloading raw data files for a set of years, months, and days

DataVarSchema(database_name, cf_name)

Mapping between a variable's name in the source dataset and its CF standard name

Date(year, month, day)

A single calendar date, as used by DataRetriever

MetData([longitude_name, latitude_name, persist])

Abstract base for a generic source of meteorological data