earth2studio.data.MRMS#

class earth2studio.data.MRMS(max_offset_minutes=0, cache=True, verbose=True, max_workers=24, async_timeout=600)[source]#

NOAA Multi-Radar/Multi-Sensor (MRMS) products via AWS S3.

This data source downloads MRMS GRIB2 files (gzipped) from the NOAA MRMS public S3 bucket, decompresses them into the Earth2Studio cache, and opens the result with Xarray/cfgrib. Initially, only the composite reflectivity product is supported, exposed via the Earth2Studio variable id refc.

Parameters:
  • max_offset_minutes (float, optional) – Time tolerance in minutes to search for the nearest available MRMS file to the requested timestamp, by default 0 (exact match only).

  • cache (bool, optional) – Cache data source in local filesystem cache, by default True.

  • verbose (bool, optional) – Print basic progress logs, by default True.

  • max_workers (int, optional) – Max workers in async IO thread pool for concurrent downloads, by default 24.

  • async_timeout (int, optional) – Time in seconds after which the async fetch will be cancelled if not finished, by default 600.

Warning

This is a remote data source and can download sizable files depending on request volume and frequency.

__call__(time, variable)[source]#

Retrieve MRMS data for given times and variables.

Parameters:
  • time (datetime | list[datetime] | TimeArray) – Timestamps to fetch (UTC). Exact times must match available MRMS files.

  • variable (str | list[str] | VariableArray) – Earth2Studio variable ids to return. Must be in the MRMS lexicon. Currently only refc is supported (composite reflectivity).

Returns:

Data with dimensions [time, variable, y, x]. Coordinates include lat and lon on the same [y, x] grid when provided in the source file.

Return type:

xr.DataArray

async fetch(time, variable)[source]#

Async retrieval of MRMS data for given times and variables.

Parameters:
  • time (datetime | list[datetime] | ndarray[datetime64])

  • variable (str | list[str] | ndarray[str])

Return type:

DataArray

classmethod available(time, variable, max_offset_minutes=10)[source]#

Check if an MRMS file exists for a given time.

Parameters:
  • time (datetime | np.datetime64) – Time to query (UTC).

  • variable (str | list[str] | VariableArray) – Earth2Studio variable id(s). The corresponding MRMS product is derived from the lexicon. All variables must map to the same product.

  • max_offset_minutes (int, optional) – Time tolerance in minutes to search for the nearest available MRMS file to the requested timestamp, by default 0 (exact match only).

Returns:

True if the object exists in S3, else False.

Return type:

bool