[Thread Prev][Thread Next][Index]

Re: automatically symbol definitions



Hi Hemerson,
I don't know that I see what is causing the error message, but here
are a few suggestions for you to try to debug your script:

- Using the symbol names max and min could cause confusion
with the keywords Ferret already uses  for the MAX and MIN
functions and transformations.  This does not seem to be the
problem however, it's more a matter of programming style.

- As you are developing a script, use the SHOW SYMBOL,
SHOW VARIABLE and LIST commands to see what values
your definitions are taking on. You can take those commands out
later.  Leave off the /QUIET qualifier until later, when your script
is working.  Execute your script line by line so you can look at the
results of each command before continuing.  Taking your commands,
I'll add some suggested commands using capital letters to make them
easier to see.

define symbol var1 $1%AAA%       !my variable
define symbol var2 $2%BBB%       !parameter 1 - computed from my variable
define symbol var3 $3%CCC%       !parameter 2 - computed from my variable

SHOW SYMBOL var1
SHOW SYMBOL var2
SHOW SYMBOL var3

let template1=if AAA[l=@max] ge BBB then AAA[l=@max] else BBB
LIST template1

define symbol axmax $4%template1%
SHOW SYMBOL axmax

let template2=if AAA[l=@min] le CCC then AAA[l=@min] else CCC
define symbol axmin $5%template2%
LIST template2
SHOW SYMBOL axmin

plot/vlim=($min):($max)      ($var1)

I do see one thing you need to do differently; define the axmin and
axmax variables with grave quotes on the template variable to force
them to be evaluated.  (See Ch1 Sec 4 on Command Syntax for
more on this; look up "grave accent, syntax" in the Users Guide).
define symbol axmax $4%`template1`%
define symbol axmin $5%`template2`%
Otherwise you are just assigning axmax the string

Hemerson Tonin wrote:

Hi Ferreters

I am trying to design a journal that adjust itself as better as possible to
plot my results.

The basic journal compute some parameters (statistical stuff - not showed)
and when I try to plot them, some parameters have not appear due VLIM. In
sum, I have intend to define symbols automatically (inside the journal)
that will give these limits.

Below is part of my plot journal sequence.

define symbol var1 $1%AAA%       !my variable
define symbol var2 $2%BBB%       !parameter 1 - computed from my variable
(result from expression - single value)
define symbol var3 $3%CCC%       !parameter 2 - computed from my variable
(result from expression - single value)

! AAA[l=@max] may be bigger, equal or  smaller than BBB
! AAA[l=@min] may be bigger, equal or  smaller than CCC
! BBB is bigger than CCC

let/quiet template1=if AAA[l=@max] ge BBB then AAA[l=@max] else BBB;define
symbol max $4%template1%
let/quiet template2=if AAA[l=@min] le CCC then AAA[l=@min] else CCC;define
symbol min $5%template2%

! above, only to determine which values are my limits and defining as
symbol (Can I afford to do this ???)
! and then

plot/vlim=($min):($max)      ($var1)
plot/ov/colour=red/nolabels ($var2)
plot/ov/colour=red/nolabels ($var3)

! The sequence of variable plotted doesn't matter

! The big problem is: ferret cannot understand my symbols "min" and "max".
It has returned a message:

  !-> plot/vlim=mi:ma  AAA
  **ERROR: command syntax: mi

Can anyone help me ???

Tonin, H. E.
School of Chemistry, Physics and Earth Sciences
Flinders University
Adelaide - Australia

--
Ansley Manke  Pacific Marine Environmental Laboratory  Seattle WA
 
[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement