[gradsusr] Find maximum at a point over a time period.
Marsh, Kieren
k.marsh at geos-uae.com
Wed Oct 17 07:13:15 EDT 2012
Thanks for your detailed response Davide, it's just what I was looking for.
Would you, or any other GrADS users know the server-side notation to do the same calculations as below?
I've never really got to grips with server-side notation, but in my case as I'm dealing with a fairly large data set on a remote server, the client side code below takes a while to come up with the final answer.
Thanks again
Kieren
-----Original Message-----
From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Davide Sacchetti
Sent: 17 October 2012 13:41
To: GrADS Users Forum
Subject: Re: [gradsusr] Find maximum at a point over a time period.
suppose you fixed X and Y at your location
suppose you have 41 time steps (actually your are much more but it's the
same)
first question
ga-> d max(t2,t=1,t=41)
MAXing. dim = 3, start = 1, end = 41
Result value = 295.123
so you got max value
ga-> d maxloc(t2,t=1,t=41)
MAXLOCing. dim = 3, start = 1, end = 41
Result value = 19
so you got when: maximum occured at t = 19
second question
suppose you want to find out how many times your T exceeded 292K (eg.: 5
times)
* maskout(t2,t2-292) shows you only values > 292
* const(maskout(t2,t2-292),1) shows you '1' only when values > 292
* const(const(maskout(t2,t2-292),1),0,-u) shows you '1' only when
values > 292, 0 otherwise
* sum(const(const(maskout(t2,t2-292),1),0,-u),t=1,t=41) is your
answer
ga-> d sum(const(const(maskout(t2,t2-292),1),0,-u),t=1,t=41)
SUMing. dim = 3, start = 1, end = 41
Result value = 5
it should help ...
bye bye
Davide
On Wed, 2012-10-17 at 12:21 +0400, Marsh, Kieren wrote:
> Dear GrADS users
>
>
>
> I have an hourly data set that spans about 7 months and I want to find
> the absolute maximum temperature at a given point and I also want to
> find out when that occurred.
>
>
>
> Also is it possible to find the number of times the temperature
> exceeds a given value at a point and to find the corresponding times
> for each exceedence?
>
>
>
> Can anyone, who has a better understanding of the max() function help
> me with this? I know the ordering of the nesting matters, but I’m not
> sure exactly how.
>
>
>
> Thanks in advance.
>
>
>
> Kieren
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
--
--> Attenzione cambio indirizzo: davide.sacchetti at arpal.gov.it
--
Davide Sacchetti
Centro Funzionale Meteo Idrologico di Protezione Civile della Regione Liguria
ARPAL Unità Tecnica Complessa di livello Regionale
V.le Brigare Partigiane 2 16121 Genova (I)
tel: +39 010 6437535 fax: +39 010 6437520
mail: davide.sacchetti at arpal.gov.it web: www.meteoliguria.it
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
More information about the gradsusr
mailing list