From 8425a22dbcac764830d4ac7c8b83fb88cbfb0fbf Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 13 Jan 2011 21:47:22 +0100 Subject: [PATCH] Ignore samples below the depth threshold for calculating statistics. --- src/reefnet_sensusultra_parser.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/reefnet_sensusultra_parser.c b/src/reefnet_sensusultra_parser.c index 1203c4c..4da8ba5 100644 --- a/src/reefnet_sensusultra_parser.c +++ b/src/reefnet_sensusultra_parser.c @@ -180,6 +180,7 @@ reefnet_sensusultra_parser_get_field (parser_t *abstract, parser_field_type_t ty unsigned int size = abstract->size; unsigned int interval = array_uint16_le (data + 8); + unsigned int threshold = array_uint16_le (data + 10); unsigned int maxdepth = 0; unsigned int nsamples = 0; @@ -188,10 +189,11 @@ reefnet_sensusultra_parser_get_field (parser_t *abstract, parser_field_type_t ty memcmp (data + offset, footer, sizeof (footer)) != 0) { unsigned int depth = array_uint16_le (data + offset + 2); - if (depth > maxdepth) - maxdepth = depth; - - nsamples++; + if (depth >= threshold) { + if (depth > maxdepth) + maxdepth = depth; + nsamples++; + } offset += 4; }