Re: Poseidon CCR dives: Nitrogen loading

2014-11-07 Thread Willem Ferguson

On 07/11/2014 12:36, Robert Helling wrote:




So, what shall we do? I would keep the concept of one current cylinder 
(and explicit_first_cylinder determines that lacking previous gas 
change events as above) and in the CCR gas let that be the diluent and 
not O2. This lets deco/ceiling calculations work as for OC (assuming 
fill_pressures is used) as well as the partial pressure graphs. I 
would only change the gas use calculations to use the current cylinder 
as is only for OC and do that differently (now with two gases and 
adopted interpolation rules) for CCR.


What do you think?

Best
Robert


Robert,
Thank you for your thoughts.
You are talking absolute sense. One needs to keep the code with OC as 
the default calculation and add as little as possible to implement CCR. 
Essentially, in CCR mode, for overall management one needs to ignore the 
oxygen cylinder. But this is (ignorantly) opposite to what my frame of 
reference was when I started adapting the code (using cyl 0 as a base 
reference because this is what OC does and, momentarily, ignoring the 
dil cylinder)  So, in many places I have to do a reversal of logic. It 
works OK presently, just the reversal of logic results in cumbersome 
code that I am currently trying to simplify/shorten. I will be spending 
quite some time with it over the weekend.

Kind regards,
willem


___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-07 Thread Paul Sargent

On 7 Nov 2014, at 10:36, Robert Helling  wrote:

> Now, in the CCR case, things are a bit more complicated as there is not _the_ 
> current cylinder, there are two, diluent and oxygen. For the purpose of deco 
> calculation (and anything that is related to what gas is the diver currently 
> breathing), I would still argue that the “current” cylinder should be the 
> diluent as we have to know the diluent for fill_pressures to determine the 
> breathing gas. 

I would say that the notion of the “Current Cylinder” being the diluent works 
well. It’s the only gas that might ever change during a CCR dive. That is, you 
may change diluent, but you’ll never change from O2 to something else. 

Also if you look at the three types of SCUBA equipment that exist from a 
philosophical point of view:
OC Equipment allows you to take a gas, breath it once, and vent it.
SCR Equipment allows you to take a gas, breath it ’n’ times, and vent it.
CCR Equipment allows you to take a gas, breath it a infinite number of times, 
with no venting (in theory)
It’s fairly obvious (to me) that the common element is the breathing gas / 
drive gas / diluent gas, but for some reason we call it different things. The 
difference on SCR / CCR is the mechanisms employed to extend that gas. It just 
so happens that a CCR has an O2 supply to make it work, almost the same way 
that it could have a battery.* It’s a resource you track, and make sure it 
doesn’t run out, but apart from that it’s of little interest. (I’d actually be 
tempted not to have it as part of the normal gas list for this reason. Instead 
have it in it’s own special area.)

I think you’ll find more commonality in the code for different dives types if 
you go this way.

Paul

* Of course, what makes CCR more complex is that we take advantage of the O2 
supply to mix an ideal inspired gas, so that’s no longer constant. If it wasn’t 
for that, gas consumption rate would be the only difference between the 3.___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-07 Thread Robert Helling

On 07.11.2014, at 10:29, Willem Ferguson  
wrote:

Willem,

> 1) Please could you send the mail with the two patches to me privately? I 
> appeared in my email system but was gone two minutes later. It's not in the 
> junk folder. I suspect my finger trouble.
> 

done. You could find those in the mailing list archive as well

http://lists.subsurface-divelog.org/pipermail/subsurface/2014-November/thread.html

> 2) I have the cylinder pressure calculations working correctly as far as I 
> can see. Will do a few cross checks over the week end. Important: I want to 
> confirm with you that changing the return value of explicit_first_cylinder() 
> is the way to go for correct deco calculations. Does the second patch in your 
> last mail affect this at all because I saw some code affecting deco? The 
> over-printed cylinder contents on the left of the profile widget is because 
> of the return value of explicit_first_cylinder(): Subsurface sees that as a 
> cylinder change to cylinder 1  right at the start of the profile, printing 
> the labels for both cylinders 0 and 

Not quite I would say. For the deco calculation you have to know what gas (in 
particular: which cylinder) you are breathing from at the moment. In the data 
from dive computers (as well as in the xml), this is, however, not how that 
data is represented. There you find only the gas change events that tell you 
that the gas changes. The latest gas change of course determines the gas used 
at later times but that possibly does not tell you which is the current gas 
before the first gas change event. For that reason, some dive computers spit 
out a gas change event at the beginning of the dive. Others silently assume, 
that dives always start with gas zero. This is the information that 
explicit_first_cylinder() returns: Which cylinder number is used before the 
first gas change event. It has no effect after the first gas change.

Now, in the CCR case, things are a bit more complicated as there is not _the_ 
current cylinder, there are two, diluent and oxygen. For the purpose of deco 
calculation (and anything that is related to what gas is the diver currently 
breathing), I would still argue that the “current” cylinder should be the 
diluent as we have to know the diluent for fill_pressures to determine the 
breathing gas. 

To compute gas use (and on a related matter: tank pressures) of course both are 
in use but behave very differently: O2 is (to zeroth approximation) used at a 
constant rate irrespective of depth. So you could, if you wanted, interpolate 
values (in effect linearly in time). Diluent is used on descents and use is 
thus complicated so, in a first go, I would not attempt to interpolate it in 
any way.

So, what shall we do? I would keep the concept of one current cylinder (and 
explicit_first_cylinder determines that lacking previous gas change events as 
above) and in the CCR gas let that be the diluent and not O2. This lets 
deco/ceiling calculations work as for OC (assuming fill_pressures is used) as 
well as the partial pressure graphs. I would only change the gas use 
calculations to use the current cylinder as is only for OC and do that 
differently (now with two gases and adopted interpolation rules) for CCR.

What do you think?

Best
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 0C1Dand
DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F






signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Poseidon CCR dives: Nitrogen loading

2014-11-07 Thread Willem Ferguson

Robert,

1) Please could you send the mail with the two patches to me privately? 
I appeared in my email system but was gone two minutes later. It's not 
in the junk folder. I suspect my finger trouble.


2) I have the cylinder pressure calculations working correctly as far as 
I can see. Will do a few cross checks over the week end. Important: I 
want to confirm with you that changing the return value of 
explicit_first_cylinder() is the way to go for correct deco 
calculations. Does the second patch in your last mail affect this at all 
because I saw some code affecting deco? The over-printed cylinder 
contents on the left of the profile widget is because of the return 
value of explicit_first_cylinder(): Subsurface sees that as a cylinder 
change to cylinder 1  right at the start of the profile, printing the 
labels for both cylinders 0 and 1. There are a few smaller issues 
remaining, but this probably needs solving at the GUI level.

Kind regards,
willem



___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Poseidon CCR dives: Nitrogen loading - the solution

2014-11-06 Thread Willem Ferguson



Robert,
I have finally seen the light. I apologise for a swathe of confusing
messages today. I have diagnosed the problem and it should be pretty
easy to fix. What I should have seen in two minutes has taken me several
hours of work.

Your patch causes all references to cylinder 0 to be returned as a
reference to cylinder 1. So, in principle, cylinder 0 cannot be
referenced. The logic that does the cylinder pressure calculations are
critically dependent on being able to reference cylinder 0 because of
the required interpolation structures that must have an index of 0. So,
what happens at the moment is that the oxygen cylinder pressures are
overwritten over the diluent pressures because references to the oxygen
pressures (index 0) are returned as index 1, thus overwriting the data
for cylinder 1. Therefore the end pressures are the same for both oxygen
and diluent cylinders. The diluent series is slightly longer, therefore
the start of the diluent series is not overwritten.

Unless you think that the problem should be solved elsewhere, I will
invert the logic about cylinder numbers within gaspressures.c so that,
when the oxygen pressures is addressed it will create a 'pseudo-cylinder
0' and work with that.

Would this be a suitable solution or would you like to do something else?
Kind regards,
willem



___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading - the solution

2014-11-06 Thread Willem Ferguson

Robert,
I have finally seen the light. I apologise for a swathe of confusing 
messages today. I have diagnosed the problem and it should be pretty 
easy to fix. What I should have seen in two minutes has taken me several 
hours of work.


Your patch causes all references to cylinder 0 to be returned as a 
reference to cylinder 1. So, in principle, cylinder 0 cannot be 
referenced. The logic that does the cylinder pressure calculations are 
critically dependent on being able to reference cylinder 0 because of 
the required interpolation structures that must have an index of 0. So, 
what happens at the moment is that the oxygen cylinder pressures are 
overwritten over the diluent pressures because references to the oxygen 
pressures (index 0) are returned as index 1, thus overwriting the data 
for cylinder 1. Therefore the end pressures are the same for both oxygen 
and diluent cylinders. The diluent series is slightly longer, therefore 
the start of the diluent series is not overwritten.


Unless you think that the problem should be solved elsewhere, I will 
invert the logic about cylinder numbers within gaspressures.c so that, 
when the oxygen pressures is addressed it will create a 'pseudo-cylinder 
0' and work with that.


Would this be a suitable solution or would you like to do something else?
Kind regards,
willem

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-06 Thread Robert Helling

On 05.11.2014, at 17:37, Willem Ferguson  
wrote:

Willem,

> 1) This patch has an unintended consequence: The ending cylinder pressure for 
> the diluent cylinder (as seen on the equipment tab) is changed to reflect 
> that of the ending pressure of the oxygen cylinder. The diluent cylinder 
> index for the Poseidon diluent is the dreaded and infamous 1. We hardcode the 
> cylinder IDs here while reading in the dive log because it is very specific 
> to the Poseidon. In addition, even though these specific two cylinders have 
> already been assigned to enum values of oxygen and diluent respectively, we 
> are in the process of setting up the cylinders, so we cannot already use the 
> functions that use these enum values.
> So:  dive->cylinder[1].sample_end.mbar for this sample dive has a value of 
> 141, that of the oxygen cylinder. The correct ending value for this variable 
> is 137. I have carefully looked around the code around line 600 in file.c but 
> cannot see the cause of this problem. Run the code with and without your 
> patch and see the difference.
> 
> 2) A question just to improve my understanding of the code. If the 
> explicit_first_cylinder() result is diluent, does this mean that the deco 
> requirements are calculated for the gas in the diluent cylinder? In this case 
> the diluent is air, but the displayed ceilings do not (at first sight) appear 
> to be shallower than that for air dives to the quivalent depths. For 
> instance, if I simulate the sample dive as an air dive using the planner, the 
> dive extended to 70 min for sufficient deco. So if the ceilings reflect the 
> pn2 values at the various depths as actually calculated at each point on the 
> profile, why does it matter whether one starts with cylinder 0 or cylinder 1?


after getting a good night of sleep, I am reading this again (several times 
indeed) and I am not sure I understand what you are trying to tell me.

I understand that for a CCR segment there are two cylinders in use 
simultaneously, diluent and O2. For the deco calculation to work, it has to 
know that the diluent is (and figure the actual breathing gas from that and 
ambient pressure and set point). 

The other question is what to plot as a pressure (as in cylinder pressure, not 
partial pressure) graph. Ideally both, but at the moment we don’t do that. So, 
at least for the .txt import it seems we are plotting diluent pressure. Is that 
what you are complaining about?

MY question is: Where does this information (and also the information about the 
O2 cylinder pressure) as a function of time come from? Is that in the .txt/.csv 
as as far as I can see, it is not in the .xml. Or do we only have start and and 
pressures for the cylinders (again they seem to be missing for the xml and I 
don’t know about the others). In that case, for OC, cylinder pressures to be 
plotted get interpolated assuming a constant SAC. But for CCR that (as was 
discussed at length before) does not make sense. For O2 one might try a depth 
independent consumption (leading to a linear plot of O2 cylinder pressure) but 
for diluent it is ascent/descent dependent in a complicated way that we have 
not yet figured out how to model, so at the moment, any interpolation would be 
bogus.

So, what to you expect to see and what are you seeing instead?

Best
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 0C1Dand
DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F






signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Fwd: Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Willem Ferguson



On 05/11/2014 21:26, Robert C. Helling wrote:

My understanding is that at the moment we are not yet plotting two
cylinder pressures (dil and O2) at the same time. It is just that the
O2 gets plotted while you are expecting the dil to be plotted. Am I
right? Note that on the left, where the gas name should be, it reads
(at least at my resolution) AIR100 which is likely the result of first
printing EAN100 and then AIR on top of that. Right now I don't
understand where in the code it is determined which cylinder pressure
is plotted and gas name attached.
Best Robert


 While reviewing dive.c I came across at least one place where the
dive->cylinder data members are copied individually. And since I have
added two new members to cylinder, (the int variables
oxygen_cylinder_index and diluent_cylinder_index), they are of course
not copied. That code will need some careful consideration, although I
do not think it is used now, only when cylinder data are moved or
concatenated. Similarly, while reviewing gaspressures.c, I came across
places where the new enum variables should be used, instead of the
constants that I declared at that time. But since we are working with a
standard system with o2 cyl has index 0 and dil cylinder has index 1, I
cannot see that this could play a role in the present problem. But it
needs attention and soon.
Kind regards,
willem



___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Willem Ferguson

On 05/11/2014 21:26, Robert C. Helling wrote:
My understanding is that at the moment we are not yet plotting two 
cylinder pressures (dil and O2) at the same time. It is just that the 
O2 gets plotted while you are expecting the dil to be plotted. Am I 
right? Note that on the left, where the gas name should be, it reads 
(at least at my resolution) AIR100 which is likely the result of first 
printing EAN100 and then AIR on top of that. Right now I don't 
understand where in the code it is determined which cylinder pressure 
is plotted and gas name attached. 
Best Robert
While reviewing dive.c I came across at least one place where the 
dive->cylinder data members are copied individually. And since I have 
added two new members to cylinder, (the int variables 
oxygen_cylinder_index and diluent_cylinder_index), they are of course 
not copied. That code will need some careful consideration, although I 
do not think it is used now, only when cylinder data are moved or 
concatenated. Similarly, while reviewing gaspressures.c, I came across 
places where the new enum variables should be used, instead of the 
constants that I declared at that time. But since we are working with a 
standard system with o2 cyl has index 0 and dil cylinder has index 1, I 
cannot see that this could play a role in the present problem. But it 
needs attention and soon.

Kind regards,
willem
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading and Qt

2014-11-05 Thread Willem Ferguson

On 05/11/2014 21:26, Robert C. Helling wrote:
My understanding is that at the moment we are not yet plotting two 
cylinder pressures (dil and O2) at the same time. It is just that the 
O2 gets plotted while you are expecting the dil to be plotted. Am I 
right? Note that on the left, where the gas name should be, it reads 
(at least at my resolution) AIR100 which is likely the result of first 
printing EAN100 and then AIR on top of that. Right now I don't 
understand where in the code it is determined which cylinder pressure 
is plotted and gas name attached. 
Best Robert


You are correct. At the moment no UI development has taken place. There 
is only cylinder pressure data plotted for the oxygen cylinder. The 
diluent pressures still need to be added. So no CCR code for plotting 
exists and the UI shows the CCR stuff using the 'normal' OC display 
routines with no adaptation. What I assume is that the following may 
happen (and I have no clue as to where the code may lie that does this 
because that is Qt): The CSV import defines two cylinders, supplying 
full information with gas mix and cylinder pressure data. I suspect that 
both these cylinders are interpreted as in-use and their tags are 
plotted at the extreme left of the profile widget.


As far as oxygen is concerned, it is the po2 that is plotted as it 
always has been. Just, in the case of CCR, it is not computed using gas 
mix and depth, but based on the oxygen sensor data. This plot of po2 
needs no change. Only the sensor and setpoint data need to be added.


I do not think I have helped at all, but I have given you what I know.
Kind regards,
wilem
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Robert C. Helling




> Am 05.11.2014 um 20:14 schrieb Willem Ferguson 
> :
> 
> By this I am not saying that the error is not there, but the problem is not 
> systemic. I am continuing to check there

My understanding is that at the moment we are not yet plotting two cylinder 
pressures (dil and O2) at the same time. It is just that the O2 gets plotted 
while you are expecting the dil to be plotted. Am I right?

Note that on the left, where the gas name should be, it reads (at least at my 
resolution) AIR100 which is likely the result of first printing EAN100 and then 
AIR on top of that. 

Right now I don't understand where in the code it is determined which cylinder 
pressure is plotted and gas name attached. 

Best 
Robert 
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Willem Ferguson

On 05/11/2014 20:55, Robert C. Helling wrote:


On 05 Nov 2014, at 17:37, Willem Ferguson 
> wrote:


Willem,

1) This patch has an unintended consequence: The ending cylinder 
pressure for the diluent cylinder (as seen on the equipment tab) is 
changed to reflect that of the ending pressure of the oxygen 
cylinder. The diluent cylinder index for the Poseidon diluent is the 
dreaded and infamous 1. We hardcode the cylinder IDs here while 
reading in the dive log because it is very specific to the Poseidon. 
In addition, even though these specific two cylinders have already 
been assigned to enum values of oxygen and diluent respectively, we 
are in the process of setting up the cylinders, so we cannot already 
use the functions that use these enum values.
So: dive->cylinder[1].sample_end.mbar for this sample dive has a 
value of 141, that of the oxygen cylinder. The correct ending value 
for this variable is 137. I have carefully looked around the code 
around line 600 in file.c but cannot see the cause of this problem. 
Run the code with and without your patch and see the difference.


my suspicion is that something fishy is going on in gas pressures.c in
populate_pressure_information
and the functions called from there. Right now, I am not able to 
follow the logic with diluent handling there but maybe, since you 
wrote that, you can more easily debug this (figure out when the 
different gases are actually used) than me.


BTW, I think the prototypes should be in header files and not in profile.c

Best
Robert
Thanks for the comment, Robert. There is a debug function in profile.c 
called debug_print_profiledata() that prints out the final results of 
everything to do with cylinder pressures (and o2 partial pressures) and 
the output produced there is correct. The start and end pressures of the 
cylinders are accurate, as they should be. By this I am not saying that 
the error is not there, but the problem is not systemic. I am continuing 
to check there

Kind regards,
willem

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Robert C. Helling

On 05 Nov 2014, at 17:37, Willem Ferguson  
wrote:

Willem,

> 1) This patch has an unintended consequence: The ending cylinder pressure for 
> the diluent cylinder (as seen on the equipment tab) is changed to reflect 
> that of the ending pressure of the oxygen cylinder. The diluent cylinder 
> index for the Poseidon diluent is the dreaded and infamous 1. We hardcode the 
> cylinder IDs here while reading in the dive log because it is very specific 
> to the Poseidon. In addition, even though these specific two cylinders have 
> already been assigned to enum values of oxygen and diluent respectively, we 
> are in the process of setting up the cylinders, so we cannot already use the 
> functions that use these enum values.
> So:  dive->cylinder[1].sample_end.mbar for this sample dive has a value of 
> 141, that of the oxygen cylinder. The correct ending value for this variable 
> is 137. I have carefully looked around the code around line 600 in file.c but 
> cannot see the cause of this problem. Run the code with and without your 
> patch and see the difference.


my suspicion is that something fishy is going on in gas pressures.c in 
populate_pressure_information
and the functions called from there. Right now, I am not able to follow the 
logic with diluent handling there but maybe, since you wrote that, you can more 
easily debug this (figure out when the different gases are actually used) than 
me.

BTW, I think the prototypes should be in header files and not in profile.c

Best
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
print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339   
stupid .sig\n";   http://www.atdotde.de 



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Dirk Hohndel
On Wed, Nov 05, 2014 at 06:34:38PM +0100, Robert C. Helling wrote:
> 
> On 05 Nov 2014, at 17:37, Willem Ferguson  
> wrote:
> 
> Willem,
> 
> > 1) This patch has an unintended consequence: The ending cylinder pressure 
> > for the diluent cylinder (as seen on the equipment tab) is changed to 
> > reflect that of the ending pressure of the oxygen cylinder. The diluent 
> > cylinder index for the Poseidon diluent is the dreaded and infamous 1. We 
> > hardcode the cylinder IDs here while reading in the dive log because it is 
> > very specific to the Poseidon. In addition, even though these specific two 
> > cylinders have already been assigned to enum values of oxygen and diluent 
> > respectively, we are in the process of setting up the cylinders, so we 
> > cannot already use the functions that use these enum values.
> > So:  dive->cylinder[1].sample_end.mbar for this sample dive has a value of 
> > 141, that of the oxygen cylinder. The correct ending value for this 
> > variable is 137. I have carefully looked around the code around line 600 in 
> > file.c but cannot see the cause of this problem. Run the code with and 
> > without your patch and see the difference.
> > 
> 
> This is weird. For some reason the pressures for the O2 cylinder are shown 
> even when the gas name is “Air”. Have to investigate this further.

The code that handles "what's the current gas" is rather dumb. I wouldn't
be surprised if there were assumptions somewhere that whatever gas you
have the sensor pressure for is also the gas that you are breathing.
That's the first place I would look.

> > 2) A question just to improve my understanding of the code. If the 
> > explicit_first_cylinder() result is diluent, does this mean that the deco 
> > requirements are calculated for the gas in the diluent cylinder? In this 
> > case the diluent is air, but the displayed ceilings do not (at first sight) 
> > appear to be shallower than that for air dives to the quivalent depths. For 
> > instance, if I simulate the sample dive as an air dive using the planner, 
> > the dive extended to 70 min for sufficient deco. So if the ceilings reflect 
> > the pn2 values at the various depths as actually calculated at each point 
> > on the profile, why does it matter whether one starts with cylinder 0 or 
> > cylinder 1?
> 
> 
> It means that air is handed to fill_pressures as gasmix (for which then the 
> inert gas pressures are adopted according to the set point). So it should do 
> the correct thing. If you gave it O2 then the gas output would always be pure 
> O2 (and thus no deco obligation).

No deco obligation and one heck of a CNS/OTU value I'd guess :-)

/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Robert C. Helling

On 05 Nov 2014, at 17:37, Willem Ferguson  
wrote:

Willem,

> 1) This patch has an unintended consequence: The ending cylinder pressure for 
> the diluent cylinder (as seen on the equipment tab) is changed to reflect 
> that of the ending pressure of the oxygen cylinder. The diluent cylinder 
> index for the Poseidon diluent is the dreaded and infamous 1. We hardcode the 
> cylinder IDs here while reading in the dive log because it is very specific 
> to the Poseidon. In addition, even though these specific two cylinders have 
> already been assigned to enum values of oxygen and diluent respectively, we 
> are in the process of setting up the cylinders, so we cannot already use the 
> functions that use these enum values.
> So:  dive->cylinder[1].sample_end.mbar for this sample dive has a value of 
> 141, that of the oxygen cylinder. The correct ending value for this variable 
> is 137. I have carefully looked around the code around line 600 in file.c but 
> cannot see the cause of this problem. Run the code with and without your 
> patch and see the difference.
> 

This is weird. For some reason the pressures for the O2 cylinder are shown even 
when the gas name is “Air”. Have to investigate this further.

> 2) A question just to improve my understanding of the code. If the 
> explicit_first_cylinder() result is diluent, does this mean that the deco 
> requirements are calculated for the gas in the diluent cylinder? In this case 
> the diluent is air, but the displayed ceilings do not (at first sight) appear 
> to be shallower than that for air dives to the quivalent depths. For 
> instance, if I simulate the sample dive as an air dive using the planner, the 
> dive extended to 70 min for sufficient deco. So if the ceilings reflect the 
> pn2 values at the various depths as actually calculated at each point on the 
> profile, why does it matter whether one starts with cylinder 0 or cylinder 1?


It means that air is handed to fill_pressures as gasmix (for which then the 
inert gas pressures are adopted according to the set point). So it should do 
the correct thing. If you gave it O2 then the gas output would always be pure 
O2 (and thus no deco obligation).

Best
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
print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339   
stupid .sig\n";   http://www.atdotde.de 



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Willem Ferguson

On 05/11/2014 16:01, Robert Helling wrote:


On 05.11.2014, at 08:02, Willem Ferguson 
> wrote:


Willem,

Would you be prepared to look at the sample dive log in the dives 
directory? There are two versions of the same dive, one in CSV, 
another in XML. When importing the CSV version, NO nitrogen loading 
is shown, however when loading the XML version, nitrogen loading is 
indeed shown. Are you in a position at all to say what causes this?


Some debugging shows the ceiling calculation was thinking you were 
diving pure O2 though out the dive as that is what is contained in 
cylinder 0 which is the default starting cylinder. Here is a patch 
that makes the diluent cylinder the default starting cylinder instead.


Best
Robert

Robert, thank you. This really helps. I love it that you use the code 
that makes use of enums!


1) This patch has an unintended consequence: The ending cylinder 
pressure for the diluent cylinder (as seen on the equipment tab) is 
changed to reflect that of the ending pressure of the oxygen cylinder. 
The diluent cylinder index for the Poseidon diluent is the dreaded and 
infamous 1. We hardcode the cylinder IDs here while reading in the dive 
log because it is very specific to the Poseidon. In addition, even 
though these specific two cylinders have already been assigned to enum 
values of oxygen and diluent respectively, we are in the process of 
setting up the cylinders, so we cannot already use the functions that 
use these enum values.
So:  dive->cylinder[1].sample_end.mbar for this sample dive has a value 
of 141, that of the oxygen cylinder. The correct ending value for this 
variable is 137. I have carefully looked around the code around line 600 
in file.c but cannot see the cause of this problem. Run the code with 
and without your patch and see the difference.


2) A question just to improve my understanding of the code. If the 
explicit_first_cylinder() result is diluent, does this mean that the 
deco requirements are calculated for the gas in the diluent cylinder? In 
this case the diluent is air, but the displayed ceilings do not (at 
first sight) appear to be shallower than that for air dives to the 
quivalent depths. For instance, if I simulate the sample dive as an air 
dive using the planner, the dive extended to 70 min for sufficient deco. 
So if the ceilings reflect the pn2 values at the various depths as 
actually calculated at each point on the profile, why does it matter 
whether one starts with cylinder 0 or cylinder 1?


Thank you so much for your time.
Willem
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Robert Helling
On 05.11.2014, at 08:02, Willem Ferguson  wrote:Willem,Would you be prepared to look at the sample dive log in the dives directory? There are two versions of the same dive, one in CSV, another in XML. When importing the CSV version, NO nitrogen loading is shown, however when loading the XML version, nitrogen loading is indeed shown. Are you in a position at all to say what causes this?Some debugging shows the ceiling calculation was thinking you were diving pure O2 though out the dive as that is what is contained in cylinder 0 which is the default starting cylinder. Here is a patch that makes the diluent cylinder the default starting cylinder instead.BestRobert

0001-Start-CCR-dives-using-diluent-if-in-doubt.patch
Description: Binary data

-- .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oORobert 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.deEnhance your privacy, use cryptography! My PGP keys have fingerprintsA9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    andDCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-05 Thread Miika Turkia
On Wed, Nov 5, 2014 at 3:44 PM, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

>  On 05/11/2014 09:11, Miika Turkia wrote:
>
>  On Wed, Nov 5, 2014 at 3:02 PM, Willem Ferguson <
> willemfergu...@zoology.up.ac.za> wrote:
>
>> Robert,
>> Would you be prepared to look at the sample dive log in the dives
>> directory? There are two versions of the same dive, one in CSV, another in
>> XML. When importing the CSV version, NO nitrogen loading is shown, however
>> when loading the XML version, nitrogen loading is indeed shown. Are you in
>> a position at all to say what causes this?
>>
>
>  Isn't nitrogen loading toggled with the N2 button? If so, I do see the
> nitrogen loading when importing the CSV (of course, I need to actually
> select the .txt file for import, to get the Poseidon parsing triggered).
>
>  miika
>
> The N2 button toggles display of the nitrogen partial pressure. But it
> does not toggle the display of the ceiling and tissue compartment loading
> (this is controlled by another button on the dive profile panel, the one
> with the diver and the up-arrow). If the gradient factors are shown above
> the profile, then it means that display of the calculation of nitrogen
> loading at the tissue compartment level is switched on. On my machine, the
> NDL remains at the maximum level (120 min) throughout the dive, no ceiling
> appears and Robert's tissue loading display (at the bottom of the panel and
> in the information box) shows NO tissue loading at all. Yet, the XML dive
> log shows strong tissue loading and looks much more realistic to me. I
> suspect it is just a variable that needs to be set somewhere, but I am
> clueless.
>

Of course.. I have that always enabled on my normal computer, so I had no
idea it was turned off on this one.

Anyway, when I load the Poseidon XML, save it and load the new file, I get
different nitrogen loading. Some information is clearly lost on this
scenario, and at least the setpoint value seems to be missing from the new
file when saved from Subsurface. The O2 graph seems to be quite different
on different import / load files.

miika
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-04 Thread Willem Ferguson

On 05/11/2014 09:11, Miika Turkia wrote:
On Wed, Nov 5, 2014 at 3:02 PM, Willem Ferguson 
> wrote:


Robert,
Would you be prepared to look at the sample dive log in the dives
directory? There are two versions of the same dive, one in CSV,
another in XML. When importing the CSV version, NO nitrogen
loading is shown, however when loading the XML version, nitrogen
loading is indeed shown. Are you in a position at all to say what
causes this?


Isn't nitrogen loading toggled with the N_2 button? If so, I do see 
the nitrogen loading when importing the CSV (of course, I need to 
actually select the .txt file for import, to get the Poseidon parsing 
triggered).


miika
The N2 button toggles display of the nitrogen partial pressure. But it 
does not toggle the display of the ceiling and tissue compartment 
loading (this is controlled by another button on the dive profile panel, 
the one with the diver and the up-arrow). If the gradient factors are 
shown above the profile, then it means that display of the calculation 
of nitrogen loading at the tissue compartment level is switched on. On 
my machine, the NDL remains at the maximum level (120 min) throughout 
the dive, no ceiling appears and Robert's tissue loading display (at the 
bottom of the panel and in the information box) shows NO tissue loading 
at all. Yet, the XML dive log shows strong tissue loading and looks much 
more realistic to me. I suspect it is just a variable that needs to be 
set somewhere, but I am clueless.

Kind regards,
willem

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Poseidon CCR dives: Nitrogen loading

2014-11-04 Thread Miika Turkia
On Wed, Nov 5, 2014 at 3:02 PM, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

> Robert,
> Would you be prepared to look at the sample dive log in the dives
> directory? There are two versions of the same dive, one in CSV, another in
> XML. When importing the CSV version, NO nitrogen loading is shown, however
> when loading the XML version, nitrogen loading is indeed shown. Are you in
> a position at all to say what causes this?
>

Isn't nitrogen loading toggled with the N2 button? If so, I do see the
nitrogen loading when importing the CSV (of course, I need to actually
select the .txt file for import, to get the Poseidon parsing triggered).

miika
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Poseidon CCR dives: Nitrogen loading

2014-11-04 Thread Willem Ferguson

Robert,
Would you be prepared to look at the sample dive log in the dives 
directory? There are two versions of the same dive, one in CSV, another 
in XML. When importing the CSV version, NO nitrogen loading is shown, 
however when loading the XML version, nitrogen loading is indeed shown. 
Are you in a position at all to say what causes this?

Kind regards,
willem

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface