[PATCH] Correct bug: setpoint handling of Poseidon CCR dive logs
willemferguson at zoology.up.ac.za
Thu Oct 30 23:30:14 PDT 2014
On 30/10/2014 19:32, Dirk Hohndel wrote:
> much of this is code that you wrote (the original "when do we zero thing,
> when don't we"). I clearly mis-remembered some of this. Would you chime in
> to get to the right resolution here, please?
> On Thu, Oct 30, 2014 at 08:29:18AM +0200, Willem Ferguson wrote:
>> Ok, so here is how I understand the code as it is at present. It all happens
>> fixup_dive_dc() in dive.c and in fill_o2_values in profile.c.
>> While a particular cylinder is being used (i.e. while the index of the
>> cylinder *remains the same*), the duplicate gas pressure values are zeroed
>> out. This is pre-existing code, i.e it was there before any CCR code was
>> developed. I only added the zeroing out for diluent gas pressures as well.
>> [~line 1138 in dive.c].
> Towards a plan of action:
> My suggestion is that we do not touch the pressure values in
> fixup_dive_dc but that we remove code that zeroes the oxygen-related
> values. Similarly, fill_o2_values() in profile.c is reduced to a loop that
> steps through the structures of plotdata, which corrects zero values (that
> might have originated either from the insertion of events along the dive
> profile or from glitches in the logging or download process) and which
> triggers po2 calculation for each structure of plotdata (i.e. each point on
> the dive profile).
> That sounds sane.
>> I am not sure what to do about the zeroing and re-instatement of temperature
>> data but if we were consistent, the zeroing of temperature data should also
>> be removed.
> Why? Can you explain why the tank pressure handling would stay, but the
> temperature handling would change?
Following the discussion on this topic, can we safely conclude that the
gas pressure data are zeroed so that the interpolation algorithm can
produce a much smoother graph of gas pressures and therefore should not
be altered? This is because few DCs record gas pressure with each
record. I must admit that my own hesitance to mess with the pressures is
because the interpolation is done by five functions [starting with
populate_pressure_information()] that work as a fairly tight unit and
messing with any one will probably affect the whole overall process.
For this reason neither the temperature data nor the oxygen-related data
need to be zeroed since the resolution of all these variables is more
than sufficient and is highly unlikely to cause a blocky type of graph
on the profile as long as these variable are logged fairly regularly.
With the present code there is no possibility of interpolation of these
data anyway. As an aside, temperature data from my Uwatec dive computer
is blocky but this is because of the lack of temperature resolution of
the DC. My Mares DC has better temperature resolution and a smooth
Therefore, would it be sensible if I removed the zeroing out of
oxygen-related and temperature data, more or less as described in the
plan of action above?
More information about the subsurface