[Thread Prev][Thread Next][Index]

Re: [ferret_users] SIGDIG hysteresis!



Ryo,
I've found where this occurs, and a fix will be in the next release. It turns out to be a very old bug.  Another control for the formatting of digits in the labels drawn on contour lines is a fourth argument to the /LEVELS qualifier.  This one is an NDIGITS, so it sets the number of digits after the decimal point, so from your example:

yes? contour/lev=(5,15,1)/k=1/sigdig=4 temp  ! 12.0000

Here's the documentation:
/LEVELS=(lo,hi,delta,ndigits)

ndigits (applies to CONTOUR command only) is the number of decimal places to use when labeling the level on individual contour lines as:

-1 for integer format
or
-3 to omit numerical labels
Or, though it doesn't spelled out in the documentation, a value > 1 for n digits after the decimal point. So that's a more rational option for you in the meantime.


On 1/10/2013 4:52 PM, Ansley Manke wrote:
Hi Ryo,
Well that's interesting (and what a wonderful word, hysteresis). I imagine there are un-initialized variables somewhere, or something along those lines. Fortran does some unexpected things saving values between one pass through a piece of code and the next.  Actually /SIGDIG (which comes from the old PPLUS syntax nsig) is a big of a misnomer isn't it. We're changing the number of digits not the number of significant digits.

Thank you for the report.  I'll have a look.

Ansley

Thank you for the report.

On 1/10/2013 1:57 PM, Ryo Furue wrote:
Ferret developers,

I'm trying to control the format of contour labels
and I'm bewildered by the SIGDIG qualifier.  I suppose
there is a bug there.

I did this test:

  yes? set data levitus_climatology
  yes? set region/y=60s:40s
  yes? contour/lev=(5,15,1)/k=1 temp          !--(0)
  yes? contour/lev=(5,15,1)/k=1/sigdig=1 temp !--(1)
  yes? contour/lev=(5,15,1)/k=1/sigdig=2 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=3 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=4 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=5 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=4 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=3 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=2 temp
  yes? contour/lev=(5,15,1)/k=1/sigdig=1 temp
  yes? contour/lev=(5,15,1)/k=1  temp
  !. . . Go back to (1) . . .

The results are

Without SIGDIG:"5.0",   "6.0",   . . . , "12.0"
SIGDIG=1 gives "5.0",   "6.0",   . . . , "12.0"
SIGDIG=2 gives "5",     "6",     . . . , "12"
SIGDIG=3 gives "5.0",   "6.0",   . . . , "12.0"
SIGDIG=4 gives "5.00",  "6.00",  . . . , "12.00"
SIGDIG=5 gives "5.000", "6.000", . . . , "12.000"
SIGDIG=4 gives "5.0000","6.0000",. . . , "12.0000"
SIGDIG=3 gives "5.000", "6.000", . . . , "12.000"
SIGDIG=2 gives "5.00",  "6.00",  . . . , "12.00"
SIGDIG=1 gives "5.0",   "6.0",   . . . , "12.0"
Without SIGDIG:"5",     "6",     . . . , "12"

As you can see, there is "hysteresis"!  I've verified
that the above cycle exactly repeats.

Since at least I've found the pattern, I can exactly
control the format of my contour labels. :-)

FERRET v6.81  
Linux 2.6.32-279.1.1.el6.x86_64 32-bit
 - 07/23/12 10-Jan-13 11:48     

Cheers,
Ryo



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement