asi_core.real_time.meteo_data_log

Classes

MeteoDataLog

Abstract class of meteo data logger.

Module Contents

class asi_core.real_time.meteo_data_log.MeteoDataLog(log_filepath, timezone, log_size=pd.Timedelta(days=3), latitude=37.1, longitude=-2.36, altitude=490, min_sun_elevation=5, when_to_resize_log=datetime.strptime('00:00:00', '%H:%M:%S').time(), write_mode='w')

Abstract class of meteo data logger. Method get_new_data shall be implemented for each type of logger :param log_filepath: (str) file path of the meteo data log :param timezone: (str) desired time zone (e.g. “GMT+1” = UTC+1) :param log_size: (Timedelta) size of the log express as Timedelta, default is 3 days :param latitude: (float) latitude of the camera position. Default is 37.1º :param longitude: (float) longitude of the camera position. Default is -2.36º :param altitude: (float) altitude of the camera position. Default is 490m :param min_sun_elevation: (float) minimum sun elevation to log meteo data. Default is 5º :param when_to_resize_log: (time) time of day when to resize log. Default is 00:00:00 :param write_mode: (str) meteo data log write mode, ‘w’ for write or ‘a’ for append. Default is ‘w’

log_filepath
timezone
log_size
latitude = 37.1
longitude = -2.36
altitude = 490
min_sun_elevation = 5
when_to_resize_log
write_mode = 'w'
is_log_resized = False
add_new_data(new_meteodata_df)

Process new data from a campbell scientific logger

Parameters:

new_meteodata_df – (DataFrame) New meteo data to add to the log

check_log_resize()

Check when it is time to resize the log

resize_log()

Resize the log file to the given duration