Command Line Interface

Installing melodies_monet provides a command line interface (CLI): melodies-monet.

For example, you can use the CLI to run control files without writing any Python code:

melodies-monet run control.yml

Subcommands

melodies-monet

MELODIES MONET

melodies-monet [OPTIONS] COMMAND [ARGS]...

Options

--version

Print version.

Default

False

--install-completion

Install completion for the current shell.

--show-completion

Show completion for the current shell, to copy it or customize the installation.

get-aeronet

Download AERONET data using monetio and reformat for MM usage.

melodies-monet get-aeronet [OPTIONS]

Options

-s, --start-date <start_date>

Required Start date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output.

-e, --end-date <end_date>

Required End date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output. As not specifying time implies 0 UTC, to get the full last day for hourly data, you should specify hour, e.g., append ‘ 23’ or increase end date by one day. For daily data, this is not necessary.

--daily, --no-daily

Whether to retrieve the daily averaged data product.

Default

False

-f, --freq <freq>

Frequency to resample to. Mean is used to reduce the time groups (as opposed to nearest, e.g.).

Default

H

--interp-to <interp_to>

Wavelength(s) to interpolate the AOD values to (unit: micron). Separate with commas to specify multiple. Examples: ‘0.55’ (550 nm), ‘0.55,0.7,1.0’. Note that this functionality requires pytspack (https://github.com/noaa-oar-arl/pytspack).

-o <out_name>

Output file name (or full/relative path). By default the name is generated like ‘AERONET_<product>_<start-date>_<end-date>.nc’.

-d, --dst <dst>

Destination directory (to control output location if using default output file name).

Default

.

--compress, --no-compress

If true, pack float to int and apply compression using zlib with complevel 7. This can take time if the dataset is large, but can lead to significant space savings.

Default

True

-n, --num-workers <num_workers>

Number of download workers.

Default

1

--verbose, --no-verbose
Default

False

--debug

Print more messages (including full tracebacks).

Default

False

get-airnow

Download AirNow data using monetio and reformat for MM usage.

melodies-monet get-airnow [OPTIONS]

Options

-s, --start-date <start_date>

Required Start date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output.

-e, --end-date <end_date>

Required End date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output. As not specifying time implies 0 UTC, to get the full last day for hourly data, you should specify hour, e.g., append ‘ 23’ or increase end date by one day. For daily data, this is not necessary.

--daily, --no-daily

Whether to retrieve the daily averaged data product. By default, the hourly data is fetched.

Default

False

-o <out_name>

Output file name (or full/relative path). By default the name is generated like ‘AirNow_<start-date>_<end-date>.nc’.

-d, --dst <dst>

Destination directory (to control output location if using default output file name).

Default

.

--compress, --no-compress

If true, pack float to int and apply compression using zlib with complevel 7. This can take time if the dataset is large, but can lead to significant space savings.

Default

True

-n, --num-workers <num_workers>

Number of download workers.

Default

1

--verbose, --no-verbose
Default

False

--debug

Print more messages (including full tracebacks).

Default

False

get-aqs

Download EPA AQS data using monetio and reformat for MM usage.

These are archived data, stored in per-year per-parameter-group files, described at https://aqs.epa.gov/aqsweb/airdata/download_files.html

Recent-past data are generally not available from this source.

melodies-monet get-aqs [OPTIONS]

Options

-s, --start-date <start_date>

Required Start date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output.

-e, --end-date <end_date>

Required End date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output. As not specifying time implies 0 UTC, to get the full last day for hourly data, you should specify hour, e.g., append ‘ 23’ or increase end date by one day. For daily data, this is not necessary.

--daily, --no-daily

Whether to retrieve the daily averaged data product. By default, the hourly data is fetched.

Default

False

-p, --params <param>

Parameter groups. Use ‘-p’ more than once to get multiple groups. Other examples: ‘SPEC’ (speciated PM2.5), ‘PM10SPEC’ (speciated PM10), ‘VOC’, ‘NONOxNOy’, ‘SO2’, ‘NO2’, ‘CO’, ‘PM2.5_FRM’.

Default

O3, PM2.5, PM10

-o <out_name>

Output file name (or full/relative path). By default the name is generated like ‘AQS_<start-date>_<end-date>.nc’.

-d, --dst <dst>

Destination directory (to control output location if using default output file name).

Default

.

--compress, --no-compress

If true, pack float to int and apply compression using zlib with complevel 7. This can take time if the dataset is large, but can lead to significant space savings.

Default

True

-n, --num-workers <num_workers>

Number of download workers.

Default

1

--verbose, --no-verbose
Default

False

--debug

Print more messages (including full tracebacks).

Default

False

get-ish

Download ISH data using monetio and reformat for MM usage.

Note that the data are stored in yearly files by site, so the runtime mostly depends on the number of unique years that your date range includes, as well as any site selection narrowing. You can use –country or –state or –box to select groups of sites. Time resolution may be sub-hourly, depending on site, thus we resample to hourly by default.

melodies-monet get-ish [OPTIONS]

Options

-s, --start-date <start_date>

Required Start date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output.

-e, --end-date <end_date>

Required End date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output. As not specifying time implies 0 UTC, to get the full last day for hourly data, you should specify hour, e.g., append ‘ 23’ or increase end date by one day. For daily data, this is not necessary.

-f, --freq <freq>

Frequency to resample to. Mean is used to reduce the time groups (as opposed to nearest, e.g.).

Default

H

--country <country>

Two-letter country code (e.g., in order of site count, US, RS, CA, AS, BR, IN, CH, NO, JA, UK, FR, …).

--state <state>

Two-letter state code (e.g., MD, …).

--box <box>

Bounding box for site selection. (latmin, lonmin, latmax, lonmax) in [-180, 180) format. Can’t be used if specifying country or state.

Default

None, None, None, None

-o <out_name>

Output file name (or full/relative path). By default the name is generated like ‘ISH_<start-date>_<end-date>.nc’.

-d, --dst <dst>

Destination directory (to control output location if using default output file name).

Default

.

--compress, --no-compress

If true, pack float to int and apply compression using zlib with complevel 7. This can take time if the dataset is large, but can lead to significant space savings.

Default

True

-n, --num-workers <num_workers>

Number of download workers.

Default

1

--verbose, --no-verbose
Default

False

--debug

Print more messages (including full tracebacks).

Default

False

get-ish-lite

Download ISH-Lite data using monetio and reformat for MM usage.

Note that the data are stored in yearly files by site, so the runtime mostly depends on the number of unique years that your date range includes, as well as any site selection narrowing. You can use –country or –state or –box to select groups of sites. ISH-Lite is an hourly product.

melodies-monet get-ish-lite [OPTIONS]

Options

-s, --start-date <start_date>

Required Start date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output.

-e, --end-date <end_date>

Required End date. Date can be in any format accepted by pandas.date_range(), e.g., ‘YYYY-MM-DD’, or ‘M/D/YYYY’. Time other than 0 UTC can be specified by adding trailing ‘ HH[:MM[:SS]]’, but this might not have an effect on the output. As not specifying time implies 0 UTC, to get the full last day for hourly data, you should specify hour, e.g., append ‘ 23’ or increase end date by one day. For daily data, this is not necessary.

--country <country>

Two-letter country code (e.g., in order of site count, US, RS, CA, AS, BR, IN, CH, NO, JA, UK, FR, …).

--state <state>

Two-letter state code (e.g., MD, …).

--box <box>

Bounding box for site selection. (latmin, lonmin, latmax, lonmax) in [-180, 180) format. Can’t be used if specifying country or state.

Default

None, None, None, None

-o <out_name>

Output file name (or full/relative path). By default the name is generated like ‘ISH-Lite_<start-date>_<end-date>.nc’.

-d, --dst <dst>

Destination directory (to control output location if using default output file name).

Default

.

--compress, --no-compress

If true, pack float to int and apply compression using zlib with complevel 7. This can take time if the dataset is large, but can lead to significant space savings.

Default

True

-n, --num-workers <num_workers>

Number of download workers.

Default

1

--verbose, --no-verbose
Default

False

--debug

Print more messages (including full tracebacks).

Default

False

run

Run MELODIES MONET as described in the control file CONTROL.

melodies-monet run [OPTIONS] CONTROL

Options

--debug

Print more messages (including full tracebacks).

Default

False

Arguments

CONTROL

Required argument