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_dataset(filename, **kwargs)

Open an ARL meteorological data file as an xarray Dataset.

Classes

ARLMet(index_record, records)

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:

ARLMet

Raises:

ValueError – If the file path is invalid or if a data record is found before an index record.

property grids: list[Grid]#

Get list of all grids.

Returns:

List of all grids in the dataset.

Return type:

list[Grid]

property records: list[DataRecord]#

Get list of all data records.

Returns:

List of all data records in the dataset.

Return type:

list[DataRecord]

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

static merge(mets)[source]#

Merge multiple ARLMet instances into a single instance.

Parameters:

mets (Sequence[ARLMet]) – Sequence of ARLMet instances to merge.

Returns:

Merged ARLMet instance.

Return type:

ARLMet

__add__(other)[source]#

Merge two ARLMet instances.

Parameters:

other (ARLMet) – Another ARLMet instance to merge with this one.

Returns:

Merged ARLMet instance.

Return type:

ARLMet