Skip to content

Commit

Permalink
Add pressure scaling for temp cal.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoppert committed Feb 1, 2017
1 parent 405968b commit 5d1641e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tools/process_sensor_caldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ def temperature_calibration(ulog_filename, do_plot):
'offset': lambda y: float(0),
'save_plot': True,
'plot_interval': '5 s',
'scale': 1,
}

if topic == 'sensor_baro':
config['fields'] = ['pressure']
config['ylabel'] = 'pressure, Pa'
config['offset'] = lambda y: np.median(y)
config['poly_deg'] = 5
config['scale'] = 100
elif topic == 'sensor_gyro':
config['fields'] = ['x', 'y', 'z']
config['ylabel'] = 'gyro, rad/s'
Expand Down Expand Up @@ -166,7 +168,7 @@ def temperature_calibration(ulog_filename, do_plot):
mask = np.logical_and(data.temperature > temp_start,
data.temperature < temp_start + temp_step)
x += [np.median(temp[mask])]
y += [np.median(data[field][mask]) - y_offset]
y += [config['scale']*np.median(data[field][mask]) - y_offset]
x = np.array(x)
y = np.array(y)

Expand Down

0 comments on commit 5d1641e

Please sign in to comment.