From a416847d3b19693c592e77c980f91943e1388a82 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 2 Nov 2011 15:31:41 -0700 Subject: [PATCH] Exclude obviously bogus SAC values from statistics calculations Random cutoff is 2.8l/min (or about 0.1cuft/min) Signed-off-by: Dirk Hohndel --- statistics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statistics.c b/statistics.c index 351f2d1..8000309 100644 --- a/statistics.c +++ b/statistics.c @@ -76,7 +76,7 @@ static void process_all_dives(struct dive *dive, struct dive **prev_dive) info_stat.max_depth.mm = dp->maxdepth.mm; info_stat.avg_depth.mm = (1.0 * old_tt * info_stat.avg_depth.mm + dp->duration.seconds * dp->meandepth.mm) / info_stat.total_time.seconds; - if (dp->sac > 0) { + if (dp->sac > 2800) { /* less than .1 cuft/min (2800ml/min) is bogus */ int old_sac_time = sac_time; sac_time += dp->duration.seconds; info_stat.avg_sac.mliter = (1.0 * old_sac_time * info_stat.avg_sac.mliter + -- 2.43.0