# Re: [ferret_users] Regridding the point locations data into spatial manner

Hi,

Thanks Ansley. I have got the  output with this commands.

Thanks & Regards
Nanda Kishore reddy. B

On Wed, Feb 17, 2016 at 11:28 PM, Ansley C. Manke wrote:
Hi,
Of course.    I typed that without testing.  For a small number of variables such as this we can do it in two stages. Instead of the definition I used for temp_3y,

let temp_32 = YCAT(temp[d=3], temp[d=2])
let temp_3y = YCAT(temp_32, temp[d=1])

With more than just 3 or 4 variables, this kind of logic quickly gets unwieldy and we would need another solution.

Ansley

On 2/17/2016 12:59 AM, Nanda Kishore Reddy wrote:
Hi Ansley,

I have tried the way you told to me, but still I am getting an error. I have gone through the ferret manual and then I got that YCAT command will concatenate only for two variables.

sh da
currently SET data sets:
name     title                             I         J         K         L         M         N
TEMP     AD01_temp                        1:1       1:1       1:9       1:26280   ...       ...

name     title                             I         J         K         L         M         N
TEMP     AD02_temp                        1:1       1:1       1:9       1:26280   ...       ...

name     title                             I         J         K         L         M         N
TEMP     AD03_temp                        1:1       1:1       1:9       1:26280   ...       ...

def axis/x=69:69:1/units=degrees xlong
def axis/y=12:18:3/units=degrees ylat
def axis/cal=GREGORIAN/t="01-Jan-2013 00:00":"31-DEC-2015 23:00":1/units=hours thour
let dep=ZSEQUENCE({`10`,`15`,`20`,`30`,`50`,`75`,`100`,`200`,`500`})
!-> DEFINE VARIABLE dep=ZSEQUENCE({10,15,20,30,50,75,100,200,500})
define axis/z/units="meters"/depth zdep=dep

let temp_3y = YCAT(temp[d=3], temp[d=2], temp[d=1])
**ERROR: command syntax: YCAT(temp[d=3], temp[d=2], temp[d=1])
The YCAT function has an incorrect number of arguments
DEFINE VARIABLE temp_3y = YCAT(temp[d=3], temp[d=2], temp[d=1])
Command file, command group, or REPEAT execution aborted

let temp0 = x[gx=xlong] + y[gy=ylat] + t[gt=thour] + z[gz=zdep]

let temp_grd_xy = RESHAPE(temp_3y, temp0)

Regards & thanks
Nanda Kishore reddy. B

On Tue, Feb 16, 2016 at 11:37 PM, Ansley C. Manke wrote:
Hi,
Here I think a good way to treat the data in three datasets as one variable will be to call a function which concatenates them.

def axis/x=69:69:1/units=degrees xlong
def axis/y=12:18:3/units=degrees ylat

! This puts the data onto an abstract y axis (with y=1,2,3,...)

! define a variable on your grid and use RESHAPE to put your data onto that grid.

let var_on_grid = x[gx=xlong] + y[gy=ylat]
let temp_grd_xy = RESHAPE(temp_3y, var_on_grid)

show grid
temp_grd_xy
The way I wrote that, this will put AD03_temp[d=3] at y=12, AD03_temp[d=2] at y=15, and so on.  If this is not the correct order, change the order of concatenation.  Now, if you use the variable temp_grd_xy, Ferret will read the data from each file as needed.

Ansley

On 2/14/2016 10:00 PM, Nanda Kishore Reddy wrote:
Hi,

I have a 3 locations of data in which it contains different latitudes (i.e. uniformly spaced) but longitude, depth and time axis are fixed for all the locations. How can I regrid these point locations data into spatial manner.

can data/all; can var/all; set me/size=300

def axis/x=69:69:1/units=degrees xlong
def axis/y=12:18:3/units=degrees ylat
def grid/x=xlong/y=ylat grd_xy

Thanks & Regards
Nanda Kishore reddy. B