On Apr 6, 3:04pm, Emilio Mayorga wrote: > Subject: definition and use of W Longitude axis > I've had some problems with the definition and use of West Longitudes > since I started using Ferret. I assign negative values to the W > longitude axis variable in my netcdf files. These sometimes create > errors in Ferret. > > For instance, in the GUI I have to switch the Longitude option to use > x-index instead, otherwise I only get error messages like this one: > > **ERROR: illegal limits: PRECIP is not in the range X=65W > Axis extremes are X=80W(-80):45W(-45) > > In the command-line Ferret, I also encounter this problem sometimes, > such as the following, where the first line works fine and the second > results in the error message: > > yes? shade/t=0:83/y=20S:6N precip[x=-65] > yes? shade/t=0:83/y=20S:6N precip[x=65W] > **ERROR: illegal limits: PRECIP is not in the range X=65W > Axis extremes are X=80W(-80):45W(-45) > > Lastly (as another illustration), I just noticed that for these > variables that I've defined with negative values for W lon, using a > region specifier such as x=290E will result in an error message when > plotting variables (all my variables are defined in the window 80W to > 55W, 2S to 6N).
set data etopo60 shade rose[x=-140:40] *** NOTE: Modulo axis index is too negative: ROSE[X=140W(-140):40E,D=2] *** NOTE: This can crash FERRET!!! --> Use higher coordinate values.
Internally, Ferret always interprets formatted longitudes as positive values.
For example SET REGION/X=165W
is identical to SET REGION/X=195
.
Now consider the command
PLOT/X=165W my_var[D=my_data_set.nc]Ferret sees this as a reference to "X=195". If data set my_data_set.nc uses a 0 to 360 longitude encoding then the operations are straightforward. If, on the other hand, the data set uses a -180 to 180 encoding then Ferret has to apply modulo-360 transformation to the reference. The modulo operation actually occurs in "index space" -- indices of less than one or greater than N are allowed inside Ferret -- which is why Ferret can easily make 2-world wide plots (e.g. X=0:720) and multi-year monthly climatologies (e.g. L=1:36). In most cases, Ferret does modulo translations transparently. Your questions point to special cases where it does not:
SET AXIS/MODULO
or DEFINE AXIS/MODULO
)
In Emilio's question his data set extends only from "X=80W(-80):45W(-45)".
Solution: Specify X in the encoding used by the data set, such as "X=-65" instead of "X=65W".
(Note: modulo longitude axes of less than 360 degrees are allowed, but are of interest only for special problems such as nymerical models with "cyclic" boundary conditions.)
Solution: Add a multiple of 360 to the X references. For example, X=180:540 is equivalent to X=-180:180 and will usually avoid negative subscripts.
Solution: Add or subtract a multiple of 360 to your longitudes as needed to ensure this. The same consideration may apply when SAVE/APPEND is used to add additional data to a NetCDF file.
Last modified: Apr 9, 1997