arlmet.arlmet#
ARL meteorological data reader and parser.
This module provides the main ARLMet class for reading and working with ARL format meteorological files. ARL files are binary packed data files used by HYSPLIT and other atmospheric transport models.
Functions
|
Open an ARL meteorological data file as an xarray Dataset. |
Classes
|
ARL (Air Resources Laboratory) packed meteorological data. |
- arlmet.arlmet.open_dataset(filename, **kwargs)[source]#
Open an ARL meteorological data file as an xarray Dataset.
- Parameters:
filename (Path or str) – Path to the ARL data file.
**kwargs – sel-like keyword arguments passed to ARLMet.load().
- Returns:
The ARL data as an xarray Dataset.
- Return type:
xr.Dataset
- class arlmet.arlmet.ARLMet(index_record, records)[source]#
ARL (Air Resources Laboratory) packed meteorological data.
Extracts metadata from meteorological data file headers and provides methods to work with ARL format files.
- __init__(index_record, records)[source]#
Initialize ARLMet instance with data records.
- Parameters:
records (Sequence[DataRecord]) – List of data records parsed from the ARL file.
- classmethod from_file(filename)[source]#
Create an ARLMet instance by reading an ARL file.
- Parameters:
filename (Path or str) – Path to the ARL meteorological data file.
- Returns:
ARLMet instance containing the parsed data records.
- Return type:
- Raises:
ValueError – If the file path is invalid or if a data record is found before an index record.
- property records: list[DataRecord]#
Get list of all data records.
- Returns:
List of all data records in the dataset.
- Return type:
- load(**kwargs)[source]#
Load data into an xarray Dataset or DataArray.
Accepts xarray sel-style indexing to select specific times, variables, levels, forecasts, or grids.
- Parameters:
**kwargs (dict) – Selection criteria using xarray sel-style indexing (e.g., time, variable, level, forecast).
- Returns:
If a single record matches the criteria, returns a DataArray. Otherwise, returns a Dataset containing multiple variables/times.
- Return type:
xr.Dataset or xr.DataArray