[Thread Prev][Thread Next][Index]

Re: plotting data in a separate directory



Hi Helge,
Jaison's suggestion got you most of the way there. You have defined
a symbol with the data set path and were able to use it to open the
data set, but then the define variable[d=($results)] statement fails. This is because in Ferret the "data set name" which you can refer to in
a [d= ] does not include the path, but only the file name. So, when you
define variables xg and zg, you could use

DEFINE VARIABLE xg=xcoo[d=($LABEL)]

Alternatively, there are a couple of useful arguments to the RETURN
keyword which might come in handy as you manage the data sets. Once you have opened the file, you could do something like this. (I'll also show another way to use the symbols. You can do it without
defining the symbol qts):

define symbol DIR=data
define symbol LABEL=test2-grid.data
file/var=xcoo,zcoo/grid=grid1 "./($dir)/($label)"

let dnum = `xcoo,return=dsetnum`
!-> DEFINE VARIABLE dnum = 1

let xg = xcoo[d=`dnum`]
let vg = zcoo[d=`dnum`]

! OR, use the result of RETURN=dsetname

let dname = "`xcoo,return=dsetname`" ! a string variable
!-> DEFINE VARIABLE datname = "test2.data"

let xg = xcoo[d=`dname`]
let vg = zcoo[d=`dname`]


yes? go plot
define symbol DIR=data
define symbol LABEL=test2
define symbol qts = \"
define symbol RESULTS=($qts).\/($DIR)\/($LABEL).data($qts)
!-> define symbol RESULTS="./data/test2.data"
define symbol VGRID=($qts).\/($DIR)\/($LABEL)-grid.data($qts)
!-> define symbol VGRID="./data/test2-grid.data"
define axis/x=1:2:1 xaxis
define axis/y=1:2:1 yaxis
define grid/x=xaxis/y=yaxis grid1
file/var=xcoo,zcoo/grid=grid1 ($VGRID)
!-> SET DATA/EZ/var=xcoo,zcoo/grid=grid1 "./data/test2-grid.data"
let xg=xcoo[d=($VGRID)]
!-> DEFINE VARIABLE xg=xcoo[d="./data/test2-grid.data"]
let zg=zcoo[d=($VGRID)]
!-> DEFINE VARIABLE zg=zcoo[d="./data/test2-grid.data"]
file/var=dill,sal,temp/grid=grid1 ($RESULTS)
!-> SET DATA/EZ/var=dill,sal,temp/grid=grid1 "./data/test2.data"
shade dill,xg,yg

**ERROR: unknown data set: D="./data/test2-grid.data"



Helge Avlesen wrote:

Jaison Kurian wrote
| yes? use "/home/DATA/mydata.dat" ! full path
| ! or
| yes? use "./DATA/mydata.dat" ! relative to current dir.
|
|
| To use your present sript, define a new variable like;
|
| yes? define symbol qts = \"

nope, doesn't work... your suggestion is the same as just using double
quotes directly which I tried before.

ferret reads the data ok, but the let command adds a couple of " that
leads to a failure later.




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement