[Thread Prev][Thread Next][Index]

Re: [ferret_users] redefining dimension values of variables on an irregular grid

The variable TEMP is already on the curvilinear coordinate grid defined by the coordinate variables tlong and tlat. Look at the attributes of TEMP in the file.

   yes? show attributes TEMP

It probably has a "coordinates" attribute listing tlong and tlat, pointing to those variables as the  coordinates for temp.  (Ferret would be friendlier if it looked for that attribute and those coordinates and automatically did things to work with that grid.)

You can work with it on this grid, with the 3-argument plot commands such as this.

   yes? SHADE temp, tlong, tlat

Use the /HLIMITS and /VLIMITS qualifiers to show subsets of the data, and to ask for a region that crosses the modulo cut, use the /MODULO qualifier:

   yes? shade/modulo/hlimits=-180:180 temp, tlong, tlat

The function rect_to_curv would be used it you have data on another rectilinear grid  and want to put it onto this curvilinear grid for comparison.

Or to translate it to a rectilinear grid (simple 1-d coordinate lists in X and Y) you'd use CURV_TO_RECT_MAP and CURV_TO_RECT.


On 8/8/2018 10:55 AM, Pearse Buchanan wrote:

Apologies… Looks like the images didn't come through.



I'll show you what they look like: TEMP --> TLONG --> TLAT




I can do the following successfully:


    shade TEMP, TLONG, TLAT



From: owner-ferret_users@xxxxxxxx <owner-ferret_users@xxxxxxxx> On Behalf Of Pearse J. Buchanan
Sent: Wednesday, 8 August 2018 1:48 PM
To: Ansley C. Manke <ansley.b.manke@xxxxxxxx>; ferret_users@xxxxxxxx
Subject: RE: [ferret_users] redefining dimension values of variables on an irregular grid


Hi Ansley,


Thanks for getting back to me. I think the function I want to use is rect_to_curv, because I'm trying to put a variable, let's say TEMP[100,122], onto the curvilinear grid. The curvilinear grid coordinates are held in variables TLONG[100,122] and TLAT[100,122].


I'll show you what they look like: TEMP --> TLONG --> TLAT





I can do the following successfully:


    shade TEMP, TLONG, TLAT



However, I want to save this output as a new variable. I tried this with "rect_to_curv" without success.

    let temp_curv = rect_to_curv(TEMP, TLONG, TLAT, 3)

    sha temp_curv

    Bailing out of external function "rect_to_curv":
        input grid not modulo, output grid must be inside input grid
 **ERROR: error in external function

Hope there is a simple solution to this. The grids are the same size.






From: owner-ferret_users@xxxxxxxx [owner-ferret_users@xxxxxxxx] on behalf of Ansley C. Manke [ansley.b.manke@xxxxxxxx]
Sent: 08 August 2018 12:59
To: ferret_users@xxxxxxxx
Subject: Re: [ferret_users] redefining dimension values of variables on an irregular grid

Hi Pearse,

This is what's called in the Ferret documentation a "curvilinear grid".  There are techniques for visualizing data on these grids directly and also capabilities for regridding to and from such grids. Have a look at the Ferret documentation under "curvilinear grids" and "curvilinear coordinates" and see if that'll get you started..




On 8/8/2018 7:01 AM, Pearse J. Buchanan wrote:

Hello all,


I've been given some model data. The grid on which the ocean model exists is irregular, with a displaced north pole. The grid is 100 units in x and 122 units in y.


All variables exist on this grid type. However, the dimensions of each variable are not in degrees of longitude or latitude. Rather, they are in units of grid cells (i.e. 1 --> 100, and 1 --> 122).


What I want to do is take each variable and redefine their latitude and longitude dimensions so that they are now in degrees, not grid cell number. The ocean model provides this information in separate variables called TLONG and TLAT:

  • TLONG(100,122) = array of t-grid longitudes (degrees east)
  • TLAT(100,122) = array of t-grid latitudes (degrees north)

So I am struggling with how to take the values held in the variables TLONG and TLAT and set them as the dimension values for other ocean variables, say TEMP and SALT.


There must be a simply way of doing this so I thought I'd ask.





University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement