Use pressure speed for drogue and beyond states. Fix differentiation time.
authorKeith Packard <keithp@keithp.com>
Sun, 6 Sep 2009 20:08:54 +0000 (13:08 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 6 Sep 2009 20:08:54 +0000 (13:08 -0700)
Drogue state should always use pressure speeds.

Differentiation code was using centi-seconds instead of seconds.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/ao-postflight/ao-postflight.c
ao-tools/lib/cc-integrate.c

index 6683c67c9f3a0624b4b2bd2435ca9ce65c34c76e..0c632c343ca0e576c2c247e6405992c16b712cbc 100644 (file)
@@ -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];
index 08ca295ce5f3a853e6fde7a85a3e3afc1debad26..f9793dcdb3a3c3a5377a939659039a19d833d8b6 100644 (file)
@@ -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;
 }