helikite.instruments.smart_tether
SmartTether -> LOG_20220929_A.csv (has pressure)
The SmartTether is a weather sonde. time res 2 seconds if lon lat recorded. 1 sec if not.
Important variables to keep: Time, Comment, P (mbar), T (deg C), RH (%), Wind (degrees), Wind (m/s), UTC Time, Latitude (deg), Longitude (deg)
!!! Date is not reported in the data, but only in the header (yes, it’s a pity) -> therefore, I wrote a function that to includes the date but it needs to change date if we pass midnight (not implemented yet).
Attributes
Classes
Functions
|
Removes outliers from wind speed using a median filter and synchronously removes corresponding wind direction values. |
Module Contents
- helikite.instruments.smart_tether.logger
- class helikite.instruments.smart_tether.SmartTether(*args, **kwargs)
Bases:
helikite.instruments.base.Instrument- date_extractor(first_lines_of_csv) datetime.datetime
- file_identifier(first_lines_of_csv) bool
- set_time_as_index(df: pandas.DataFrame) pandas.DataFrame
Set the DateTime as index of the dataframe and correct if needed
Using values in the time_offset variable, correct DateTime index
As the rows store only a time variable, a rollover at midnight is possible. This function checks for this and corrects the date if needed
- data_corrections(df, *args, **kwargs)
- read_data() pandas.DataFrame
- helikite.instruments.smart_tether.smart_tether
- helikite.instruments.smart_tether.wind_outlier_removal(df, col='smart_tether_Wind (m/s)', dir_col='smart_tether_Wind (degrees)', threshold=0.35, window_size=10)
Removes outliers from wind speed using a median filter and synchronously removes corresponding wind direction values. Plots both original and filtered wind speed and direction vs altitude.
- Parameters:
df (pd.DataFrame) – Input dataframe with wind speed and direction data.
col (str) – Wind speed column name.
dir_col (str) – Wind direction column name.
threshold (float) – Relative deviation threshold for outlier detection.
window_size (int) – Size of sliding window for median filtering.
- Returns:
A filtered copy of the input DataFrame with outliers replaced by NaN.
- Return type:
pd.DataFrame