[CCR PATCH] Calculate appropriate po2 values
Willem Ferguson
willemferguson at zoology.up.ac.za
Fri Jun 20 09:44:28 PDT 2014
Calculate appropriate O2 partial pressures for CCR dives
Files affected: profile.h, profile.c
This patch ensures an appropriate representation of oxygen partial
pressures
for CCR equipment with one or more oxygen partial pressure sensors.
The
calculated po2 is stored in the po2 variable of the plot_data
structure. The
following changes were made:
1) In profile.h adapt plot_data with variables to accommodate the
partial
pressure values by creating fo2, o2sensor[3] and o2setpoint.
2) In profile.c change function calculate_gas_information_new:
a) Add a dc parameter in the function call.
b) Perform PO2 calculations using the following rules:
For 2 PO2 sensors, calculate the mean of the two and store in
po2.
For 3 sensors: diff_limit is the critical limit indicating
large sensor
difference (default = 100 mbar)
a) If all three readings are within a range of diff_limit,
then take the
mean value. This includes the case where reading 1 is within
diff_limit of reading 2; and reading 2 is within diff_limit of
reading 3, but readings 1 and 3 differ by more than
diff_limit.
b) If one sensor differs by more than diff-limit from the
other two,
then take the mean if the closer two sensors and disregard
the 3rd
sensor, considered as an outlier.
c) If all 3 sensors differ by more than diff_limit then take
the mean
of the 3 readings.
Signed-off-by: Willem Ferguson <willemferguson at zoology.up.ac.za>
In terms of C code files this patch is independent of the previous CCR patch
(dealing with xml and git I/O) since this one only affects profile.c and
profile.h
which were not involved in the previous patch.
However, in execution it is dependent on the initialisation if the dive data
structure (o2 sensor data) which is done in that patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Calculate-appropriate-O2-partial-pressures-for-CCR-d.patch
Type: text/x-patch
Size: 7738 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140620/a9cc1614/attachment.bin>
More information about the subsurface
mailing list