On 09/11/2014 11:43, Robert C. Helling wrote:

I have to admit, I don’t really understand what you are trying to do here. I 
assume you want to compute the current (i.e. possibly interpolated pressure(s) 
for a given point in the plot, i.e. for plot_info *entry. Is that indeed the 
case?
Communication is a real problem here. Yes, last sentence above, you are correct.

I must say, what I would do is:

1) If entry->o2setpoint == 0 , i.e. this is an OC/bailout segment do the stuff 
we used to do.

2) Otherwise we are in CCR mode. Then we have two cylinders in use, 
entry->cylinderindex which hopefully is the diluent. This we don’t interpolate, 
we use the last measured value.
No. Wrong with respect to what happens at present, because the default interpolation approach is OC which is time-pressure based.

I think we need to separate the present time-pressure implementation from what one would like. Again coms is difficult. Since we have diluent pressures at 1 bar intervals we start off with good information that is MUCH better than just using the last measured value. But between diluent pressure readings are other points over which need to be interpolated. Without interpolation, the diluent pressure graph would be blocky or angular. Why would we not interpolate the pressures of the diluent cylinder? I think I am not understanding you. I attach a graph of the gas pressures for the sample data file in the dives directory. A way to remove the worst of the angularity in that graph would really help since I am not convinced that this was the true pattern. Measurement error also plays a role.

  In addition there is the oxygen cylinder get_cylinder_use(dive, oxygen). For 
that we do an interpolation as in the OC case but with the difference that we 
only interpolate with time (not with pressure_time or alternatively for the 
depth use the surface).
Yes, I would agree. But I would think one would also do linear interpolation for the diluent??


If you want, I can try to produce a patch that implements this in real (rather 
than pseudo-) code.

What you sent is obviously missing parts so I am not sure what you are aiming 
at.

But looking at code like

                        switch 
(dive->cylinder[entry->cylinderindex].cylinder_use) {
                        case oxygen :
                                cylinderindex = get_cylinder_use(dive, oxygen);
                                break;
                        case diluent :
                                cylinderindex = get_cylinder_use(dive, diluent);
                                break;
                        case bailout :
                                cylinderindex = entry->cylinderindex;
                                break;
                        default ;
                        }

it seems to me that this is tautological: Let me translate my interoperation of 
that code into words:

Look at the cylinder_use of the cylinder with index entry->cylinder index.
If it is oxygen, cylinderindex should be the index of the cylinder whose 
cylinder_use is oxygen [why wouldn’t that be entry->cylinderindex ?]
If it is diluent cylinderindex should be the cylinder whose cylinder_use is 
diluent [again that wouldn’t necessarily be entry->cylinderindex only if there 
are several diluents]
Otherwise cylinderindex should be entry->cylinderindex.

So in total they only possibility that after that code block cylinderindex != 
entry->cylinderindex would be the weird case that there are several diluents 
and even then I am not sure that the result then is what you want.


As far as the present implementation is concerned, I suspect it would be fairly easy (not simple) to to changes. We just need to agree on the principle of interpolation for the diluent.

Robert you are way ahead of me so therefore your comment is important.
Kind regards,
willem

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to