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,
With more than just 3 or 4 variables, this kind of logic quickly gets unwieldy and we would need another solution.let temp_32 = YCAT(temp[d=3], temp[d=2])let temp_3y = YCAT(temp_32, temp[d=1])
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.
use ad01_temp.ncuse ad02_temp.ncuse ad03_temp.ncsh dacurrently SET data sets:1> ./ad01_temp.ncname title I J K L M NTEMP AD01_temp 1:1 1:1 1:9 1:26280 ... ...2> ./ad02_temp.ncname title I J K L M NTEMP AD02_temp 1:1 1:1 1:9 1:26280 ... ...3> ./ad03_temp.nc (default)name title I J K L M NTEMP AD03_temp 1:1 1:1 1:9 1:26280 ... ...
def axis/x=69:69:1/units=degrees xlongdef axis/y=12:18:3/units=degrees ylatdef axis/cal=GREGORIAN/t="01-Jan-2013 00:00":"31-DEC-2015 23:00":1/units=hours thourlet 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 argumentsDEFINE 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 <ansley.b.manke@xxxxxxxx> 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.
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.use AD01_temp.ncuse AD02_temp.ncuse AD03_temp.nc
def axis/x=69:69:1/units=degrees xlongdef axis/y=12:18:3/units=degrees ylat
! This puts the data onto an abstract y axis (with y=1,2,3,...)
let temp_3y = YCAT( AD03_temp[d=3], AD03_temp[d=2], AD03_temp[d=1])
! 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
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
use AD01_temp.ncuse AD02_temp.ncuse AD03_temp.nc
def axis/x=69:69:1/units=degrees xlongdef axis/y=12:18:3/units=degrees ylatdef grid/x=xlong/y=ylat grd_xy
let sp_grd0 = AD03_temp[d=3,g=grd_xy@asn]let sp_grd1= AD02_temp[d=2,g=grd_xy@asn]
let sp_grd2 = AD01_temp[d=1,g=grd_xy@asn]
Thanks & Regards
Nanda Kishore reddy. B