calculating linear trend
Sachin Ghude
sachinghude at TROPMET.RES.IN
Tue Apr 3 05:55:18 EDT 2007
Dear all,
I am trying to Calculate linear trend defined by least square fitting from 10 years of
monthly data. For calculating linear trend I have used following method and obtained
the results. ( I have taken help from Bin Guan trend.gs script placed at his website)
However, I am not sure whether above method is correct or I am doing any mistake. Would
somebody please advice me if I am doing any mistake while using following method.
ga->open G:Sno2\start.ctl
Scanning description file: G:sno2\start.ctl
Data file G:\SNO2\%m2%y4.dat is open as file 1
LON set to 0 360
LAT set to -89.875 89.875
LEV set to 1 1
Time values set: 1996:1:1:0 1996:1:1:0
-----------------------------------------------------------
Then I obtained dimension information as
ga->query dims
Default file number is: 1
X is varying Lon = 0 to 360 X = 720.5 to 2160.5
Y is varying Lat = -89.875 to 89.875 Y = 1 to 720
Z is fixed Lev = 1 Z = 1
T is fixed Time = 00Z01JAN1996 T = 1
I used x and y values for linear trend calculation
--------------------------------------------------------------
set t 1 132 (10 years monthly data)
define ones=1
define nno2=tloop(sum(ones,t=1,t+0))+1-1
define nno2=maskout(nno2,maskout(no2,no2)/maskout(no2,no2))
define nno2=ave(ave(nno2,x=720.5,x=2160.5),y=1,y=720)
set t 1
define trendslope=tregr(nno2,maskout(no2,no2),t=1,t=132)
define a=trendslope
set gxout shaded
display a
after running above commands I could obtained the result. However, I am not sure
whether above method is correct or I am doing any mistake.
with regards
Sachin Ghude
More information about the gradsusr
mailing list