resistics.site.data module¶
-
class
resistics.site.data.
SiteData
(siteName: str, timePath: str, specPath: str, statPath: str, maskPath: str, transFuncPath: str)[source]¶ Bases:
resistics.common.base.ResisticsBase
Class for holding site information
- Attributes
- timePathint
Path to site time data
- specPathfloat
Path to site spectra data
- statPathdatetime.datetime
Path to site stat data
- transFuncPathdatetime.datetime
Path to site transfer function data
- measurementsList[str]
A list of the measurements in the site
- spectraList[str]
A list of spectra data for the site
- statisticsList[str]
A list of statistics data for the site
- transferFunctionsList[str]
A list of transfer function data for the site
- siteStartdatetime.datetime
The time of the first sample in the site
- siteEnddatetime.datetime
The time of the last sample in the site
- readersDict
Data readers for each measurement
- startsDict
Methods
__init__(siteName, timePath, specPath, statPath, transFuncPath)
Initialise the site data
refresh()
Refresh site data
getSampleFreqs()
Get list of unique sampling frequencies in site
getMeasurements(sampleFreq=None)
Get list of measurements in site, optionally filtered by sampling frequency
getMeasurement(meas)
Get the dataReader for the measurement
getMeasurementSampleFreq(meas)
Get the sampling frequency of a measurement in Hz
getMeasurementTimePath(meas)
Get the path for a measurement
getMeasurementSpecPath(meas)
Get the path for the spectra of a measurement
getMeasurementStatPath(meas)
Get the path for the statistics of a measurement
getMeasurementTransFuncPath(meas)
Get the path for the transfer function data of a measurement
getMeasurementStart(meas)
Get the time of the first sample of a measurement
getMeasurementEnd(meas)
Get the time of the last sample of a measurement
view(kwargs)
View the site data measurement information
printList()
Class status returned as list of strings
-
checkMeasurement
(self, meas: str) → bool[source]¶ Check if site and measurement are part of the project
- Parameters
- measstr
Name of measurement
- Returns
- bool
True if measurement exists
-
getMeasurement
(self, meas: str)[source]¶ Get the data reader of a measurement at a site
- Parameters
- measstr
The name of the measurement
- Returns
- DataReader, bool
Returns the data reader for the measurement or if the measurement is not found, False
-
getMeasurementEnd
(self, meas: str) → datetime.datetime[source]¶ Get the end time of a particular measurement at a site
This returns the time of the last sample for the measurement
- Parameters
- measstr
The name of the measurement
- Returns
- datetime.datetime
End time of a measurement at a site
-
getMeasurementSampleFreq
(self, meas: str) → float[source]¶ Get the sample frequency in Hz of a particular measurement at a site
- Parameters
- sitestr
The name of the site
- measstr
The name of the measurement
- Returns
- float
Sampling frequency of site
-
getMeasurementSpecPath
(self, meas: str) → str[source]¶ Get the spectra data path for a measurement at a site
- Parameters
- measstr
The name of the measurement
- Returns
- str
Path to the spectra data for a measurement at the site
-
getMeasurementStart
(self, meas: str) → datetime.datetime[source]¶ Get the start time of a particular measurement at a site
This returns the time of the first sample for the measurement
- Parameters
- measstr
The name of the measurement
- Returns
- datetime.datetime
Start time of a measurement at a site
-
getMeasurementStatPath
(self, meas: str) → str[source]¶ Get the statistic data path for a measurement at a site
- Parameters
- measstr
The name of the measurement
- Returns
- str
Path to the statistic data for a measurement at the site
-
getMeasurementTimePath
(self, meas: str) → str[source]¶ Get the time data path for a measurement at a site
- Parameters
- measstr
The name of the measurement
- Returns
- str
Path to the time data for a measurement at the site
-
getMeasurementTransFuncPath
(self, meas: str) → str[source]¶ Get the transfer function data path for a measurement at a site
- Parameters
- measstr
The name of the measurement
- Returns
- str
Path to the transfer function data for a measurement at the site
-
getMeasurements
(self, sampleFreq: Union[NoneType, float, int] = None) → List[str][source]¶ Get a list of measurements for a site
- Parameters
- sampleFreqfloat, int, optional
Sampling frequency
- Returns
- List[str]
List of site time files. If fs is supplied, then only time files with sampling frequency fs.
-
getSampleFreqs
(self) → List[float][source]¶ Get a list of all the distinct sampling frequencies in the site
- Returns
- List[float]
List of the unique sampling frequencies in a site
-
getSpecdirMaskPath
(self, specdir: str) → str[source]¶ Get the mask path for a particular set of spectra calculations
Masks are calculated with relation to sampling frequencies over a whole set of spectra directories.
- Parameters
- specdirstr
The spectra set
- Returns
- str
Path to mask data for the spectra set