Add units to file info

master
Dan Howe 5 years ago
parent 6f3a47f901
commit c0e8fe1bb4

@ -50,6 +50,7 @@ def parse_contents(contents, filename):
# Check instrument type # Check instrument type
inst_type = basename.split('_')[-1] inst_type = basename.split('_')[-1]
units = pd.read_csv(io.StringIO(decoded.decode('utf-8'))).columns[1]
if inst_type == 'WP': if inst_type == 'WP':
df = pd.read_csv(io.StringIO(decoded.decode('utf-8')), df = pd.read_csv(io.StringIO(decoded.decode('utf-8')),
index_col=0, index_col=0,
@ -103,7 +104,7 @@ def parse_contents(contents, filename):
# Add spectral values to dataframe # Add spectral values to dataframe
stats.loc[col, keys] = values stats.loc[col, keys] = values
info = {'filename': filename, 'instrument type': inst_type} info = {'filename': filename, 'instrument type': inst_type, 'units': units}
json_data = {} json_data = {}
json_data['info'] = info json_data['info'] = info
json_data['timeseries'] = df.to_json(orient='table') json_data['timeseries'] = df.to_json(orient='table')

Loading…
Cancel
Save