# Re: [ferret_users] slanted domain selection

Hi Prescilla,
I guess your question is not clear enough. What kind of calculation are you
planning on the slanted (to be correct, rotated) grid?

Anyway, here is a simple method to define a subgrid, rotate it, and then regrid the original
data on to this rotated grid. Please go through the attached jnl file and give a try. Please let
me know if you have any questions.

Please note that there are a handful of external functions available in Ferret, to do different
sampling/regridding operations. You could use "show function" command to see a list
(ref sec 33.7)

Thanks and Regards,

Jaison

On Wed, Aug 12, 2009 at 7:23 AM, prescilla kurien wrote:
Hi Ryo and other ferreters..

My problem is not solved yet. Since i wanted to make calculations along
a slanted axis, i required to change my original model X and Y axis as a
slanted one.
So I divided my section into a number of lines(12) as shown in the
attached figure (ofcourse, i need more sections to take all the points..
this is just a sample) using samplexy command like this

let xlon0=80.5+0.25*I[I=1:30]
let ylat0=14+0.25*I[I=1:30]
...
....

let xlon12=80.5+0.25*I[I=1:32]
let ylat12=11.0+0.25*I[I=1:32]

let new_temp1=samplexy(SST,xlon0,ylat0)
......
......
let new_temp12=samplexy(SST,xlon12,ylat12)

As a result, i will get a 1D array like
(1,1),(1,2).......(1,30)    for new_temp1
.................
..................
(1,1),(1,2).......(1,30)    for new_temp12

As a result i cannot make a 2D(in newX and newY) plot from my above
values. I want to regrid the above as a 2D array having the value of SST
like below with a single variable name "TEMP"

(1,1),(1,2).......(1,30)    var=TEMP    ! in the first section
.................
..................
(12,1),(12,2).......(12,30)   var=TEMP   ! in the 12th section.

is it possible with ferret? If any of you know this.. could you please
teach me..?
Prescilla

On Sun, 2009-08-09 at 20:16 -1000, Ryo Furue wrote:
> Hi Prescilla,
>
> | I am in need to select a slanted domain as my region, as in the
> | attached figure.I wanted to to do my calculations within that domain
> | only. If any of you know how to manage a slanted domain(is there any
> | command?) selection using ferret, kindly teach me.
>
> Your domain seems to have a simple analytical definition using
> a set of inequalities such as  "y - 2 * x + 30 > 0",
> where x is longitude and y is latitude.
> (This equality is just for an illustration purpose. Don't use it.)
> those inequalities.  For example, if you want
> to extract the domain "(x + 2*y -100 > 0) and (x + 2*y -300 < 0)",
>
> yes? set data levitus_climatology
>       = if (x + 2*y -300 lt 0 and x + 2*y -100 gt 0) then temp
>
> Hope this helps,
> Ryo

Attachment: rotate_regrid.jnl
Description: Binary data