Previous topic

I/O utilities

Next topic

Importing COAPS information

This Page

Importing USGS information

Utilities for importing USGS streamflows data.

load_usgs_flows(site_no, cfgdict={'commentchar': "'#'", 'verbose': 'DEBUG', 'rootdir': '/Users/pierregm/workspace/climpy_/work', 'force_local': 'False', 'netfile': 'http://waterdata.usgs.gov/nwis', 'datadir': '/Users/pierregm/workspace/climpy_/work/USGS', 'nodata.streamflows': '-9999', 'begin_date': '1880-01-01', 'logfile': 'hcp.log', 'archive': '/Users/pierregm/workspace/climpy_/work/USGS/USGSInfo', 'headerlines': '2'})

Downloads hydrological data from the USGS site.

Parameters:

site_no : str

2- to 15-digit identification number of the site whose information must be downloaded.

netfile : {string}, optional

URL of the USGS flow gage site. By default, the value is read from the configuration file.

begin_date : {string}, optional

First date to be retrieved. By default, the value is read from the configuration file.

end_date : {None, string}, optional

Last date to be retrieved. If None, uses the current date.

datadir : {None, string}, optional

Directory where to store the output. If None, uses the current directory.

commentchar : {string}, optional

Character corresponding to a comment.

headerlines : {int}, optional

Number of uncommented lines to skip from the beginning of the file.

archive : {None, string}, optional

Name of the ZIP archive where to read pre-stored data or when to store data newly retrieved. The default is read from the configuration file.

Notes

The list of data codes valid for the data_type parameters are available on the USGS site