backfill all data points
This commit is contained in:
@@ -32,7 +32,7 @@ def cfg():
|
||||
'SNOW_STRENGTH_MIN': int( os.getenv('SNOW_STRENGTH_MIN', '700')),
|
||||
'SEISMIC_NOISE_FLOOR': float( os.getenv('SEISMIC_NOISE_FLOOR', '0.02')),
|
||||
'TEMP_CALIBRATION': float( os.getenv('TEMP_CALIBRATION', '0.0')),
|
||||
'VISIBILITY_MAX_KM': float( os.getenv('VISIBILITY_MAX_KM', '50.0')),
|
||||
'VISIBILITY_MAX': float( os.getenv('VISIBILITY_MAX', '50.0')),
|
||||
'CLOUD_SUN_MIN_ELEV': float( os.getenv('CLOUD_SUN_MIN_ELEV', '5.0')),
|
||||
'CLOUD_LUX_CLEAR_SKY': float( os.getenv('CLOUD_LUX_CLEAR_SKY', '100000.0')),
|
||||
'CLOUD_HUMIDITY_WEIGHT': float( os.getenv('CLOUD_HUMIDITY_WEIGHT', '0.3')),
|
||||
@@ -273,7 +273,7 @@ def estimate_visibility(c, rh, aqi):
|
||||
beta_rh = 0.000146 * math.exp(0.06 * rh_clamped)
|
||||
aqi_factor = 1.0 + ((aqi or 0) / 500.0) * 0.5
|
||||
extinction = beta_rh * aqi_factor
|
||||
return round(min(3.912 / extinction, c['VISIBILITY_MAX_KM']), 2)
|
||||
return round(min(3.912 / extinction, c['VISIBILITY_MAX']), 2)
|
||||
|
||||
def read_ltr(c, sensor, temp=None, dew_point=None, rh=None, aqi=None, lat=0.0, lon=0.0):
|
||||
global uv_dose_mj, uv_dose_date, last_uv_time
|
||||
@@ -315,7 +315,7 @@ def read_ltr(c, sensor, temp=None, dew_point=None, rh=None, aqi=None, lat=0.0, l
|
||||
fields['sun_elevation'] = sun_elev
|
||||
|
||||
if rh is not None:
|
||||
fields['visibility_km'] = estimate_visibility(c, rh, aqi)
|
||||
fields['visibility'] = estimate_visibility(c, rh, aqi)
|
||||
|
||||
write(c, fields)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user