MLWPArchive#

class metpy.remote.MLWPArchive[source]#

Access data from the NOAA/CIRA Machine-Learning Weather Prediction archive in AWS.

This consists of individual model runs stored in netCDF format, across a variety a collection of models (Aurora, FourCastNet, GraphCast, Pangu) and initial conditions (GFS or IFS).

Initialize the data store.

Parameters:
  • bucket_name (str) – The name of the bucket

  • delimiter (str, optional) – The delimiter used to split the key into distinct portions. Defaults to ‘/’.

Methods Summary

__init__()

Initialize the data store.

common_prefixes(prefix[, delim])

Return the common prefixes under a given prefix.

dt_from_key(key)

Parse date from key.

get_product(model[, dt, version, init])

Get a product from the archive.

get_range(model, start, end[, version, init])

Yield products within a particular date/time range.

objects(prefix)

Return objects matching the given prefix.

Methods Documentation

__init__()[source]#

Initialize the data store.

Parameters:
  • bucket_name (str) – The name of the bucket

  • delimiter (str, optional) – The delimiter used to split the key into distinct portions. Defaults to ‘/’.

common_prefixes(prefix, delim=None)[source]#

Return the common prefixes under a given prefix.

Parameters:
  • prefix (str) – The starting prefix to look under for common prefixes.

  • delim (str, optional) – The delimiter used to split the key into distinct portions. If not specified, defaults to the one initially set on the client.

dt_from_key(key)[source]#

Parse date from key.

Parameters:

key (str) – The key to parse

Returns:

datetime – The parsed date

get_product(model, dt=None, version=None, init=None)[source]#

Get a product from the archive.

Parameters:
  • model (str) – The selected model to get data for. Can be any of the four-letter codes supported by the archive (currently FOUR, PANG, GRAP, AURO), or the known names ( case-insensitive): 'Aurora', 'FourCastNet', 'graphcast', or 'pangu'.

  • dt (datetime.datetime, optional) – The desired date/time for the model run; the one closest matching in time will be returned. This should have the proper timezone included; if not specified, UTC will be assumed. If None, defaults to the current UTC date/time.

  • version (str or int, optional) – The particular version of the model to select. If not given, the query will try to select the most recent version of the model.

  • init (str, optional) – Selects the model run initialized with a particular set of initial conditions. Should be one of 'GFS' or 'IFS', defaults to 'GFS'.

See also

get_range

get_range(model, start, end, version=None, init=None)[source]#

Yield products within a particular date/time range.

Parameters:
  • model (str) – The selected model to get data for. Can be any of the four-letter codes supported by the archive (currently FOUR, PANG, GRAP, AURO), or the known names ( case-insensitive): 'Aurora', 'FourCastNet', 'graphcast', or 'pangu'.

  • start (datetime.datetime) – The start of the date/time range. This should have the proper timezone included; if not specified, UTC will be assumed.

  • end (datetime.datetime) – The end of the date/time range. This should have the proper timezone included; if not specified, UTC will be assumed.

  • version (str or int, optional) – The particular version of the model to select. If not given, the query will try to select the most recent version of the model.

  • init (str, optional) – Selects the model run initialized with a particular set of initial conditions. Should be one of 'GFS' or 'IFS', defaults to 'GFS'.

See also

get_product

objects(prefix)[source]#

Return objects matching the given prefix.

Parameters:

prefix (str) – The prefix to match against.

Returns:

Iterator of botocore.client.Object – Objects matching the given prefix.

Examples using metpy.remote.MLWPArchive#

ML Weather Prediction Access and Plotting

ML Weather Prediction Access and Plotting