Hi Savin,
There are several steps to this.
What you want to do is I think similar to what's described here,
putting a set of labels at locations on a plot.
http://ferret.pmel.noaa.gov/Ferret/faq/labelling-dates-along-a-trackline
Is that right? Or, reading your message again, maybe you want just
one label corresponding to the date of the plot.
Either way you need to open and read the ascii file, and use the
variables in it to make the labels. It would look something like
this
yes? file/skip=1/var="lat,lon,clumb_num,timevar"
my_ascii.dat
You want to make dates out of that time variable. There's a
discussion about that here,
http://ferret.pmel.noaa.gov/Ferret/faq/creating-a-time-axis-from-time-variables
but first you need to define separate variables for the year, month,
day.
yes? let years = INT(timevar/10000)
yes? let months = int((timevar-10000*years)/100)
yes? let days = (timevar-10000*years) - 100*months
yes? ! check this
yes? list/i=1:5 years, months, days
yes? ! Now following what's in the FAQ above,
yes? let tstep = DAYS1900(years[d=1],months[d=1],days[d=1])
yes? ! Define a time axis, ttaxis, from variable tstep
yes? DEFINE axis/T/T0=1-jan-1900/UNIT=days ttaxis=tstep[L=1:`tstep,i=@ngd]`]
yes? ! put the lon,lat,clump data onto this time axis
yes? let tt = t[gt=ttaxis]
yes? let lat_t = reshape(lat[d=1], tt)
yes? let lon_t = reshape(lon[d=1], tt)
yes? let clump_t = reshape(clump_num[d=1], tt)
Depending on what you want to do, you could regrid the vorticity
data to the time axis we defined here from the ascii data. Then you
could step through that time axis, plotting the vorticity data and
making the label, using the LABEL command and specifying the
longitude, latitude, at the particular time as the location and the
clump_t variable as the text of the label.
I hope this will get you started.
On 8/15/2012 11:41 PM, Savin Chand
wrote:
Dear
ferret users,
Please
advice how I can solve the following problem in ferret...
I
have a netcdf data containing daily averaged relative
vorticity (say for January 2000).f
I
also have an ascii file containing the following
information:
Lat |
Long |
Clump_number |
Time |
20.5 |
120.5 |
1 |
20000105 |
30.5 |
180 |
2 |
20000108 |
8.6 |
170 |
3 |
20000111 |
9.4 |
126 |
4 |
20000114 |
25.6 |
75 |
5 |
20000117 |
. |
. |
. |
. |
. |
. |
. |
. |
. |
. |
. |
|
I
can generate maps of relative vorticity for each day from
the netcdf file but cannot plot the clump number in the
corresponding relative vorticity map at the respective
latitude-longitude position as given in the ascii file. I can
do it manually though using "label" command one at a time.
Can
anyone please advice how I can automate it as I will be
dealing with a large number of files.
Your
help will be very much appreciated.
Thanks.
Savin
|