[Thread Prev][Thread Next][Index]

Re: plane rotation



Hi all,
After an off-line conversation with Ned Cokelet of our lab, the question comes down to defining different kinds of axes. They do not need to be rectangular latitude-longitude axes. Because the rotated grid has different values of longitude along a grid line, and likewise for latitude, it will need to be expressed as a "curvilinear" grid.

So, you can define the new grid using cos and sin relationships. If all you need is graphical output, you can use the ideas from the map projection scripts (like mp_mercator.jnl etc) to define the coordinates for the rotated grid, and then use the curvilinear plotting capabilities of Ferret. You need to create two new variables, one with the longitudes at each grid point of the new 2-D grid, and one with the latitudes, also in 2 dimensions.

This would be along these lines, if your variables is called VAR.

let xpts = x[gx=var]
let ypts = y[gy=var]
let angle_deg = 30.
let Pi = 3.14159265
let deg2rad = Pi / 180.0
let angle_rad = angle_deg* deg2rad
let xrad = xpts * deg2rad
let yrad = ypts * deg2rad
let xcoord = xrad* cos(angle_rad) - yrad* sin(angle_rad)
let ycoord = yrad* cos(angle_rad) + xrad* sin(angle_rad)
shade/noaxes var, xcoord, ycoord


If you need to do computations with the data on the new grid, you could use the RECT_TO_CURV regridding function which was released with Ferret version 5.8, and regrid var onto the curvilinear grid defined by xcoord and ycoord.

(I'll incorporate the above into a new map projection script, mp_rotate.jnl for future releases.)

Ansley

Hemerson Tonin wrote:

Hi Ferreters,

Has anybody out there a good idea to define axis (and grid) to be inclined ?

I would like to rotate my grid on XY plane, and my "new X-axis" must have an angle in relation to Equator.



original (XY plane) I need (XY plane)

/ <-- "new X -axis"
/
-----------> Equator and "current X - axis" ---------/---------------------------- Equator



Hemerson Tonin
School of Chemistry, Physics and Earth Sciences
Flinders University
Adelaide - Australia







[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement