Fetches information on all CDEC sites.
Returns: | df : pandas DataFrame
|
---|
Gets a list of sensor ids as a DataFrame indexed on sensor number. Can be limited by a list of numbers.
Usage example:
from ulmo import cdec
# to get all available sensor info
sensors = cdec.historical.get_sensors()
# or to get just one sensor
sensor = cdec.historical.get_sensors([1])
Parameters: | sites : iterable of integers or None |
---|---|
Returns: | df : pandas DataFrame
|
Gets available sensors for the given stations, sensor ids and time resolutions. If no station ids are provided, all available stations will be used (this is not recommended, and will probably take a really long time).
The list can be limited by a list of sensor numbers, or time resolutions if you already know what you want. If none of the provided sensors or resolutions are available, an empty DataFrame will be returned for that station.
Usage example:
from ulmo import cdec
# to get all available sensors
available_sensors = cdec.historical.get_sensors(['NEW'])
Parameters: | station_ids : iterable of strings or None sensor_ids : iterable of integers or None
resolutions : iterable of strings or None
|
---|---|
Returns: | dict : a python dict
|
Downloads data for a set of CDEC station and sensor ids. If either is not provided, all available data will be downloaded. Be really careful with choosing hourly resolution as the data sets are big, and CDEC’s servers are slow as molasses in winter.
Usage example:
from ulmo import cdec
dat = cdec.historical.get_data(['PRA'],resolutions=['daily'])
Parameters: | station_ids : iterable of strings or None sensor_ids : iterable of integers or None
resolutions : iterable of strings or None
|
---|---|
Returns: | dict : a python dict
|
Climate Prediction Center Weekly Drought Index dataset
Retreives data.
Parameters: | state : None or str
climate_division : None or int
start : None or date (see note on dates and times)
end : None or date (see note on dates and times)
as_dataframe: bool
|
---|---|
Returns: | data : dict or pandas.Dataframe
|
CUAHSI HIS Central web services
Retrieves a list of services.
Parameters: | bbox : None or 4-tuple
|
---|---|
Returns: | services_dicts : list
|
CUAHSI WaterOneFlow web services
Retrieves information on the sites that are available from a WaterOneFlow service using a GetSites request. For more detailed information including which variables and time periods are available for a given site, use get_site_info().
Parameters: | wsdl_url : str
suds_cache: ``None`` or tuple
|
---|---|
Returns: | sites_dict : dict
|
Retrieves detailed site information from a WaterOneFlow service using a GetSiteInfo request.
Parameters: | wsdl_url : str
site_code : str
suds_cache: ``None`` or tuple
|
---|---|
Returns: | site_info : dict
|
Retrieves site values from a WaterOneFlow service using a GetValues request.
Parameters: | wsdl_url : str
site_code : str
variable_code : str
start : None or datetime (see note on dates and times)
end : None or datetime (see note on dates and times)
suds_cache: ``None`` or tuple
|
---|---|
Returns: | site_values : dict
|
Retrieves site values from a WaterOneFlow service using a GetVariableInfo request.
Parameters: | wsdl_url : str
variable_code : None or str
suds_cache: ``None`` or tuple
|
---|---|
Returns: | variable_info : dict
|
National Climatic Data Center Climate Index Reference Sequential (CIRS) drought dataset
Retrieves data.
Parameters: | elements : ``None`, str or list
by_state : bool
location_names : str or None
as_dataframe : bool
use_file : None, file-like object or str
|
---|---|
Returns: | data : list or pandas.DataFrame
|
National Climatic Data Center Global Historical Climate Network - Daily dataset
Retrieves data for a given station.
Parameters: | station_id : str
elements : None, str, or list of str
update : bool
as_dataframe : bool
|
---|---|
Returns: | site_dict : dict
|
Retrieves station information, optionally limited to specific parameters.
Parameters: | country : str
state : str
elements : None, str, or list of str
start_year : int
end_year : int
update : bool
as_dataframe : bool
|
---|---|
Returns: | stations_dict : dict or pandas.DataFrame
|
National Climatic Data Center Global Summary of the Day dataset
Retrieves data for a set of stations.
Parameters: | station_codes : str or list
start : None or date (see note on dates and times)
end : None or date (see note on dates and times)
parameters : None, str or list
|
---|---|
Returns: | data_dict : dict
|
Retrieve information on the set of available stations.
Parameters: | country : {None, str, or iterable}
state : {None, str, or iterable}
start : None or date (see note on dates and times)
end : None or date (see note on dates and times)
update : bool
|
---|---|
Returns: | stations_dict : dict
|
This module provides direct access to Texas Weather Connection Daily Keetch-Byram Drought Index (KBDI) dataset.
Retreives data.
Parameters: | county : None or str
end : None or date (see note on dates and times)
start : None or date (see note on dates and times)
as_dataframe: bool
data_dir : None or directory path
|
---|---|
Returns: | data : dict or pandas.Dataframe
|
United States Army Corps of Engineers Tulsa District Water Control
Fetches a list of station codes and descriptions.
Returns: | stations_dict : dict
|
---|
Fetches data for a station at a given date.
Parameters: | station_code: str
date : None or date (see note on dates and times)
as_dataframe : bool
|
---|---|
Returns: | data_dict : dict
|
USGS National Water Information System web services
Fetches site information from USGS services. See the `USGS Site Service`_ documentation for a detailed description of options. For convenience, major options have been included with pythonic names. Options that are not listed below may be provided as extra kwargs (i.e. keyword=’argument’) and will be passed along with the web services request. These extra keywords must match the USGS names exactly. The `USGS Site Service`_ website describes available keyword names and argument formats.
Note
Only the options listed below have been tested and you may have mixed results retrieving data with extra options specified. Currently ulmo requests and parses data in the waterml format. Some options are not available in this format.
Parameters: | service : {None, ‘instantaneous’, ‘iv’, ‘daily’, ‘dv’}
input_file: ``None``, file path or file object
|
---|---|
Returns: | sites_dict : dict
|
Fetches site data.
Parameters: | site_code : str
service : {None, ‘instantaneous’, ‘iv’, ‘daily’, ‘dv’}
parameter_code : str
statistic_code: str
start : None or datetime (see note on dates and times)
end : None or datetime (see note on dates and times)
period : {None, str, datetime.timedelta}
modified_since : None or datetime.timedelta
input_file: ``None``, file path or file object
|
---|---|
Returns: | data_dict : dict
|
Fetches previously-cached site information from an hdf5 file.
Parameters: | site_code : str
path : None or file path
complevel : None or int {0-9}
complib : None or str {‘zlib’, ‘bzip2’, ‘lzo’, ‘blosc’}
|
---|---|
Returns: | site_dict : dict
|
Fetches previously-cached site data from an hdf5 file.
Parameters: | site_code : str
agency_code : None or str
parameter_code : None, str, or list
path : None or file path
complevel : None or int {0-9}
complib : None or str {‘zlib’, ‘bzip2’, ‘lzo’, ‘blosc’}
|
---|---|
Returns: | data_dict : dict
|
Fetches previously-cached site information from an hdf5 file.
Parameters: | path : None or file path
complevel : None or int {0-9}
complib : None or str {‘zlib’, ‘bzip2’, ‘lzo’, ‘blosc’}
|
---|---|
Returns: | sites_dict : dict
|
Remove values from hdf5 file.
Parameters: | site_code : str
datetime_dicts : a python dict with a list of datetimes for a given variable
path : file path to hdf5 file. |
---|---|
Returns: | None : None |
Repack the hdf5 file at path. This is the same as running the pytables ptrepack command on the file.
Parameters: | path : file path
complevel : None or int {0-9}
complib : None or str {‘zlib’, ‘bzip2’, ‘lzo’, ‘blosc’}
|
---|---|
Returns: | None : None |
Update cached site data.
Parameters: | site_code : str
start : None or datetime (see note on dates and times)
end : None or datetime (see note on dates and times)
period : {None, str, datetime.timedelta}
path : None or file path
input_file: ``None``, file path or file object
autorepack : bool
|
---|---|
Returns: | None : None |
Update cached site information.
See ulmo.usgs.nwis.core.get_sites() for description of regular parameters, only extra parameters used for caching are listed below.
Parameters: | path : None or file path
input_file: ``None``, file path or file object
complevel : None or int {0-9}
complib : None or str {‘zlib’, ‘bzip2’, ‘lzo’, ‘blosc’}
autorepack : bool
|
---|---|
Returns: | None : None |
USGS Emergency Data Distribution Network services
Fetches GOES Satellite DCP messages from USGS Emergency Data Distribution Network.
Parameters: | dcp_address : str, iterable of strings
start : {None, str, datetime, datetime.timedelta}
end : {None, str, datetime, datetime.timedelta}
networklist : str,
channel : str,
spacecraft : str,
baud : str,
electronic_mail : str,
dcp_bul : str,
glob_bul : str,
timing : str,
retransmitted : str,
daps_status : str,
use_cache : bool,
cache_path : {None, str},
as_dataframe : bool
|
---|---|
Returns: | message_data : {pandas.DataFrame, dict}
|
decodes dcp message data in pandas dataframe returned by ulmo.usgs.eddn.get_data().
Parameters: | dataframe : pandas.DataFrame
parser : {function, str}
|
---|---|
Returns: | decoded_data : pandas.DataFrame
|
Earth Resources Observation and Science (EROS) Center application services (Raster)
retrieve available datasets for a given bounding box.
Parameters: | bbox : (sequence of float|str)
attrs: comma separated list of str
as_dataframe : True (default) or False
|
---|---|
Returns: | datasets : dict or pandas DataFrame
|
retrieve list of data themes available
Parameters: | as_dataframe : True (default) or False
|
---|---|
Returns: | available data themes |
retrieve list of metadata attributes for dataset
Parameters: | as_dataframe : True (default) or False
|
---|---|
Returns: | available metadata attributes |
retrieve list of data formats available for dataset
Parameters: | product_key : str
as_dataframe : True (default) or False
|
---|---|
Returns: | available data formats |
downloads National Elevation Dataset raster tiles that cover the given bounding box for the specified data layer.
Parameters: | product_key : str
bbox : (sequence of float|str)
fmt : None or str
path : None or path
update_cache: ``True`` or ``False`` (default)
check_modified: ``True`` or ``False`` (default)
mosaic: ``True`` or ``False`` (default)
|
---|---|
Returns: | raster_tiles : geojson FeatureCollection
|
retrieve metadata for raster tiles that cover the given bounding box for the specified data layer.
Parameters: | product_key : str
bbox : (sequence of float|str)
fmt : str
|
---|---|
Returns: | metadata : geojson FeatureCollection
|
`National Elevation Dataset`_ services (Raster)
return list of available data layers
downloads National Elevation Dataset raster tiles that cover the given bounding box for the specified data layer.
Parameters: | layer : str
bbox : (sequence of float|str)
path : None or path
check_modified: ``True`` or ``False`` (default)
mosaic: ``True`` or ``False`` (default)
|
---|---|
Returns: | raster_tiles : geojson FeatureCollection
|
retrieve metadata for raster tiles that cover the given bounding box for the specified data layer.
Parameters: | layer : str
bbox : (sequence of float|str)
|
---|---|
Returns: | metadata : geojson FeatureCollection
|
Dates and times can provided a few different ways, depending on what is convenient. They can either be a string representation or as instances of date and datetime objects from python’s datetime standard library module. For strings, the ISO 8061 format (‘YYYY-mm-dd HH:MM:SS’ or some abbreviated version) is accepted, as well dates in ‘mm/dd/YYYY’ format.