[Thread Prev][Thread Next][Index]

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.


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement