From: Keith Packard Date: Sun, 6 Sep 2009 20:08:54 +0000 (-0700) Subject: Use pressure speed for drogue and beyond states. Fix differentiation time. X-Git-Tag: debian/0.5+77+gc57bd7f~8^2~8 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=73f4a57239f770aff603b961169c0e2cfe2c276b;hp=e35e485ffe6b26034788ab295121bc2693b7eec1 Use pressure speed for drogue and beyond states. Fix differentiation time. Drogue state should always use pressure speeds. Differentiation code was using centi-seconds instead of seconds. Signed-off-by: Keith Packard --- diff --git a/ao-tools/ao-postflight/ao-postflight.c b/ao-tools/ao-postflight/ao-postflight.c index 6683c67c..0c632c34 100644 --- a/ao-tools/ao-postflight/ao-postflight.c +++ b/ao-tools/ao-postflight/ao-postflight.c @@ -128,7 +128,7 @@ analyse_flight(struct cc_flightraw *f, FILE *summary_file, FILE *detail_file) } if (cooked) { - if (state_start < apogee) { + if (state < ao_flight_drogue) { speed_i = cc_perioddata_max(&cooked->accel_speed, state_start, state_stop); if (speed_i >= 0) speed = cooked->accel_speed.data[speed_i]; diff --git a/ao-tools/lib/cc-integrate.c b/ao-tools/lib/cc-integrate.c index 08ca295c..f9793dcd 100644 --- a/ao-tools/lib/cc-integrate.c +++ b/ao-tools/lib/cc-integrate.c @@ -72,7 +72,7 @@ cc_perioddata_differentiate(struct cc_perioddata *i) d->step = i->step; d->data = calloc (d->num, sizeof(double)); for (n = 1; n < d->num; n++) - d->data[n] = (i->data[n] - i->data[n-1]) / i->step; + d->data[n] = (i->data[n] - i->data[n-1]) / (i->step / 100.0); d->data[0] = d->data[1]; return d; }