arlmet.archives.Archive#

class arlmet.archives.Archive[source]#

Bases: ABC

Abstract base class for NOAA ARL meteorology archives.

An archive is one ARL-formatted product in NOAA’s archive (e.g. HRRR 3 km): its filename convention, path layout, and start date. Download files with fetch(), or keep a whole local folder in step with NOAA’s with sync(), choosing the mirror (server) to download from.

Subclasses set class-level metadata (name, description, start_date, source, step) and implement _archive_path() to encode the filename convention for their product. A subclass that sets name is registered in ARCHIVES under that name.

Variables:
  • name (str) – Short archive identifier used by callers and config files (stable).

  • description (str) – Human-readable product description.

Attributes

source

The source id in the headers of the archive's files.

start_date

Earliest date available in the NOAA archive.

step

The time between one time step and the next inside a file, as a pandas.Timedelta: the spacing of the file's index records, the product's own time resolution.

Methods

fetch(start, end, *, dest_dir[, mirror, ...])

Download ARL files covering [start, end] to dest_dir.

paths_for_range(start, end)

Return deduplicated, sorted archive paths covering [start, end].

sync([start, end, mirror, dry_run])

Keep the local folder dest_dir complete and checked against NOAA's MD5 list.