please help me calculate the frequency

na na romrom1977 at YAHOO.COM
Thu Dec 14 19:42:44 EST 2006


Thank you very much for your ideas.
  What I was trying to do is to make a bar plot for NYC and to show how many days during these 20 years have higher than normal temperatures or precipitation.
  I think I can figure out a way to do it based on your sum and mask idea.
  Thank you,


  Mary Jo Nath <Mary-Jo.Nath at NOAA.GOV> wrote:
  Diana,

I'm not exactly sure what you are trying to do. But maybe this example will help you figure a solution.
Ex:
Say you have a lat-lon grid, temp, which has 20*365 (=7300) days of data, and you just want to sum up the number of days over that period at each grid point when the temperature was > 300. You could do something like:

'define ndays = sum( maskout(temp/temp,temp-300.), t=1,t=7300)'

"sum" is a grads function which sums over the dimensions specified. In this case, we sum over time. (Please see the grads documentation for full explanation.)
ndays is a new lat-lon field created by adding the value of one (="temp/temp") for each grid point and day over the period from t =1 to t = 7300 whenever "temp-300" > 0.. (At whichever grid point and time  temp < 300,  maskout will set "temp/temp" = missing for that grid point and time and not included it in the sum).

Does this help?
MJ

na na wrote:     Dear all,
  I am trying to find the frequency of extreme events ( higher than normal temperatures and precipitation) from 20 years of daily .nc data. I don't know how to calculate the frequency so I thouhgt that if I construct a loop through time it would work. So, I tried to construct a loop to pull from these 20 years only values of temperature higher than a certain value (for example tmax > 300K) but it didn't work and I don't know what else to do. Can anyone please please help me with an advice?
  Thank you,

  Diana Pop


---------------------------------
  Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers. begin:vcard
fn:Mary Jo Nath
n:Nath;Mary Jo
org:NOAA / GFDL
adr:;;201 Forrestal Road;Princeton;New Jersey;08542;USA
email;internet:Mary-Jo.Nath at noaa.gov
tel;work:609 452 6648
x-mozilla-html:TRUE
version:2.1
end:vcard




Diana Pop
research assistant
Hunter College, CUNY

---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20061214/cbe3ac2f/attachment.html 


More information about the gradsusr mailing list