pyrolib.data_processing package
Submodules
pyrolib.data_processing.firefluxI module
Post-processing of FireFlux I raw data
- class pyrolib.data_processing.firefluxI.MainTowerTc
Bases:
objectType T thermocouples data extraction class
Extraction of Main Tower (MT) type T thermocouples data.
Class object for Main Tower is already created in the package. Following class is available:
>>> MTtc = MainTowerTc()
Examples
Import type T thermocouples data and use Hodrick-Prescott filter
>>> import pyrolib.firefluxpost as ffp >>> import statsmodels.api as sm >>> >>> # set FireFlux I data path >>> ffp.set_data_path('/home/user/data/FireFlux_Raw') >>> # extract main tower data from file >>> ffp.MTtc.getdata() >>> # use HP filter (1600 as filtering constant) >>> _, filteredsignal = sm.tsa.filters.hpfilter(ffdp.MTtc.Tc['02.00'].data, 1600)
- getdata()
Get data in file _DataFileName
The file contains type T Thermocouple data for each height for Main Tower
- class pyrolib.data_processing.firefluxI.SonicTower(height, tower)
Bases:
objectSonic anemometer data extraction class
Extraction of Main Tower (MT) and Small Tower (ST) data.
Class objects for Main Tower and Small towers are already created in the package. Following classes are available:
>>> MT2 = SonicTower(height=2 , tower='main' ) >>> MT10 = SonicTower(height=10, tower='main' ) >>> MT28 = SonicTower(height=28, tower='main' ) >>> MT42 = SonicTower(height=42, tower='main' ) >>> ST2 = SonicTower(height=2 , tower='small') >>> ST10 = SonicTower(height=10, tower='small')
- Parameters:
height (float) – Instrument height. Height is 2, 10, 28, 42 for Main Tower, and 2, 10 or Small Tower
tower (str) – Selected tower (main, small)
Examples
Extract data of the 2m sonic anemometer of the Small Tower and set a fail sensor
>>> import pyrolib.firefluxpost as ffp >>> from datetime import datetime >>> >>> # set FireFlux I data path >>> ffp.set_data_path('/home/user/data/FireFlux_Raw') >>> # extract 2m small tower data from file >>> ffp.ST2.get_wind_and_temp() >>> # set fail sensor >>> ffp.ST2.set_fail_sensor(ffp.datetime2seconds(ffp.ST2.time, datetime(2006, 2, 23, 12, 46, 44)), 455)
- get_wind_and_temp()
Import wind data and sonic temperature from data files.
- set_fail_sensor(timevector, failtime, endoffailtime=None)
Set nan into TcFine temperature for failed sensor since failtime to endoffailtime (default infinity)
- Parameters:
timevector (list of float) – time vector (seconds)
- pyrolib.data_processing.firefluxI.datetime2seconds(listofdate, startingdatetime)
Convert a list of datetime to seconds from a strating datetime
- Parameters:
listofdate (list of datetime) – List of datetime to convert to seconds.
startingpoint (datetime) – Starting datetime.
- Returns:
SpanSec – List of seconds elapsed since startingdatetime
- Return type:
list of float
- pyrolib.data_processing.firefluxI.set_data_path(path)
Set path to FireFlux I data directory.
The data directory should contains:
FireFlux_Raw/ ├── FireFlux_North_weatherstation_data.xls ├── FireFlux_radiosonde_022306_0655CST.xls ├── orography_25m_src.dat ├── Pfit_MT10m_FEB23_H12-13_1s.dat ├── Pfit_MT28m_FEB23_H12-13_1s.dat ├── Pfit_MT2m_FEB23_H12-13_1s.dat ├── Pfit_MT42m_FEB23_H12-13_1s.dat ├── Pfit_readme.doc ├── Pfit_ST10m_FEB23_H12-13_1s.dat ├── Pfit_ST2m_FEB23_H12-13_1s.dat ├── RP_FireFlux1_NEW.mov ├── tc_data_1hz_1.xls ├── tc_data_1hz_2.txt ├── tc_data_1hz_3.dat ├── tethersonde_readme.doc ├── tower_pro.mov ├── Y2524035_02.1-min.m.txt ├── Y2524036_03.1-min.m.txt ├── Y2524064_04.1-min.m.txt ├── Y2524067_01.1-min.m.txt └── Y2524068_05.1-min.m.txt
- Parameters:
path (str) – Path to FireFlux I data directory