[Thread Prev][Thread Next][Index]
Re: query/ignore and use of Ferret error messages
Hi Emilie,
Make the "go" file as
query/ignore $1%portrait|landscape|portrait<USAGE: GO my_file [portrait/landscape]%
say $1"portrait"
OR
query/ignore $1%portrait|landscape|portrait<USAGE: GO my_file [portrait/landscape]%
define symbol orient = $1"portrait"
say ($orient)
In the first case you have to use $1"portrait" wherever you need to
specify the orientation..like
(Please note that "-l" option for Fprint is to specify line : ps/cps.)
sp Fprint -l cps -p $1"portrait" -o test.ps -R metafile.plt
In the second case you can use the new symbol "orient" ..like
sp Fprint -l cps -p ($orient) -o test.ps -R metafile.plt
For details please refer user manual Ch1 Sec5.3.4.
Arguments to GO tools and Ch1 Sec5.3.5.
"QUERY/IGNORE" has been explained as : no-op command (has no effect)
For error messages, please refer usermanual Ch7 Sec10.
I am not sure wether it is possible to customorize ferret's default
error messages. But if you know the possible traps for a script then
desine it with proper error checking steps. Here is a quick example.
Suppose we need to make vertical profiles, then the data should vary
only on Z axis. So.....
set data levitus_climatology
set reg/x=60
define symbol shp = "`temp,r=shape`"
IF `($shp) NE "Z"` THEN
say ; say "ERROR : region is not set properly" ; say
exit
ENDIF
plot temp
This kind of sanity checking can be added to the script for "customorized"
error/warning messages.
Suppose if you want to generalize this customorization, then
- put all the required error messages in a text file & read it back
(to a variable err_msg)
- do the checking
- if error occures then assign the respective error
message's line number to a "symbol" (say err)
- if no error then assign 0
- construct an IF condition... like
IF `($err) GT 0` THEN
say `err_msg[d=*,i=($err)]`
exit
ENDIF
Hope This Helps
With Regards
Jaison
--
___________________________________________________
Jaison Kurian
Centre for Atmospheric and Oceanic Sciences
Indian Institute of Science
B A N G A L O R E 560 012
Ph: +91-80-3942505
+91-80-3600450
Fax:+91-80-3600865
___________________________________________________
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement