diff options
author | Keith Packard <keithp@keithp.com> | 2009-09-06 13:08:54 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-09-06 13:08:54 -0700 |
commit | 73f4a57239f770aff603b961169c0e2cfe2c276b (patch) | |
tree | a3d70042420d2d59d52105e9ea5fe628ce32f73c | |
parent | e35e485ffe6b26034788ab295121bc2693b7eec1 (diff) |
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 <keithp@keithp.com>
-rw-r--r-- | ao-tools/ao-postflight/ao-postflight.c | 2 | ||||
-rw-r--r-- | ao-tools/lib/cc-integrate.c | 2 |
2 files changed, 2 insertions, 2 deletions
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; } |