Skip to content
Snippets Groups Projects
Commit 2d08b9c3 authored by David Hoese's avatar David Hoese
Browse files

Merge branch 'bugfix-accum-precip-units' into 'master'

Fix accumulated precipitation using wrong units

See merge request metobs/AossTower!7
parents f755c3ac 7013704f
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,11 @@ def get_data(input_files):
frame = pd.DataFrame(_get_data(input_files))
frame = frame.set_index('stamp')
frame = frame.mask(frame == -99999.).fillna(value=np.nan)
for col_name in frame.columns:
if col_name in schema.unit_conversions:
conv_func = schema.unit_conversions[col_name]
frame[col_name] = conv_func(frame[col_name])
return frame
......
......@@ -241,7 +241,7 @@ database = dict(
'accumulated_precipitation',
'accum_precip',
'Precipitation accumulated since 0Z',
'mm',
'mm', # data comes from instrument as inches but we typically want millimeters
'0',
'254',
None,
......@@ -273,3 +273,6 @@ database_dict = {k: v._asdict() for k, v in database.items()}
met_vars = {'air_temp', 'dewpoint', 'rh', 'solar_flux', 'pressure', 'precip', 'accum_precip',
'wind_speed', 'wind_dir', 'gust'}
engr_vars = set(database.keys()) - met_vars
unit_conversions = {}
unit_conversions['accum_precip'] = lambda x: x * 25.4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment