diff options
author | Keith Packard <keithp@keithp.com> | 2009-09-06 20:26:17 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-09-06 20:26:17 -0700 |
commit | 932f1539b38567e565fd484171c13539b1467308 (patch) | |
tree | 485485df3cef45614c861da39b987bedb0aec190 /ao-tools/lib/cc-analyse.c | |
parent | 9177f5f4e9d832558ddd9ab227c4511f6201e7e5 (diff) |
Color plots, integrate only flight portion of data.
Telemetry files have piles of pad data which shouldn't be integrated
into the velocity data as it tends to generate huge values from the
noise of the sensor.
Also make the data lines colored to keep them visually distinct from
the rest of the plot image.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/lib/cc-analyse.c')
-rw-r--r-- | ao-tools/lib/cc-analyse.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ao-tools/lib/cc-analyse.c b/ao-tools/lib/cc-analyse.c index cdb16f02..27c416a6 100644 --- a/ao-tools/lib/cc-analyse.c +++ b/ao-tools/lib/cc-analyse.c @@ -18,6 +18,20 @@ #include "cc.h" #include <math.h> +void +cc_timedata_limits(struct cc_timedata *d, double min_time, double max_time, int *start, int *stop) +{ + int i; + + *start = -1; + for (i = 0; i < d->num; i++) { + if (*start < 0 && min_time <= d->data[i].time) + *start = i; + if (d->data[i].time <= max_time) + *stop = i; + } +} + int cc_timedata_min(struct cc_timedata *d, double min_time, double max_time) { |