epaaws package

Subpackages

Submodules

epaaws.mp2022 module

mp2022

The mp2022 module provides an interface to Modeling Platform 2022 interface.

epaaws.mp2022.open_gridbdy2d(date, domain='.12US1.35L.', cache=True)

open a GRIDBDY2D :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

gridbdy2d – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.mp2022.open_gridcro2d(date, domain='.12US1.35L.', cache=True)

open a GRIDCRO2D :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

gridcro2d – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.mp2022.open_griddot2d(date, domain='.12US1.35L.', cache=True)

open a GRIDDOT2D :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

griddot2d – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.mp2022.open_lufrac_cro(date, domain='.12US1.35L.', cache=True)

open a LUFRAC_CRO :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

lufrac_cro – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.mp2022.open_metbdy3d(date, domain='.12US1.35L.', cache=True)

open a METBDY3D :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

metbdy3d – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.mp2022.open_metcro2d(date, domain='.12US1.35L.', cache=True)

open a METCRO2D :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

metcro2d – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.mp2022.open_metcro3d(date, domain='.12US1.35L.', cache=True)

open a METCRO3D :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

metcro3d – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.mp2022.open_metdot3d(date, domain='.12US1.35L.', cache=True)

open a METDOT3D :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

metdot3d – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.mp2022.open_soi_cro(date, domain='.12US1.35L.', cache=True)

open a SOI_CRO :param date: Any date parsable by pandas.to_datetime :type date: str or date-like :param domain: Domain string (eg, .12US1.35L.) :type domain: str

Returns:

soi_cro – File from S3 loaded into memory.

Return type:

xarray.Dataset

epaaws.util module

epaaws.util.open_date(date, tmpl, bucket, cache=True)[source]

Open all files for specific date

Parameters:
  • date (str) – Date parsable by pandas.to_datetime

  • tmpl (str) – strftime template for date file (e.g., MCIP/GRIDCRO2D.12US1.35L.%y%m%d)

  • bucket (str) – Bucket to pull from (e.g., )

  • cache (bool) – Store file to prevent re-downloading.

Returns:

ds – File opened (either in memory or from disk)

Return type:

xarray.Dataset

Module contents

Library of functions to facilitate analysis interaction with EPA’s data on AWS S3 buckets thru Amazon’s Registry of Open Data.[1] At present, this only includes the epa-2022-modeling-platform (see module mp2022).

Citations: 1. https://registry.opendata.aws/epa-2022-modeling-platform/

Install for Python3

python -m pip install epaaws

Example

Example of how to plot the terrain height from a GRIDCRO2D file.

import epaaws

f = epaaws.mp2022.open_gridcro2d('2022-01-01')
levels = [-100, -10, 1, 100, 200, 400, 800, 1600, 3200]
f['HT'].plot(levels=levels, cmap='terrain')
f.csp.cno.drawstates()

MODULES

Each module provides access to.

mp2022 :

provides an interface to EPA’s Modeling Platform for 2022

util :

provides basic utilities used by all the modeling platforms

epaaws.open_date(date, tmpl, bucket)[source]

Open all files for specific date

Parameters:
  • date (str) – Date parsable by pandas.to_datetime

  • tmpl (str) – strftime template for date file (e.g., MCIP/GRIDCRO2D.12US1.35L.%y%m%d)