[Thread Prev][Thread Next][Index]

Re: Detecting presence of variable in a dataset (was: Customizingstick &contour plots)



Hi Mike,

A variation on what Ned has suggested -- a technique to use when you know that a
particular dataset is missing a variable that you need from it:
   LET/D=<my_dataset_name> TEMPERATURE_HR = TEMPERATURE_DAY

    - steve

==========================

"E.D. (Ned) Cokelet" wrote:

> One thing that might help is the little-known LET/D command syntax.  For
> example,
>
> let/d my_var = dummy         ! defaults to dummy if my_var is not in data set
>
> Suppose you have a dataset that may of may not have variable my_var in it.  Then
> if my_var does not exist, this command will substitute the variable dummy for
> it.  You could predefine dummy to be all missing values or whatever is
> convenient.  If my_var does exist, this command does nothing.
>
> --
> Edward D. (Ned) Cokelet, Ph.D.      Edward.D.Cokelet@noaa.gov
> NOAA/PMEL                                   ph: (206) 526-6820
> 7600 Sand Point Way NE                   fax: (206) 526-6485
> Seattle, WA 98115-6439

--

Steve Hankin, NOAA/PMEL -- Steven.C.Hankin@noaa.gov
7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080, FAX (206) 526-6744

--- Begin Message ---
Dear Ferreters,

I wish to have my GO script detect if a variable present in a data set and
then conditionally execute statements.  E.g.:

IF (TEMPERATURE_HR is_a_valid_variable) THEN
  CONTOUR TEMPERATURE_HR
ELSE
  CONTOUR TEMPERATURE_DAY
ENDIF
	
Is there some magic that will do this conditional expression?

Thanks in advance,
Mike

P.S. Thank you Hein, Mick & Ansley for the plotting suggestions.  They are
working well.

--
Mike McCann (mccann at mbaridotorg)
Monterey Bay Aquarium Research Institute
7700 Sandholdt Road
Moss Landing, CA 95039-9644
Voice: (831) 775-1769 Fax: (831) 775-1646 http://www.mbari.org/rd/iag.htm

 
--- End Message ---

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement