[Thread Prev][Thread Next][Index]

Re: accessing repeat loop index




Hi Steve,

The behavior you are seeing is not a result of the REPEAT command. It
stems from the way Ferret handles coordinates and grids.


The command

	yes? LIST/Z=2.5 Z

is a request to display the "pseudo-variable" Z -- i.e. it asks about the
Z coordinates on some axis. In the absence of any further coaching Ferret
assumes you are referring to the  axis of gris 'ABSTRACT', which consists
simply of the integer-valued coordinates 1, 2, 3, .... The default
behavior of Ferret is to give you the closest grid point -- hence the
apparent round-off.

You can use
	yes? SET MODE INTERPOLATE
to change this default interpretation.

You can use, say,
	yes? LIST/Z=2.5 z[G=sst]
to indicate that it is the Z coordinates of variable "SST" that you are
referring to.

And you can use the "dynamic axis" notation

	yes? LIST Z[Z=0:4:0.5]

to quickly specify a list of non-integer-spaced Z axis coordinates.

I hope this helps to clarify.

	Happy Ferreting - steve

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


On Mon, 22 Sep 1997, Steven Hodge wrote:

> How does one access the CORRECT value of a REPEAT "index", say, for
> example, to display it as a string?  
> 
> Example:  I have 3d data defined over (lon,lat) and a Z axis from 2 
> to 4 at intervals of 0.5.  A repeat command such as
> 
> REPEAT /Z=2:4:0.5 (FILL R)
> 
> where "R" is the variable name, works just fine, and displays 5 
> successive plots of R, at Z=2,2.5,3,3.5,4.   
> 
> However, trying to access the actual value of Z within the REPEAT
> loop appears impossible.  For example,
> 
> REPEAT /Z=2:4:0.5 (LIST Z)
> 
> produces:
> 
> REPEAT: Z=2
>          Z
>          axis ABSTRACT
>          Z:2
>       2.000
> REPEAT: Z=2.5
>          Z
>          axis ABSTRACT
>          Z:2
>       2.000
> REPEAT: Z=3
>          Z
>          axis ABSTRACT
>          Z:3
>       3.000
> REPEAT: Z=3.5
>          Z
>          axis ABSTRACT
>          Z:3
>       3.000
> REPEAT: Z=4
>          Z
>          axis ABSTRACT
>          Z:4
>       4.000
> 
> There appears to be some sort of rounding going on. 
> 
> Can anyone tell me how to access the correct value of the "index"?
> 
> Thanks.
> 
> *********************************************************
> *   PLEASE MAKE NOTE OF OUR RECENT AREA CODE CHANGE     *
> *   		WE ARE NOW AREA CODE 253                *
> *********************************************************
> STEVEN HODGE, Geophysicist, Ice & Climate Project
> Alaska District Office, Water Resources Division
> U.S. GEOLOGICAL SURVEY
> University of Puget Sound, Tacoma, WA 98416
> Shipping/overnight: 1206 N. Lawrence St, Tacoma, WA 98406
> Voice: 253-593-6516                     Fax: 253-383-7967
> ---------------------------------------------------------
> 
> 



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement