Change water type

2018-04-14 Thread tormento
I noticed that some of my old dives were imported with 1000g/l water.

Is there any way to edit, manually or automatically the salinity of those
ones?
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Change water type

2018-04-14 Thread Robert Helling
Hi,

> On 14. Apr 2018, at 11:36, tormento  wrote:
> 
> I noticed that some of my old dives were imported with 1000g/l water.
> 
> Is there any way to edit, manually or automatically the salinity of those 
> ones?

it’s true that currently you cannot change the water type (was: salinity) of a 
dive downloaded from a computer, you can only use the value provided by the 
computer. This is a) because nobody has implemented a user interface to change 
it and b) (more importantly) because the water type is not so much about how 
salty the water tasted but how to convert ambient pressure (which is what the 
dive computer actually measures) to depths and back. But what the computer 
reports is depth and for the calculations (like SAC and the deco stuff) we 
again need the ambient pressure. So this is off if the dive computer and 
Subsurface do not agree on the conversion factor. So even if you were diving is 
sea water and your dive computer was set to fresh water (or missing that 
setting not set at all) it would still be better to log this as fresh water in 
Subsurface (to get the conversions right) than to manually set that to salt 
water (or we would have to correct the depths accordingly).

Best
Robert


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


Re: Change water type

2018-04-14 Thread tormento
Yes, I know very well the relation about salinity (density) and pressure
(depth). There is a delta between 2% and 3%. As a matter of fact is
pressure (even apparent one) to rule Henry’s Law and depth is only
determined by salinity.

Anyway some diving systems are really strict about max depth more than max
pressure :)

A way to fix salinity would be welcome, even hex editing configuration file.

Il giorno sab 14 apr 2018 alle 13:40 Robert Helling  ha
scritto:

> Hi,
>
>
> On 14. Apr 2018, at 11:36, tormento  wrote:
>
> I noticed that some of my old dives were imported with 1000g/l water.
>
> Is there any way to edit, manually or automatically the salinity of those
> ones?
>
>
> it’s true that currently you cannot change the water type (was: salinity)
> of a dive downloaded from a computer, you can only use the value provided
> by the computer. This is a) because nobody has implemented a user interface
> to change it and b) (more importantly) because the water type is not so
> much about how salty the water tasted but how to convert ambient pressure
> (which is what the dive computer actually measures) to depths and back. But
> what the computer reports is depth and for the calculations (like SAC and
> the deco stuff) we again need the ambient pressure. So this is off if the
> dive computer and Subsurface do not agree on the conversion factor. So even
> if you were diving is sea water and your dive computer was set to fresh
> water (or missing that setting not set at all) it would still be better to
> log this as fresh water in Subsurface (to get the conversions right) than
> to manually set that to salt water (or we would have to correct the depths
> accordingly).
>
> Best
> Robert
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Change water type

2018-04-14 Thread Salvador Cuñat
Good afternoon.

On Sat, Apr 14, 2018 at 12:09:38PM +, tormento wrote:
> 
> A way to fix salinity would be welcome, even hex editing configuration file.
> 

I don't think there is a direct or easy way to change random values on a cloud
stored divelog.

A workaround for it could be  (on desktop subsurface):

1.- Sync with cloud.
2.- Save the log to a local .xml or .ssrf file
3.- Edit the values:
a.- manually with your preferred editor
b.- on linux a sed command would do the job
4.- Open the modified file in subsurface
5.- Double or triple check the changes
6.- Select "Save to cloud storage"

This should do the trick.  As a bonus you will have a local backup
file which can be useful if anything goes wild in the future.

Best regards.

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


Re: Change water type

2018-04-15 Thread tormento
Good idea, that's what I did. I discovery, with some disappointment, that
the file saves depths and not pressures, giving head scratching about real
influence of set salinity to program and calculations.

Henry's Law is based on (partial) pressures and not depths. I dunno how
diving computer talks to subsurface. If giving depths instead of pressures
it would be a pity.

A pressure is a direct measurement and can be post diving corrected with
salinity to correct depth, even when the computer was wrongly set.

In the saved file I saw a salinity of 1025 g/l and it's ok for oceanic
water but completely wrong for closed seas and tropical ones (1033-1044
g/l).

If possibile I suggest programmers to introduce interface to set standard
salinity AND the possibility to modify single dive ones and to clarify if
it has some impact to calculus of real depth and pressure.

Moreover, if the diving computer gives you both pressure and depth, for
god's sake, get pressure values and THEN convert to depth.

In a second moment we should talk about apparent depth on mountain
divings...

2018-04-14 14:55 GMT+02:00 Salvador Cuñat :

> Good afternoon.
>
> On Sat, Apr 14, 2018 at 12:09:38PM +, tormento wrote:
> >
> > A way to fix salinity would be welcome, even hex editing configuration
> file.
> >
>
> I don't think there is a direct or easy way to change random values on a
> cloud
> stored divelog.
>
> A workaround for it could be  (on desktop subsurface):
>
> 1.- Sync with cloud.
> 2.- Save the log to a local .xml or .ssrf file
> 3.- Edit the values:
> a.- manually with your preferred editor
> b.- on linux a sed command would do the job
> 4.- Open the modified file in subsurface
> 5.- Double or triple check the changes
> 6.- Select "Save to cloud storage"
>
> This should do the trick.  As a bonus you will have a local backup
> file which can be useful if anything goes wild in the future.
>
> Best regards.
>
> Salva
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Change water type

2018-04-15 Thread Linus Torvalds
On Sun, Apr 15, 2018 at 12:07 AM, tormento  wrote:
>
> Henry's Law is based on (partial) pressures and not depths. I dunno how
> diving computer talks to subsurface. If giving depths instead of pressures
> it would be a pity.

Almost all dive computers only give depth.

Some give salinity, some don't. And some only give the flag (sweet vs
salt) rather than the salinity value they actually use to calculate
depth.

In other words: do not EVER play games with salinity. You don't know
what it was, and you will get it wrong.

The whole notion of "user should set salinity" is broken garbage. A
dive computer shouldn't even have that setting. Because that setting
cannot possibly matter, because the only thing that matters - and the
only thing the dive computer measures - is actual pressure, and all
you can do with salinity is make a "correction" to the depth
calculation that you can get wrong.

So in my not-so-humble opinion, a dive computer should always just
show depth as "salt water equivalent depth", with no way to screw up,
and no complications. If you dive in a lake, you'll get the depth
wrong by a few percent, but nobody cares since it's not a really
meaningful value anyway, it's just a user-friendly approximation for
the value that matters: pressure.

Giving the users just the absolute ambient water pressure migth be
*technically* the right thing to do, but it's such a user-hostile
datapoint that it's completely wrongheaded. It only moves the
possibility for error into another place (ie the UI during diving, or
the UI during later logging).

So what you should do is:

 - set your dive computer to salt water (if it has a setting), and
forget about it. Don't ever touch the setting, all it can do is cause
confusion.

 - think of "depth" as "equivalent depth in salt water" and be happy

 - mark your lake dives as such in the dive log tags if you care, the
same way you mark boat dives and buddy names.

The sweet-vs-salt water thing has absolutely zero meaning outside of
informing yourself, and has exactly the same relevance as the name of
your dive buddy: nice to know, but not relevant for any other meaning.
Don't give it any relevance that will only confuse you and get things
wrong.

Because anything else is just a disaster waiting to happen. You *will*
get it wrong, and you will only confuse yourself. Trying to correct
things later is just going to make things worse.

Linus

PS. Yes, there are dive computers that don't report depth at all, and
report the actual hydrostatic pressure that their sensor gives. Before
you say "that's what everybody should do", let me just say that (a)
they are a tiny minority and (b) even they aren't consistent (ie is it
absolute pressure, or relative to surface pressure?)

So subsurface logs what the vast majority of dive computers give you:
depth. In fact, we don't even see the pressure, because the conversion
will have been done by libdivecomputer. So as far as we're concerned,
no dive computer gives us pressure, but technically you can get the
water pressure from the Atomic Aquatics Cobatl, from the
Heinrichs-Weicamp OSTC and from the Reefnet Sensus Ultra. (That last
one isn't actually a dive computer, it's just a data logging device.
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Change water type

2018-04-15 Thread tormento
Awesome explanation and great diving computer knowledge, thanks!

I asked as I have interest in physiology and I do my best to know how
things work under the water and inside body.

Your reasons are more than good for the average user.

Il giorno dom 15 apr 2018 alle 20:55 Linus Torvalds <
torva...@linux-foundation.org> ha scritto:

> On Sun, Apr 15, 2018 at 12:07 AM, tormento  wrote:
> >
> > Henry's Law is based on (partial) pressures and not depths. I dunno how
> > diving computer talks to subsurface. If giving depths instead of
> pressures
> > it would be a pity.
>
> Almost all dive computers only give depth.
>
> Some give salinity, some don't. And some only give the flag (sweet vs
> salt) rather than the salinity value they actually use to calculate
> depth.
>
> In other words: do not EVER play games with salinity. You don't know
> what it was, and you will get it wrong.
>
> The whole notion of "user should set salinity" is broken garbage. A
> dive computer shouldn't even have that setting. Because that setting
> cannot possibly matter, because the only thing that matters - and the
> only thing the dive computer measures - is actual pressure, and all
> you can do with salinity is make a "correction" to the depth
> calculation that you can get wrong.
>
> So in my not-so-humble opinion, a dive computer should always just
> show depth as "salt water equivalent depth", with no way to screw up,
> and no complications. If you dive in a lake, you'll get the depth
> wrong by a few percent, but nobody cares since it's not a really
> meaningful value anyway, it's just a user-friendly approximation for
> the value that matters: pressure.
>
> Giving the users just the absolute ambient water pressure migth be
> *technically* the right thing to do, but it's such a user-hostile
> datapoint that it's completely wrongheaded. It only moves the
> possibility for error into another place (ie the UI during diving, or
> the UI during later logging).
>
> So what you should do is:
>
>  - set your dive computer to salt water (if it has a setting), and
> forget about it. Don't ever touch the setting, all it can do is cause
> confusion.
>
>  - think of "depth" as "equivalent depth in salt water" and be happy
>
>  - mark your lake dives as such in the dive log tags if you care, the
> same way you mark boat dives and buddy names.
>
> The sweet-vs-salt water thing has absolutely zero meaning outside of
> informing yourself, and has exactly the same relevance as the name of
> your dive buddy: nice to know, but not relevant for any other meaning.
> Don't give it any relevance that will only confuse you and get things
> wrong.
>
> Because anything else is just a disaster waiting to happen. You *will*
> get it wrong, and you will only confuse yourself. Trying to correct
> things later is just going to make things worse.
>
> Linus
>
> PS. Yes, there are dive computers that don't report depth at all, and
> report the actual hydrostatic pressure that their sensor gives. Before
> you say "that's what everybody should do", let me just say that (a)
> they are a tiny minority and (b) even they aren't consistent (ie is it
> absolute pressure, or relative to surface pressure?)
>
> So subsurface logs what the vast majority of dive computers give you:
> depth. In fact, we don't even see the pressure, because the conversion
> will have been done by libdivecomputer. So as far as we're concerned,
> no dive computer gives us pressure, but technically you can get the
> water pressure from the Atomic Aquatics Cobatl, from the
> Heinrichs-Weicamp OSTC and from the Reefnet Sensus Ultra. (That last
> one isn't actually a dive computer, it's just a data logging device.
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface