[PATCH] Profile VPM-B ceiling: ignore negative deco time

Robert Helling helling at atdotde.de
Thu Apr 7 06:18:41 PDT 2016


Rick,

> On 07.04.2016, at 10:37, Rick Walsh <rickmwalsh at gmail.com> wrote:
> 
> The variable deco_time is used for the CVA iterations to calculate the VPM-B
> ceiling. Only positive values should be allowed, otherwise we can get some odd
> results in a few cases, such as ceilings being calculated when they shouldn't.


I think your analysis was only partially correct. Indeed the problem occurred when the deco time got negative.

But looking at the code, this should not happen (it would be negative if the deepest ceiling occurred after the ceiling had cleared). So your patch does not address the actual problem, only the symptom.

As I understand it, the rounding of ceilings to multiples of 3m is really to blame: In the if clause to find the deepest ceiling, there was a >= in the ceiling comparison. So “deepest” was also found when the ceiling was constant at 0m, which made time_deep_ceiling the end of the dive.

Changing that >= to > does not solve the problem either since that is far too early (in the xml provided, the first time there was any non-zero ceiling as that was rounded to 3m). The way out is really to take the ceiling without rounding to multiples of 3m. This si what this patch does (unfortunately, it also fixes whitespace damage).



Could you please look at this patch and confirm or dispute my solution?

Thanks
Robert

--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics
                      Scientific Coordinator
                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik
                      Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
                      http://www.atdotde.de

Enhance your privacy, use cryptography! My PGP keys have fingerprints
A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    and
DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160407/6646826e/attachment-0002.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Fix-time-of-first-ceiling-calculation.txt
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160407/6646826e/attachment-0001.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160407/6646826e/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160407/6646826e/attachment-0001.sig>


More information about the subsurface mailing list