Downloading Data

Station Lists

Specific Command Line Interfaces

CDEC

download_cdec

CLI for downloading CDEC water data.

Usage

download_cdec [OPTIONS] [STATIONFILE]...

Options

--dest <dest_dir>

Destination directory for downloaded files.

--id_col <id_col>

Column in station file representing CDEC ID. IDs with > 3 characters will be ignored.

--param_col <param_col>

Column in station file representing the parameter to download.

--start <start>

Required Start time, format 2009-03-31 14:00

--end <end>

End time, format 2009-03-31 14:00

--param <param>

Variable to download

--stations <stations>

Id or name of one or more stations.

--overwrite

Overwrite existing files (if False they will be skipped, presumably for speed)

--freq <freq>

Frequency code(s): E (event), H (hourly), D (daily), M (monthly). Default is E,H. Multiple values allowed as comma-separated list (e.g., E,H,D).

--logdir <logdir>
--debug
--quiet

Arguments

STATIONFILE

Optional argument(s)

USGS (NWIS)

download_nwis

CLI for downloading NWIS (National Water Information System).

Usage

download_nwis [OPTIONS] [STATIONFILE]...

Options

-h, --help

Show this message and exit.

--dest <dest_dir>

Destination directory for downloaded files.

--start <start>

Start time, format 2009-03-31 14:00

--end <end>

End time, format 2009-03-31 14:00

--param <param>

Parameter(s) to be downloaded, e.g. 00065 = gage height (ft.), 00060 = streamflow (cu ft/sec) and 00010 = water temperature in degrees Celsius. See “http://help.waterdata.usgs.gov/codes-and-parameters/parameters” for complete listing. (if not specified, all the available parameters will be downloaded)

--stations <stations>

Id or name of one or more stations.

--overwrite

Overwrite existing files (if False they will be skipped, presumably for speed)

--daily

Use the USGS OGC daily-values endpoint and write DMS1-compatible daily output.

--logdir <logdir>
--debug
--quiet

Arguments

STATIONFILE

Optional argument(s)

NOAA

download_noaa

Command line interface to download NOAA water level data.

STATIONFILE: CSV-format station file(s).

example usage: dms download_noaa –start 2020-01-01 –end 2020-12-31 –param water_level –dest noaa_data stationlist.txt

Usage

download_noaa [OPTIONS] [STATIONFILE]...

Options

--start <start>

First date to download

--end <end>

Last date to download, inclusive

--syear <syear>

First year to download

--eyear <eyear>

Last year to download, inclusive to end of the year.

--param <param>

Product to download: water_level, predictions, water_temperature, conductivity.

--stations <stations>

Id or name of one or more stations.

--dest <dest_dir>

Destination directory for downloaded files.

--list

List known station ids.

--overwrite

Overwrite existing files (if False they will be skipped, presumably for speed

--logdir <logdir>
--debug
--quiet
-h, --help

Show this message and exit.

Arguments

STATIONFILE

Optional argument(s)

DWR-NCRO

It has traditionally been difficult to write robots to scrape data from Water Data Library. The utility download_wdl is included but is not maintained and may fail to function or to retrieve recent files. There are newer web services (public) that we are testing, but NCRO has expressed some concern about overuse during peak hours when the services are used by staff to work on data. The current interface shown here is for downloading period of record files, so its interface is simpler, less flexible and different from the others.

#.. argparse:: # :module: dms_datastore.download_ncro # :func: create_arg_parser # :prog: download_ncro.py

download_des

CLI for downloading DES (DWR Environmental Services) data.

Usage

download_des [OPTIONS] [STATIONFILE]...

Options

--dest <dest_dir>

Destination directory for downloaded files.

--start <start>

Start time, format 2009-03-31 14:00

--end <end>

End time, format 2009-03-31 14:00

--param <param>

Parameter(s) to be downloaded.

--stations <stations>

Id or name of one or more stations.

--overwrite

Overwrite existing files (if False they will be skipped, presumably for speed)

--logdir <logdir>
--debug
--quiet
-h, --help

Show this message and exit.

Arguments

STATIONFILE

Optional argument(s)

DWR-DES (DISE)

DWR Division of Environmental Services has been renamed but the name has not yet been updated here. These web services are internal to DWR. External users can get reformatted/screened data from our group or request data from DWR liasons who are identified on CDEC on a per-station basis.