olm.loggers package¶
Submodules¶
olm.loggers.CampbellToolkit module¶
olm.loggers.CyclopsToolkit module¶
olm.loggers.HoboToolkit module¶
-
olm.loggers.HoboToolkit.read_hobo_csv(csv_file, all_columns=False)[source]¶ Reads data from a csv file exported from HOBOware.
Parameters: - csv_file : string
A string containing the file name of the csv file to be read.
- all_columns : boolean (optional)
Determines whether to read in all columns or just ones that we search for and relabel (RH, DewPt, Abs Pres, Temp, Attached, Stopped, Connected, EOF, Cond High Range, Cond Low Range, DO). Default = False
Returns: - df : pandas.DataFrame
DataFrame containing data from HOBO csv file.
olm.loggers.SchlumbergerCTDToolkit module¶
-
olm.loggers.SchlumbergerCTDToolkit.concatCTD(dflist, zero_shift=True, n_to_average=5, offset_list=[], offset_dates=[])[source]¶ Accepts a list of CTD DataFrames and concatenates them.
Parameters: - dflist : list
List of pandas.DataFrames to concatenate.
- zero_shift : boolean
If set to True, the pressure values will be adjusted at the time of each join, assuming that flow depth before and after the join was equal. If set to False, no adjustment will be made in pressure values. This is useful when downloading the logger may have resulted in a slightly different position in the water column. (Default = True)
- n_to_average : int
Number of data points to average before and after join in order to determine data offset value for pressure
- offset_list : list
List of offsets to be applied manually to pressure data.
- offset_dates : list
List of datetime strings corresponding to manual offsets.
Returns: - (concatenated : pandas.DataFrame, offset_list
A tuple is returned with the first item being a DataFrame object containing the concatenated data and the second item in the tuple being a DataFrame object containing offsets with datetimes of the offsets as an index.
-
olm.loggers.SchlumbergerCTDToolkit.readBaro(csvfile)[source]¶ Reads data from a CSV or MON file from a Schlumberger Baro Diver.
Parameters: - csv_file : string
A string containing the file name of the CSV or MON file to be read.
Returns: - df : pandas.DataFrame
DataFrame containing data from HOBO csv file.
-
olm.loggers.SchlumbergerCTDToolkit.readCTD(csvfile)[source]¶ Reads data from a CSV or MON file exported from a Schlumberger CTD Diver.
Parameters: - csv_file : string
A string containing the file name of the CSV or MON file to be read.
Returns: - df : pandas.DataFrame
DataFrame containing data from HOBO csv file.
olm.loggers.TruBluToolkit module¶
olm.loggers.WTWpHToolkit module¶
olm.loggers.loggerScripts module¶
Contains functions that are useful in general for manipulation of data logger data
-
olm.loggers.loggerScripts.joinAndResampleLoggers(loggerlist, interval, suffixes=[], how='inner', interpolate=False, limit=None)[source]¶ Joins and resamples data from DataFrame objects provided in a list.
Parameters: - loggerlist : list
List of logger pandas.core.dataframe.DataFrame objects to be joined.
- interval : string
Pandas offset string (http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases) on which the DataFrames should be resampled (e.g. ‘H’=hour, ‘T’=minute, ‘D’=day).
- suffixes : list
A list of strings (same length as loggerlist) that contains suffixes to be applied to each logger. This is useful if multiple loggers have the same column names.
- how : string
Method for joining loggers (default = ‘inner’).
- interpolate : boolean
Whether data should be interpolated to fill gaps in rows (default=False).
- limit : int
Maximum number of consecutive NaNs to fill if data are interpolated.
Returns: - joined : pandas.core.dataframe.DataFrame
DataFrame Object that contains joined DataFrames.
-
olm.loggers.loggerScripts.joinLoggers(loggerlist, how='inner', interpolate=False)[source]¶ Joins the data from a list of logger DataFrame objects together.
Parameters: - loggerlist : list
A list of logger DataFrame objects to be joined.
- how : string, optional
How the two DataFrames are to be joined. Default is inner.
- interpolate : boolean, optional
Determines whether empty rows are to be filled with data via interpolation. Uses Pandas Dataframe.interpolate(). Default = False
Returns: - joined : pandas.DataFrame
DataFrame of joined loggers.
-
olm.loggers.loggerScripts.linear_correction(rawSeries, correctionSeries)[source]¶ Uses a Pandas Series of spot measured values to linearly correct time series data from a logger.
Parameters: - rawSeries : pandas.core.series.Series
A Pandas Series that contains the time series data to be corrected.
- correctionSeries : pandas.core.series.Series
A Pandas Series that contains spot measurement data that are to be used to correct rawSeries.
Returns: - rawSeries : pandas.core.series.Series
A corrected version of the rawSeries time series data.
-
olm.loggers.loggerScripts.manualCompare(logger, manual, value_name='', ltag='_log', mtag='_man')[source]¶ Function to extract logger data with same timestamps as manual measurements for comparison. Both data sets are resampled on an hourly interval to assure alignment of indicies.
Parameters: - logger : pandas.core.series.Series
A Pandas TimeSeries containing a single column and time stamps as indices.
- manual : pandas.core.series.Series
A Pandas TimeSeries containing a single variable from the manual data set
- value_name : string
A string to use as the base for the collumn labels in the output DataFrame.
- ltag : string
A suffix to be added to the logger column name, or used as the logger column name if value_name is not set.
- mtag : string
A suffix to be added to the manual measurement column name, or used as the manual measurement column name if value_name is not set.
Returns: - joined : pandas.core.dataframe.DataFrame
A DataFrame object containing values of manual measurements and corresponding values from the logger time series using the aligned index that is resampled to the hour.
-
olm.loggers.loggerScripts.shiftLogger(logger, shift_to, align_at_start=True)[source]¶ Function to extract logger data with same timestamps as manual measurements for comparison. Both data sets are resampled on an hourly interval to assure alignment of indicies.
Parameters: - logger : pandas.core.series.Series or pandas.core.dataframe.Dataframe
A Pandas TimeSeries or DataFrame containing time stamps as indices.
- shift_to : string
A string that contains the date and time that the logger series should be shifted to. By default this is the correct starting time (first time stamp) of the series.
- align_at_start : boolean
If True, shift_to is assumed to represent the correct starting date for the series. If False, shift_to is assumed to represent the correct final date of the series. (default=True)
Returns: - logger : pandas.core.series.Series or pandas.core.dataframe.DataFrame
A Series or DataFrame object that contains the correct shifted time stamps.