IEM_ASOS#

class earth2studio.data.IEM_ASOS(
stations=None,
networks=None,
report_types=(3, 4),
time_tolerance=numpy.timedelta64(10, 'm'),
cache=True,
verbose=True,
async_timeout=600,
async_workers=16,
retries=3,
)[source]#
Global

IEM archive of parsed ASOS, AWOS, and METAR station observations.

This source uses the Iowa Environmental Mesonet bulk ASOS service. It requests only parsed observation fields and never requests or retains the unprocessed METAR report. IEM performs little quality control on this historical archive.

Parameters:
  • stations (str | list[str] | None, optional) – IEM station identifiers to query. None queries all stations allowed by the selected networks, by default None.

  • networks (str | list[str] | None, optional) – IEM network identifiers, such as "IA_ASOS". None does not restrict the request by network, by default None.

  • report_types (tuple[int, ...], optional) – IEM report types to include: 1 for HFMETAR, 3 for routine, and 4 for special reports, by default (3, 4).

  • time_tolerance (TimeTolerance, optional) – Time tolerance window for filtering observations. Accepts a single value (symmetric +/- window) or a tuple (lower, upper) for asymmetric windows, by default np.timedelta64(10, “m”).

  • cache (bool, optional) – Cache parsed CSV responses in the local filesystem, by default True.

  • verbose (bool, optional) – Show download progress, by default True.

  • async_timeout (int, optional) – Total timeout in seconds for an async fetch, by default 600.

  • async_workers (int, optional) – Maximum number of concurrent fetch tasks. Request starts are rate-limited to one per second to comply with the IEM service limit, by default 16.

  • retries (int, optional) – Number of retries for transient download failures, by default 3.

Warning

Broad station or time selections can return large responses. IEM limits requests without explicit stations to 24 hours and applies an IP-based one-request-per-second throttle.

__call__(time, variable, fields=None)[source]#

Retrieve parsed IEM ASOS/AWOS observations.

Parameters:
  • time (datetime | list[datetime] | TimeArray) – Timestamps to return observations for in UTC.

  • variable (str | list[str] | VariableArray) – Variables from IEM_ASOSLexicon to return.

  • fields (str | list[str] | pa.Schema | None, optional) – Output fields to include, by default None (all fields).

Returns:

Parsed observations in Earth2Studio long-form schema.

Return type:

pd.DataFrame

async fetch(time, variable, fields=None)[source]#

Asynchronously retrieve parsed IEM ASOS/AWOS observations.

Parameters:
  • time (datetime | list[datetime] | TimeArray) – Timestamps to return observations for in UTC.

  • variable (str | list[str] | VariableArray) – Variables from IEM_ASOSLexicon to return.

  • fields (str | list[str] | pa.Schema | None, optional) – Output fields to include, by default None (all fields).

Returns:

Parsed observations in Earth2Studio long-form schema.

Return type:

pd.DataFrame

classmethod available(time)[source]#

Check whether a timestamp is within the IEM archive range.

Parameters:

time (datetime | np.datetime64) – Timestamp to check.

Returns:

True when the timestamp is not earlier than the archive start.

Return type:

bool