API Reference#

Use this reference when you want the exact signature, parameters, return values, and class interfaces for arl-met. Most workflows start with open_dataset(), write_dataset(), extract_subset(), or sample_points().

High-Level I/O#

open_dataset

Open an ARL meteorology file as an xarray Dataset.

write_dataset

Write a simple flat Dataset representation to an ARL file.

File Operations#

Transform ARL files: crop a subset, sample at points, or join files together. See the Cropping ARL Data, Sampling Points, and Concatenating ARL Files guides.

extract_subset

Extract a spatial/vertical subset from an ARL file into a new ARL file.

sample_points

Sample meteorological variables at arbitrary (lon, lat, z, time) points.

internal_levels

Return HYSPLIT's internal vertical levels for a run on file with model_top.

InternalLevels

HYSPLIT's internal vertical levels for a run, as hymodelc sets them up.

concat

Concatenate multiple ARL files into a single ARL file.

concat_by_time

Group every ARL file in a directory by valid time and concatenate each group.

Converting Other Models’ Output#

Turn a model’s own output, opened with xarray, into a Dataset that write_dataset() writes. See the Converting Other Models’ Output guide.

converters.from_era5

Convert ERA5 hourly fields to a Dataset that arlmet.write_dataset() writes.

converters.from_flex_extract

Convert the ERA5 files flex_extract writes for FLEXPART to a Dataset for arlmet.write_dataset().

converters.from_gfs

Convert GFS or GDAS GRIB2 files on pressure levels to a Dataset for arlmet.write_dataset().

converters.from_icon

Convert ICON forecasts on a regular lat/lon grid to a Dataset for arlmet.write_dataset().

converters.from_wrf

Convert WRF-ARW output to a Dataset that arlmet.write_dataset() writes.

Finding Files#

Find the files that cover a time window by their headers. See the Taking an Inventory guide.

inventory

Take an inventory of the ARL files in a directory by their headers.

Inventory

The ARL files in a directory, by the times their headers say they hold.

Probing One File#

A cheap summary of one file, from two index records and a stat. See the Probing a File guide.

probe

Cheaply summarize an ARL file from its first two index records and its size.

Probe

Cheap summary of an ARL file, from its first two index records and its size.

Vertical Coordinates#

Derive pressure and height coordinates from an open Dataset. See the Vertical Coordinates guide for coordinate-system details and limitations.

pressure

Pressure (hPa) at each level.

z_agl

Height above ground level (m) at each level.

z_msl

Height above mean sea level (m) at each level.

Low-Level File Model#

File

Read or write an ARL meteorology file.

RecordSet

Records for one valid time within an ARL file.

DataRecord

One ARL data record representing a single 2D variable slice.

Grid And Vertical Metadata#

These are immutable, hashable value objects. Derive modified copies with dataclasses.replace() (Projection, Grid, GridWindow) or by constructing a new axis.

Projection

Horizontal projection metadata from an ARL index record.

Grid

Two-dimensional horizontal grid definition for ARL data.

GridWindow

Rectangular subset of a grid using zero-based half-open indices.

VerticalAxis

Abstract base class for ARL vertical coordinate axes.

SigmaAxis

Flag=1.

PressureAxis

Flag=2.

TerrainAxis

Flag=3.

HybridAxis

Flag=4.

WrfAxis

Flag=5.

Binary Metadata And Packing#

The byte-level codec of the format. Most code never needs it, so arlmet does not import it; import each name from its module, e.g. from arlmet.record import IndexRecord.

record.Header

Fixed-width 50-byte header present at the start of every ARL record.

record.IndexRecord

Index record describing one ARL time step and its contained variables.

packing.calculate_checksum

Compute the ARL checksum for a packed payload.

packing.pack

Pack a 2D field using the ARL differential byte encoding.

packing.unpack

Unpack an ARL differential byte stream into a 2D field.

Errors And Warnings#

Raised or emitted when file content is not valid ARL. ARLFormatError subclasses ValueError, so except ValueError also catches it.

ARLFormatError

Raised when file content is not valid ARL.

ARLFormatWarning

Warning for recoverable irregularities in ARL file content.

Remote Archive Sources#

get_archive

Build a meteorology archive from its short name.

Archive

Abstract base class for NOAA ARL meteorology archives.

SyncResult

What Archive.sync() did, as lists of local file paths.

HRRRArchive

HRRR 3 km analysis (CONUS, June 2019–present).

HRRRv1Archive

HRRR 3 km analysis, version 1 (CONUS, June 15, 2015–2019).

NAMArchive

NAM 12 km analysis (North America, May 26, 2007–present).

NAMSArchive

NAMS hybrid sigma-pressure analysis (CONUS/Alaska/Hawaii, March 2009–present).

GDASArchive

GDAS 1-degree global analysis (December 2004–present).

GDAS0p5Archive

GDAS 0.5-degree global analysis (September 2007–mid 2019).

GFSArchive

GFS 0.25-degree global analysis (June 13, 2019–present).

NARRArchive

NCEP North American Regional Reanalysis (January 1979–2019).

ReanalysisArchive

NCEP/NCAR Reanalysis 2.5-degree global (1948–present).

WRF27kmArchive

NOAA ARL's 27 km WRF over North America (1980-01-01 on).

arlmet.archives.ARCHIVES

Every registered source class by name (read-only mapping). See get_archive().