Re: Trend of SST for each month

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 27 2011 - 16:11:50 MST

Hi Soumik,
Looking at your code, you are calculating, saving, and plotting a trend
line. Assuming that you want a trend line for each month separately, you
will need to loop through each month:

; This assumes your sst's start in January and end in December.
  ztim = dimsizes(sst_region)
  x = ispan(0,ztim/12-1,1)*1.
  data = new ( (/12,2,dimsizes(x)/), typeof(sst))
  do gg = 0,11
     rc = regline(x,sst_region(gg::12))
     data(gg,0,:) = sst_region(gg::12)
     data(gg,1,:) = rc*(x-rc@xave) + rc@yave
     delete(rc) ; optional
  end do

Hope that helps..
Adam

On 01/27/2011 03:48 PM, sbasu@iarc.uaf.edu wrote:
> Hi,
>
> I am attaching my code which is doing everything except trend for a month.
> Currently I am getting a trend for all 1691 months.
> Is there any way to calculate monthly trend for each month?
>
> Thanks,
> Soumik
>
> sbasu@iarc.uaf.edu wrote:
>> Hi,
>>
>> Thanks for the reply. I am sorry I did not understand how will I get trend
>> for each month separately from this.
>>
>> Thanks,
>> Soumik
>>
>> Adam Phillips wrote:
>>> Hi Sounmik,
>>> To do what you want, you will need to use the following functions:
>>>
>>> wgt_areave_Wrap
>>> http://www.ncl.ucar.edu/Document/Functions/Contributed/wgt_areaave_Wrap.shtml
>>>
>>> dtrend_n or dtrend_msg_n
>>> http://www.ncl.ucar.edu/Document/Functions/Built-in/dtrend_n.shtml
>>> http://www.ncl.ucar.edu/Document/Functions/Built-in/dtrend_msg_n.shtml
>>>
>>> The examples on each page are great and show you how to use them. Note
>>> that you use dtrend_n/dtrend_msg_n and use the slope that is returned as
>>> an attribute. (See example #2 on the dtrend_msg_n or dtrend_n page.)
>>> Good luck,
>>> Adam
>>>
>>> On 01/27/2011 02:02 PM, sbasu@iarc.uaf.edu wrote:
>>>> Hi,
>>>>
>>>> I have monthly SST values from which I want to calculate trend of
>>>> average
>>>> SST(so that I have one value for the whole region and I get a XY plot)
>>>> over the Equatorial Pacific for each of the twelve months separately.
>>>> Can anybody please help me.
>>>>
>>>> Thanks,
>>>> Soumik
>>>>
>>>>
>>>
>>> --
>>> __________________________________________________
>>> Adam Phillips
>>> asphilli@ucar.edu
>>> National Center for Atmospheric Research tel: (303) 497-1726
>>> Climate and Global Dynamics Division fax: (303) 497-1333
>>> P.O. Box 3000
>>> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>> --
>> *************************************
>> Soumik Basu
>> Graduate Student, Research Assistant
>> International Arctic Research Center
>> University of Alaska Fairbanks
>> Fairbanks,Alaska,USA
>> **************************************
>>
>>
>> -----------------------------------------
>> This email was sent using SquirrelMail.
>> "Webmail for nuts!"
>> http://squirrelmail.org/
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 27 16:11:54 2011

This archive was generated by hypermail 2.1.8 : Mon Jan 31 2011 - 10:38:24 MST