From: Keith Packard Date: Thu, 10 Sep 2009 18:53:06 +0000 (-0700) Subject: Plot raw accel data for the motor accel section. X-Git-Tag: debian/0.5+77+gc57bd7f~8^2 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=078e9cdbdb388b22c6151f76ff0660fc14b8ef55;hp=-c Plot raw accel data for the motor accel section. This shows a short sequence of accelerometer data without any filtering. Signed-off-by: Keith Packard --- 078e9cdbdb388b22c6151f76ff0660fc14b8ef55 diff --git a/ao-tools/ao-postflight/ao-postflight.c b/ao-tools/ao-postflight/ao-postflight.c index 3a6f04b6..1e6ac744 100644 --- a/ao-tools/ao-postflight/ao-postflight.c +++ b/ao-tools/ao-postflight/ao-postflight.c @@ -83,7 +83,7 @@ plot_perioddata(struct cc_perioddata *d, char *axis_label, char *plot_label, static void plot_timedata(struct cc_timedata *d, char *axis_label, char *plot_label, - double min_time, double max_time) + double min_time, double max_time, int plot_type) { double *times; double *values; @@ -112,13 +112,16 @@ plot_timedata(struct cc_timedata *d, char *axis_label, char *plot_label, ymax_i = cc_timedata_max(d, min_time, max_time); ymin = d->data[ymin_i].value; ymax = d->data[ymax_i].value; - plcol0(1); - pllab("Time", axis_label, plot_label); for (i = start; i <= stop; i++) { times[i-start] = (d->data[i].time - start_time)/100.0; values[i-start] = d->data[i].value; } + plscol0(1, 0, 0, 0); + plscol0(2, plot_colors[plot_type][0], plot_colors[plot_type][1], plot_colors[plot_type][2]); + plcol0(1); plenv(times[0], times[stop-start], ymin, ymax, 0, 2); + pllab("Time", axis_label, plot_label); + plcol0(2); plline(stop - start + 1, times, values); free(times); free(values); @@ -320,12 +323,20 @@ analyse_flight(struct cc_flightraw *f, FILE *summary_file, FILE *detail_file, FI plstar(2, 3); speed = merge_data(&cooked->accel_speed, &cooked->pres_speed, apogee); - plot_perioddata(&cooked->pres_pos, "meters", "Height", -1e10, 1e10, PLOT_HEIGHT); - plot_perioddata(&cooked->pres_pos, "meters", "Height to Apogee", boost_start, apogee, PLOT_HEIGHT); - plot_perioddata(speed, "meters/second", "Speed", -1e10, 1e10, PLOT_SPEED); - plot_perioddata(speed, "meters/second", "Speed to Apogee", boost_start, apogee, PLOT_SPEED); - plot_perioddata(&cooked->accel_accel, "meters/second²", "Acceleration", -1e10, 1e10, PLOT_ACCEL); - plot_perioddata(&cooked->accel_accel, "meters/second²", "Acceleration during Boost", boost_start, boost_stop + (boost_stop - boost_start) / 2.0, PLOT_ACCEL); + plot_perioddata(&cooked->pres_pos, "meters", "Height", + -1e10, 1e10, PLOT_HEIGHT); + plot_perioddata(&cooked->pres_pos, "meters", "Height to Apogee", + boost_start, apogee + (apogee - boost_start) / 10.0, PLOT_HEIGHT); + plot_perioddata(speed, "meters/second", "Speed", + -1e10, 1e10, PLOT_SPEED); + plot_perioddata(speed, "meters/second", "Speed to Apogee", + boost_start, apogee + (apogee - boost_start) / 10.0, PLOT_SPEED); + plot_perioddata(&cooked->accel_accel, "meters/second²", "Acceleration", + -1e10, 1e10, PLOT_ACCEL); +/* plot_perioddata(&cooked->accel_accel, "meters/second²", "Acceleration during Boost", + boost_start, boost_stop + (boost_stop - boost_start) / 2.0, PLOT_ACCEL); */ + plot_timedata(&cooked->accel, "meters/second²", "Acceleration during Boost", + boost_start, boost_stop + (boost_stop - boost_start) / 2.0, PLOT_ACCEL); free(speed->data); free(speed); plend();