resistics.project.time module

resistics.project.time.getTimeReader(projData: resistics.project.data.ProjectData, site: str, meas: str) → resistics.time.reader.TimeReader[source]

Get a data reader object for a measurement

Data readers will then return a timeData object when given a sample range of data to return for

Parameters
projDataProjectData

A project data object

sitestr

The site for which to get the data reader

measstr

The measurement in the site for which to get the data reader

Returns
DataReader

A data reader object which allows a user to get time data

resistics.project.time.preProcess(projData: resistics.project.data.ProjectData, **kwargs) → None[source]

Pre-process project time data

Preprocess the time data using filters, notch filters, resampling or interpolation. A new measurement folder is created under the site. The name of the new measurement folder is: prepend_[name of input measurement]_postpend. By default, prepend is “proc” and postpend is empty.

Processed time series data can be saved in a new site by using the outputsite option.

Parameters
projDataProjectData

A project data object

sitesstr, List[str], optional

Either a single site or a list of sites

sampleFreqsint, float, List[float], optional

The frequencies to preprocess

startstr, optional

Start date of data to preprocess in format “%Y-%m-%d %H:%M:%S”

stopstr, optional

Stop date of data to process in format “%Y-%m-%d %H:%M:%S”

outputsitestr, optional

A site to output the preprocessed time data to. If this site does not exist, it will be created

polreverseDict[str, bool]

Keys are channels and values are boolean flags for reversing

scaleDict[str, float]

Keys are channels and values are floats to multiply the channel data by

calibratebool, optional

Boolean flag for calibrating the data. Default is false and setting to True will calibrate where files can be found.

normalisebool, optional

Boolean flag for normalising the data. Default is False and setting to True will normalise each channel independently.

filterDict, optional

Filtering options in a dictionary

notchList[float], optional

List of frequencies to notch in spectra given as a list of floats

resampDict, optional

Resampling parameters in a dictionary with entries in the format: {sampleRateFrom: sampleRateTo}. All measurement directories of sampleRateFrom will be resampled to sampleRateTo

interpbool, optional

Boolean flag for interpolating the data on to the second, so that sampling is coincident with seconds. This is not always the case. For example, SPAM data is not necessarily sampled on the second, whereas ATS data is. This function is useful when combining data of multiple formats. Interpolation does not change the sampling rate. Default is False.

prependstr, optional

String to prepend to the output folder. Default is “proc”.

postpendstr, optional

String to postpend to the output folder. Default is empty.

resistics.project.time.viewTime(projData: resistics.project.data.ProjectData, startDate: str, endDate: str, **kwargs) → Union[matplotlib.figure.Figure, NoneType][source]

View timeseries in the project

Parameters
projDataProjectData

The project data instance

startDatestr

The start of the data range to plot

endDatestr

The end of the date range to plot

sitesList[str], optional

List of sites

sampleFreqsList[float], optional

List of sample frequencies to plot

chansList[str], optional

List of channels to plot

polreverseDict[str, bool]

Keys are channels and values are boolean flags for reversing

scaleDict[str, float]

Keys are channels and values are floats to multiply the channel data by

calibratebool, optional

Boolean flag to calibrate data

normalisebool, optional

Boolean flag to normalise the data. Default is False and setting to True will normalise each channel independently.

notchList[float], optional

List of frequencies to notch out

filterDict, optional

Filter parameters

showbool, optional

Boolean flag to show the plot

savebool, optional

Boolean flag to save the plot to images folder

plotoptionsDict

Dictionary of plot options

Returns
matplotlib.pyplot.figure or None

A matplotlib figure unless the plot is not shown and is saved, in which case None and the figure is closed.