[Thread Prev][Thread Next][Index]
RE: [ferret_users] Picking the time corresponding to maximum value of a variable from an nc file
Dear Hein Zelle,
Thanks for the suggestion.
I have done exactly what you said, though I did not understand why you are doing
! limit to one point only
?set region /i=100/j=50
I paste below the result of the commands.
yes? sh d
currently SET data sets:
1> ./Hs_timeseries.nc (default)
name title I J K L
HS HS_CM/100 ... ... ... 1:2919
yes? sh gr hs
GRID GGE1
name axis # pts start end
normal X
normal Y
normal Z
TAXIS TIME 2919 r 01-JAN-2009 02:57 31-DEC-2009 20:57
yes? let zero_at_max=hs[t=@max]-hs
yes? let maxtval=zero_at_max[t=@loc:0.0]
yes? set region/i=100/j=50
yes? let dummy=t[gt=hs,t=`maxtval`]
!-> DEFINE VARIABLE dummy=t[gt=hs,t=954690]
yes? let tstring=`dummy,return=tend`
!-> DEFINE VARIABLE tstring=12-DEC-2009 17:57:00
**ERROR: command syntax: 12-DEC-2009 17:57:00
illegal character: :
The time corresponding to the maximum of Hs is actually 12-DEC-2009 17:57:00 (I checked this). But it seems that I can't list this time using ferret. I don't understand why a command syntax error should come here.
yes? list tstring
**ERROR: variable unknown or not in data set: TSTRING
Though my purpose is served temporarily, I am curious to know the cause of the error. Any inputs?
Regards,
********************************************************************************************************
Sandhya K G
Scientist
INDIAN NATIONAL CENTRE FOR OCEAN INFORMATION SERVICES
(Ministry of Earth Sciences, Govt. of India)
"Ocean Valley", Pragathi Nagar (B.O), Nizampet (S.O), HYDERABAD-500 090.
Ph : +91-40-23886036 (Work : 0900-1730hrs)
+91-8019596800 (Mobile)
FAX : + 91-40-23892910
url: http://www.incois.gov.in
********************************************************************************************************
________________________________________
From: owner-ferret_users@xxxxxxxx [owner-ferret_users@xxxxxxxx] On Behalf Of Hein Zelle [hein.zelle@xxxxxxxxxxxxx]
Sent: Wednesday, January 23, 2013 4:01 PM
To: Ferret users mailing list
Subject: Re: [ferret_users] Picking the time corresponding to maximum value of a variable from an nc file
HI Sandhya,
> yes? list hs[l=1:2919@loc:2.2]
> VARIABLE : TIME of 2.2 in HS_CM/100 (HOURS)
> FILENAME : Hs_timeseries.nc
> TIME : 01-JAN-2009 01:27 to 31-DEC-2009 22:27 (location of 2.2)
> 954690.
>
> yes? list t[gt=hs]
Once you have the index, you can print the time value (or put it in a
variable) with
let mytimestring = `t[gt=hs,l=954690],return=tstart`
You can't use recursive backticks, so I usually do this in a few
steps. I define a new variable which is zero at the maximum so you
can use a fixed value (0.0) for @loc.
let zero_at_max = myvar[t=@max] - myvar
let maxtval = zero_at_max[t=@loc:0.0]
! limit to one point only
set region /i=100/j=50
let dummy = t[gt=myvar,t=`maxtval`]
let tstring = `dummy,return=tend`
Note that my example dataset insists on returning the 't' value with
@loc, not the 'l' index. This is why I used t=`maxtval` instead of
l= .
Kind regards,
Hein Zelle
--
Dr. Hein Zelle
Senior consultant meteorology & oceanography
Tel: +31 (0)527-242299
Fax: +31 (0)527-242016
E-mail: hein.zelle@xxxxxxxxxxxxx
Website: www.bmtargoss.com
BMT ARGOSS b.v.
Voorsterweg 28, 8316 PT Marknesse, the Netherlands
Postal address: P.O. Box 61, 8325 ZH Vollenhove, the Netherlands
Registered in The Netherlands, Registered no. 39060160.
Unless otherwise agreed by BMT ARGOSS in writing, all work,
services, goods or products supplied by BMT ARGOSS shall be subject
to and governed by BMT ARGOSS' own terms and conditions which are
available for inspection from BMT ARGOSS on request.
----Confidentiality Notice & Disclaimer----
The contents of this e-mail and any attachments are intended for the
use of the mail addressee(s) shown. If you are not that person, you
are not allowed to read it, to take any action based upon it or to
copy it, forward, distribute or disclose the contents of it and you
should please delete it from your system. BMT ARGOSS does not accept
liability for any errors or omissions in the context of this e-mail or
its attachments which arise as a result of internet transmission, nor
accept liability for statements which are those of the author and
clearly not made on behalf of BMT ARGOSS.
Email secured by Check Point
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement