Created on Aug 5, 2013
@author: Christoph Paulik Christoph.Paulik@geo.tuwien.ac.at
Bases: object
class provides interface to ISMN data downloaded from the ISMN website
upon initialization it collects metadata from all files in path_to_data and saves metadata information in numpy file in folder path_to_data/python_metadata/ First initialization can take a minute or so if all ISMN data is present in path_to_data
Parameters: | path_to_data : string
network : string, optional
|
---|---|
Raises: | ISMNError :
|
Attributes
metadata | numpy.array | metadata array for all stations contained in the path given during initialization |
kdTree | pytesmo.grid.nearest_neighbor.findGeoNN | kdTree for finding nearest insitu station for given lon lat |
Methods
find_nearest_station(lon,lat) | find nearest station for given coordinates |
finds the nearest station available in downloaded data
Parameters: | lon : float
lat : float
return_distance : boolean, optional
|
---|---|
Returns: | station : ISMN_station
distance : float, optional
|
returnes list of dataset_id’s that can be used to read a dataset directly through the read_ts function
get ISMN_station object by station name
Parameters: | stationname : string
network : string, optional
|
---|---|
Returns: | ISMN_station : ISMN_station object |
Raises: | ISMNError :
|
returns numpy.array of networks available through the interface
Returns: | networks : numpy.array
|
---|
returns numpy.array of station names available through the interface
Parameters: | network : string, optional
|
---|---|
Returns: | networks : numpy.array
|
plots available stations on a world map in robinson projection only available if basemap is installed
Raises: | ISMNError :
|
---|
read a time series directly by the id
Parameters: | idx : int
|
---|---|
Returns: | timeseries : pandas.DataFrame
|
Goes through all stations and returns those that measure the specified variable
Parameters: | variable : string
|
---|---|
Returns: | ISMN_station : ISMN_station object |
Bases: object
Knows everything about the station, like which variables are measured there in which depths and in which files the data is stored. This is not completely true for the CEOP format since depth_from and depth_to are not easily knowable without parsing the whole file. For CEOP format depth_from and depth_to will only contain the phrase ‘multiple’ instead of the actual depth
Parameters: | metadata : numpy.array
|
---|
Attributes
network | string | network the time series belongs to |
station | string | station name the time series belongs to |
latitude | float | latitude of station |
longitude | float | longitude of station |
elevation | float | elevation of station |
variables | numpy.array | variables measured at this station one of
|
depth_from | numpy.array | shallower depth of layer the variable with same index was measured at |
depth_to | numpy.array | deeper depth of layer the variable with same index was measured at |
sensors | numpy.array | sensor names of variables |
filenames | numpy.array | filenames in which the data is stored |
Methods
get_variables() | returns the variables measured at this station |
get_depths(variable) | get the depths in which a variable was measured at this station |
get_sensors(variable,depth_from,depth_to) | get the sensors for the given variable, depth combination |
read_variable(variable,depth_from=None,depth_to=None,sensor=None) | read the data for the given parameter combination |
function to go through all the depth_from, depth_to, sensor combinations for the given variable and yields ISMNTimeSeries if a match is found. if min_depth and/or max_depth where given it only returns a ISMNTimeSeries if depth_from >= min_depth and/or depth_to <= max_depth
Parameters: | variable: string :
min_depth : float, optional
max_depth : float, optional
|
---|---|
Returns: | time_series : iterator(pytesmo.io.ismn.readers.ISMNTimeSeries)
|
get depths at which the given variable was measured at this station
Parameters: | variable : string
|
---|---|
Returns: | depth_from : numpy.array depth_to : numpy.array |
get the sensors at which the variable was measured at the given depth
Parameters: | variable : string
depth_from : float
depth_to : float
|
---|---|
Returns: | sensors : numpy.array
|
Raises: | ISMNError :
|
get a list of variables measured at this station
Returns: | variables : numpy.array
|
---|
actually reads the given variable from the file. Parameters are required until any ambiguity is resolved. If there is only one depth for the given variable then only variable is required. If there are multiple depths at least depth_from is required. If there are multiple depth_to possibilities for one variable-depth_from combination also depth_to has to be specified. If 2 sensors are measuring the same variable in the same depth then also the sensor has to be specified.
Parameters: | variable: string :
depth_from : float, optional
depth_to : float, optional
sensor : string, optional
|
---|---|
Returns: | data : readers.ISMNTimeSeries
|
Raises: | ISMNError: :
|
Created on Aug 1, 2013
@author: Christoph Paulik christoph.paulik@geo.tuwien.ac.at
function walks the rootdir directory and looks for network folders and ISMN datafiles. It collects metadata for every file found and returns a numpy.ndarray of metadata
Parameters: | rootdir : string
|
---|---|
Returns: | metadata : numpy.ndarray
|
Created on Jul 31, 2013
@author: Christoph Paulik christoph.paulik@geo.tuwien.ac.at
Bases: object
class that contains a time series of ISMN data read from one text file
Attributes
network | string | network the time series belongs to |
station | string | station name the time series belongs to |
latitude | float | latitude of station |
longitude | float | longitude of station |
elevation | float | elevation of station |
variable | list | variable measured |
depth_from | list | shallower depth of layer the variable was measured at |
depth_to | list | deeper depth of layer the variable was measured at |
sensor | string | sensor name |
data | pandas.DataFrame | data of the time series |
Methods
get’s the file format from the length of the header and filename information
Parameters: | filename : string |
---|---|
Returns: | methodname : string
|
Raises: | ReaderException :
|
reads first line of file and splits filename this can be used to construct necessary metadata information for all ISMN formats
Parameters: | filename : string
|
---|---|
Returns: | header_elements : list
filename_elements : list
|
reads ISMN metadata from any format
Parameters: | filename: string : |
---|---|
Returns: | metadata: dict : |
get metadata from ISMN textfiles in the format called CEOP Reference Data Format
Parameters: | filename : string
|
---|---|
Returns: | metadata : dict
|
get metadata from ISMN textfiles in the format called Variables stored in separate files (CEOP formatted)
Parameters: | filename : string
|
---|---|
Returns: | metadata : dict
|
get metadata from ISMN textfiles in the format called Variables stored in separate files (CEOP formatted)
Parameters: | filename : string
|
---|---|
Returns: | metadata : dict
|
reads ISMN data in any format
Parameters: | filename: string : |
---|---|
Returns: | timeseries: IMSNTimeSeries : |
Reads ISMN textfiles in the format called CEOP Reference Data Format
Parameters: | filename : string
|
---|---|
Returns: | time_series : ISMNTimeSeries
|
Reads ISMN textfiles in the format called Variables stored in separate files (CEOP formatted)
Parameters: | filename : string
|
---|---|
Returns: | time_series : ISMNTimeSeries
|
Reads ISMN textfiles in the format called Variables stored in separate files (Header + values)
Parameters: | filename : string
|
---|---|
Returns: | time_series : ISMNTimeSeries
|