Fwd: sample UDDF file

Linus Torvalds torvalds at linux-foundation.org
Thu Feb 28 21:43:01 PST 2013


On Thu, Feb 28, 2013 at 9:05 PM, Miika Turkia <miika.turkia at gmail.com> wrote:
>
> Dirk: can you shed a bit of light into the format Subsurface is
> expecting for closed circuit? I did not spot any test dives that would
> have revealed the expected format for po2.

It is normally just be a fraction like "0.70" or whatever. Technically
it *is* a pressure, and could (should?) be expressed in bar, but it
seems seldom done.

So most of the time it *seems* to be used as a unitless "fraction of
atmospheric pressure". Of course, with one bar being pretty darn close
to one atm, it's not always clear whether people generally really
express in bars or in atmospheres.

However, quoting another email of yours, sometimes it's pretty darn obvious:

      <measuredpo2 ref="o2sensor_1">0.98e5</measuredpo2>
      <measuredpo2 ref="o2sensor_2">1.01e5</measuredpo2>
      <measuredpo2 ref="o2sensor_3">1.12e5</measuredpo2>

0.98e5 is definitely *not* a "fraction of atmospheres" or bars. It is
clearly pascals. So I think this is one of those things where when we
parse things, we have to look at the numeric value. If in bars/atms,
the values for pO2 will be in the 0.1 - 2.0 kind of range (and that's
being pretty extreme, CC normally tends to fix it at some very
reasonable value), while in pascal it would thus be five orders of
magnitude bigger.

Btw, looking at subsurface, we are very definitely doing things wrong
when saving. Dirk, this is yours - and your saving of po2 values is
*horribly* broken. You do this:

   fprintf(f, " po2='%u.%2u bar'", FRACTION(sample->po2, 1000));

which is crap, and results in "0. 0 bar" for a value of zero - which
would still just happen to parse right. But for a value of "1.080" it
would print it out as "1.80", so it can be catastropically off.

The numbers should be printed out as "%u.%03u".

                  Linus


More information about the subsurface mailing list