Joe, Marc and others,
Hmmm....
We have debated this here in the past, but the "non-dumb" solution is not so
clear to us.
When a dummy appears in an arithmetic expression, the result will always be
dummy, which is as you would expect.
However, when a dummy appears in a logical expression, what is the outcome?
Logical expressions can only result in TRUE (1) or FALSE (0), so which
should it be? A parser cannot (and should not in our opinion) anticipate
what you are going to do as the result of your expression because this will
lead to even more confusion and complexity.
As Marc points out, our rule is that iDUMMY and rDUMMY are the largest
possible negative numbers (in our system) and you can anticipate the results
of a logical expression knowing this.
For example, consider the following uses of logical expressions:
if (rVal != rDUMMY && rVal < 10.0) rVal = 0.0; // non-dummies < 10.0
changed to 0.0
if (rVal == rDUMMY) rVal = 0.0; // converted dummies to 0.0
if (rVal < 10.0) rVal = 0.0; // this will convert dummies to 0.0! What is
the logic
// for us to do anything else?
if (rVal > 10.0) rVal = 10.0; // clip rVal to 10.0
iFlag = (rVal == rDUMMY); // iFlag will be 1 if rVal is dummy
iFlag = (rVal != rDUMMY); // iFlag will be 1 if rVal is not dummy
Can anyone suggest a better rule set for how to deal with all these
situations? And if we can, how do we prevent breaking existing GX's?
As for the sampling of the outcome from a math expression, our (perhaps
weak) logic was that your user has forced the displayed sample rate as they
want it, so we use this. I can see Marc's point, but I worry that someone
out there relies on existing behaviour, and we know folks HATE it when we
change behaviour. Further comments from other developers on this issue are
welcome.
Ian
_______________
Geosoft Inc.
Ian MacLeod
[EMAIL PROTECTED]
(416) 369 0111 x323
Software and services for effective earth science decision-making.
Free Oasis montaj interface now available at http://www.geosoft.com
> -----Original Message-----
> From: Marc Pelletier [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 31, 2000 10:38 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [gxnet]: Bugs in 5.02
>
>
> At 09:37 AM 31 10 00 -0500, you wrote:
> >Does anyone view DUMMY values in a significantly different
> manner than I
> >have outlined above?
>
> Joseph,
>
> I agree with you completely. Dummy values are treated as
> rDummy (-1e32) in comparison operations. This is documented
> somewhere, but it's still dumb.
>
> Here's another one that REALLY bugs me. If you run a math
> expression on several existing channels, either interactively
> or by using the Math gx. The sample rate of the output
> channel is determined by the displayed fid level. For example
> if a create a new channel Test, and run Math.gx with the
> expression Test=xf+2, if xf is sampled at 1 x/sec I would
> expect Test to be the same. It will, however, be sampled at
> whatever the displayed fid is at the time. If I have mag
> displayed which is 10 x/sec, and that is my master sample,
> then Test will be at 10x. If xf is my master sample then the
> output will be 1x. The math gx is somehow using the database
> display to determine fiducial rate.
>
> There's another twist to this as well. If Test already exists
> and is at 10x, but my displayed fid increment is at 1x and I
> again run Test=xf+2, the fid increment remains 0.1. There is
> a certain logic to that, I guess, but if it happens the other
> way, Test exists at 1x and you run test=mag, then test comes
> out at 10x, regardless of the displayed fid level.
>
> The end result of all that is when you work with a given
> database for long enough, all of your channels end up
> resampled at the highest sample rate. Well, that's what
> happens here anyway.
>
> The moral of this story, when working with differing sample
> rates never reuse channels for temporary output, as they
> preserve the highest sample rate, and always confirm that the
> sample rate of your output channel matches the inputs. Oasis
> loves to bloat up those databases.
>
> cheers
>
> Marc Pelletier
>
> --------------------------------------------------------------
> -------------
> Data Donkey - Geophysical Data Processing, Consulting and
> Software Development
> Creator of the POWER TOOLBOX utilities for OASIS montaj
> contact: mailto:[EMAIL PROTECTED] tel (306) 931-6853 or
http://www.datadonkey.com
_______________________________________________________
More mailing list info http://www.geosoft.com/support/listserv/index.html
List Archive http://www.mail-archive.com/[email protected]
_______________________________________________________
More mailing list info http://www.geosoft.com/support/listserv/index.html
List Archive http://www.mail-archive.com/[email protected]