Hi Geoff,
working from the Ferret command line, it's `var,return=dsetpath`
which returns the path including the file name itself. So,
yes? use coads_climatology
yes? let path = "`sst,return=dsetpath`"
!-> DEFINE VARIABLE path = "/home/users/tmap/ferret/linux/fer_dsets/data/coads_climatology.cdf"
It needs to be in double-quotes as we're defining a string variable.
and `sst,return=dset` would return the file name coads_climatology.
To parse out just the path without the filename would take some
fiddling with Ferret's string functions. If you want to do that and
need a hand, let me know.
Ansley
On 11/13/2012 3:47 PM, Geoff Stanley
wrote:
Hi all,
Is there a way to get the file path as a string for each of
my data sets? Specifically, I am looking for what comes after
"FILEPATH" when LIST'ing a variable, and I would like it placed
into a variable.
VARIABLE : thickness t grid (m)
FILEPATH : r8_riv/xSOw/1.0/
SUBSET : 27 points (Z (m))
This, coupled with
LET path =
{SPAWN:"pwd"}
will give me the full file path.
If it would be possible to have this variable exist for all
my data sets, that would be even better! I can think of some
very roundabout ways involving LIST'ing a variable that we know
will exist and GREP'ing the output, but hope there's a better
way.
Thanks!
Geoff Stanley
Climate
Modelling Group
School of Earth and Ocean Sciences
University of Victoria
Victoria, BC
Canada
http://climate.uvic.ca/
|