pyrsig.cmaq package

Submodules

pyrsig.cmaq.pair module

pair_rsigcmaq is designed to pair RSIG data with CMAQ files.

Example

from pair_rsigcmaq import pair_rsigcmaq import pandas a pd

outpath = pair_rsigcmaq(‘CMAQ_ACONC_20160101’, ‘O3’, ‘airnow.ozone’) df = pd.read_csv(outpath) # Print descriptive statistics print(df[[‘ozone’, ‘CMAQ_O3’]].describe().to_csv()) # Print correlation statistics print(df[[‘ozone’, ‘CMAQ_O3’]].corr().to_csv())

More details:

from pair_rsigcmaq import pair_rsigcmaq help(pair_rsigcmaq)

Or use as a script:

python -m pyrsig.cmaq.pair –help

pyrsig.cmaq.pair.pair_rsigcmaq(qds, qkey, datakey, bdate=None, edate=None, bbox=None, prefix='CMAQ_', persist=False, verbose=0)[source]
Parameters:
  • qds (xarray.Dataset or str) – If a str, it must be the path to CMAQ file. If an xarray.Dataset, it must have CMAQ structure and: - encoding[‘source’] string describing the file - crs_proj4 added by pyrsig.open_ioapi

  • qkey (str) – CMAQ variable key (must be in the CMAQ file)

  • datakey (str) – RSIG variable key

  • bdate (datetime) – Starting date time. If None, infer from file.

  • edate (datetime) – Ending date time. If None, infer from file.

  • bbox (tuple) – ll_lon, ll_lat, ur_lon, ur_lat in decimal degrees East and North If bbox is None, it will be inferred from the file.

  • persist (bool) – If True (default: False), save to disk and return output path

  • verbose (int) – Level of verbosity. Negative omits warning about cached paired files.

Returns:

outpath – path to output

Return type:

str

Module contents

pyrsig.cmaq.open_mfioapi(paths, metapaths=None, earth_radius=6370000.0, **kwargs)[source]

Minimal version of open_mfdataset that is compatible with open_ioapi. preprocess : keyword defaults to add_ioapi_meta concat_dim : keyword defaults to ‘TSTEP’

Parameters:
  • paths (iterable) – Paths to ioapi files to be opened.

  • metapaths (iterable) – Paths to be added as a string metadata

  • earth_radius (float) – Radius of the earth for projection.

  • kwargs – See xr.open_mfdataset

pyrsig.cmaq.pair_rsigcmaq(qds, qkey, datakey, bdate=None, edate=None, bbox=None, prefix='CMAQ_', persist=False, verbose=0)[source]
Parameters:
  • qds (xarray.Dataset or str) – If a str, it must be the path to CMAQ file. If an xarray.Dataset, it must have CMAQ structure and: - encoding[‘source’] string describing the file - crs_proj4 added by pyrsig.open_ioapi

  • qkey (str) – CMAQ variable key (must be in the CMAQ file)

  • datakey (str) – RSIG variable key

  • bdate (datetime) – Starting date time. If None, infer from file.

  • edate (datetime) – Ending date time. If None, infer from file.

  • bbox (tuple) – ll_lon, ll_lat, ur_lon, ur_lat in decimal degrees East and North If bbox is None, it will be inferred from the file.

  • persist (bool) – If True (default: False), save to disk and return output path

  • verbose (int) – Level of verbosity. Negative omits warning about cached paired files.

Returns:

outpath – path to output

Return type:

str