Specifying Region for Grid-Changing Functions
How is region information (e.g. X=20E:30E) handled in grid-changing functions (e.g. XSEQUENCE)? For instance when I issue the commands:
yes? set region/x=20E:30E/y=0N:20N/l=1 yes? stat xsequence(sst)
the X and Y limits are not handled as expected. What is going on?
yes? use coads_climatology yes? stat xsequence(sst[x=120e:130e,y=0n:20n,l=1]) XSEQUENCE(SST[X=120E:130E,Y=0N:20N,L=1]) X: 0.5 to 50.5 Y: N/A Z: N/A T: N/A DATA SET: /home/r3/tmap/fer_dsets/descr/coads_climatology.des Total # of data points: 50 (50*1*1*1) # flagged as bad data: 0 Minimum value: 25.092 Maximum value: 28.591 Mean value: 27.338 (unweighted average) Standard deviation: 0.94152 yes? set region/x=120e:130e/y=0n:20n/l=1 yes? stat xsequence(sst) XSEQUENCE(SST) X: 120 to 130 Y: N/A Z: N/A T: N/A DATA SET: /home/r3/tmap/fer_dsets/descr/coads_climatology.des Total # of data points: 11 (11*1*1*1) # flagged as bad data: 11
A number of functions in Ferret, including XSEQUENCE, are "grid-changing" functions. This means that the axes of the result may differ from the axes of the arguments. In the case of XSEQUENCE(sst), for example, the input grid for SST is
lon lat normal time
whereas the output grid is
abstract normal normal normal
so all axes of the input are replaced.
Grid-changing functions create a new type of ambiguity about region specifications. Suppose that the result of XSEQUENCE(sst[L=1]) is a list of 50 points along the ABSTRACT X axis. Then it is natural that
should give elements 10 through 20 taken from that list of 50 points (and it does.) However, one might think that "I=10:20" would refer to a subset of the longitude axis of SST. Therein lies the ambiguity: one region was specified, but there are 2 axes to which the region might apply.
It gets a degree more complicated if the grid-changing function takes more than one argument. Since the input arguments need not be on identical grids, a result axis (X,Y,Z, or T) may be replaced with respect to one argument, but actually taken from another (consider ZAXREPLACE, for example.)
Ferret resolves the ambiguities thusly:
** If in the result of a grid-changing function, an axis (X, Y, Z, or T) has been replaced relative to some argument, then region information which applies to the result of the function on that axis will NOT be passed to that argument. **
So, when you issue a command like
set region/x=20E:30E/y=0N:20N/l=1 LIST XSEQUENCE(sst)
the X axis region ("20E:30E") applies to the result ABSTRACT axis --it is not passed along to the argument, SST. The Y axis region is, in fact, ignored altogether, since it is not relevant to the result of XSEQUENCE, and is not passed along to the argument.
Specify region information for the function arguments specifically in the function call: XSEQUENCE(sst[L=1])