interpolating depth values

Linus Torvalds torvalds at linux-foundation.org
Sun Sep 24 16:36:54 PDT 2017


On Sat, Sep 23, 2017 at 9:26 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> We have an interesting issue that I think may have been introduced by
> commit 2b1017c986bf ("Interpolate depth for samples that have no depth").
> It appears that this ends up throwing away data from dive computers that
> for whatever reason recorded negative depth value.

Honestly, I think pretty much all of that bug report is just bogus.

The old data was garbage.  We've never *ever* saved things in some
exact format, and we've always changed it to our own formats (and
we've changed other things too as we change how we track things). The
user just happened to notice now for one specific case.

Since when is a depth of "-0.2m" interesting data? It's shit. I
guarantee that it doesn't even actually mean "20 cm above sea level",
because that is simply not how dive computers even WORK. There is no
"depth sensor" that can sense distance from the surface, it's a
pressure sensor that senses difference to atmospheric pressure, and
that "-0.2m" means either

 (a) the pressure sensor is simply not stable (most likely one by far)

 (b) atmospheric pressure changed while diving, because a storm was
approaching (20cm of water pressure is something like 20mbar, so let's
say you hit a low pressure of about 993 millibar - you're diving in
the middle of a tropical storm or maybe a cat 1 hurricane)

 (c) the dive computer was asleep until water contacts woke it up, and
set the "surface pressure" to whatever pressure it was when it
actually submerged, but by that time it was already a fair amount
under water.

 (d) the user actually ascended ~170 meters, which is about equivalent
to 20cm of water pressure change.

and honestly, in absolutely _none_ of those cases is -0.20m an
interesting depth value.

There are a ton of other cases where we throw out invalid data too.
The fact that we randomly maybe didn't in this particular case in some
older version is entirely irrelevant.

If the user wants to save the raw divecomputer data, he should just do
so. That's not what subsurface is about.

The only real bug in that discussion seems to be the incorrect merging
of dives. THAT we should definitely fix. But since I don't see the
actual original dive data, I can't really see what's up.

                       Linus


More information about the subsurface mailing list