[Thread Prev][Thread Next][Index]

Re: definition and use of W Longitude axis

  ***   Explanation:  definition and use of W Longitude axis  ***

Hi  Emilio and Stefan,

The longitude encodings used in data sets, as we know, are not standardized.
The most common encodings are 0 to 360 and -180 to 180. Ferret does not mandate
any particular encoding. Ferret uses the "modulo" property of a longitude axis
to translate between encodings.

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
two special cases where it does not:

Case 1) If a longitude axes is not "modulo" the modulo-360 translation will not
be performed. A longitude axis is modulo only if
     i) it is 360 degrees wide
and ii) it is designated as modulo  (e.g. SET AXIS/MODULO or DEFINE
In Emilio's question his data set extends only from "X=80W(-80):45W(-45)".

The solution in this case is to 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.)

Case 2) If the modulo operation generates negative indices less than I=-100
Ferret will issue the warning message that Stefan referred to. This occurs when
the referenced X values are LESS than the longitude values encoded in the X
axis of the data set. For example, if an axis runs from X=0 to 360 and we refer
to X=-180 we will generate negative index references.

The solution is to 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

One additional case) When using /OVERLAY on a plotting command, the longitude
encodings of the overlay must match the encodings of the base plot.

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.

I hope this helps.

	- steve


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).
> * Does anyone know what's going on? Should I switch to using positive
> values for W longitude in the netcdf longitude coordinate variables --
> that is, will that option result in fewer errors and inconsistencies?
> I appreciate any help on this.
> Emilio Mayorga
> ________________________________________________________________
> University of Washington
> School of Oceanography			emiliom@u.washington.edu
> Box 357940				ph. (206) 543-5334
> Seattle, WA  98195-7940	  USA		FAX (206) 685-3351
> http://boto.ocean.washington.edu/staff_pages/emilio
>-- End of excerpt from Emilio Mayorga


On Apr 7, 10:44am, Stefan Rahmstorf wrote:
> Subject: Re: definition and use of W Longitude axis
> Hi,
> I have a similar problem with longitude axis as Emilio.
> When using
> set region/x=160e:160e
> shade temp[k=1]
> to make a global plot with the edges at 160e,
> I get a message "Modulo axis index is too negative - this can crash ferret!"
> although the plot appears to be o.k. I have not found a way of doing this
> without the error message; e.g. x=160:520 or x=200w:160e produces the
> same error.
> Only setting the plot edge at 180e or larger fixes the problem.
> Stefan
> --
> Dr Stefan Rahmstorf
> Potsdam Institute for Climate Impact Research (PIK)
> PO Box 60 12 03
> 14412 Potsdam
> Germany
> --
> E-mail:  rahmstorf@pik-potsdam.de
> Tel:     +49 331 2781 160  (home: +49 331 715429)
> Fax:     +49 331 2781 204  (home: +49 331 715429)
>-- End of excerpt from Stefan Rahmstorf


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

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement