- 积分
- 4979
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-3-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
去季节循环及去趋势2022-08-29
ncl数据处理
对于逐月及逐日资料的处理 对于气象资料的基本处理:(1) 若原始资料为逐日资料,则原始的逐日资料减去对应这一日的气候态,就去掉了年循环信号(季节循环:90-365 day),只剩下低频信号。
(2) 若原始资料为逐月资料,则减去对应月份的气候态,就去掉了年循环信号,只剩下年际、年代际等异常信号。
气候态的选取根据你的研究内容,例如做季节内研究一般选择气候态为夏季平均,但有的时候J J A分别作为气候态。
1
clmDayTLLncl中求多年日平均的函数
Calculates long term daily means (daily climatology) from daily data.
💫具体见ncl官网例子:[color=rgba(0, 0, 0, 0.98)]clmDayTLL
Compute the daily climatologies.
The input is mean daily 500 hPa heights spanning 1990-1999.
The values are packed as type short and the time is in units "hours since 1-1-1 00:00:0".
There was no calendar attribute associated with the 'time' dimension/variable.
Hence, a gregorian calendar is assumed.
Still, the example shows how a user might check if the calendar attribute exists and associate it with the required variables.
;;The following library is loaded by default in NCL V6.2.0 and newer;;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" diri = "./" ; input directory fili = "HGT.nc" ; input file f = addfile (diri+fili , "r") ;***********************************************************; Read time and create required yyyyddd ; NOte the tests for a calendar attribute are necessary for non-gregorian calendars;*********************************************************** time = f->time ; time:units = "hours since 1-1-1 00:00:0.0" TIME = cd_calendar(time, 0) ; type float year = toint( TIME(:,0) ) ; toint strips meta datamonth = toint( TIME(:,1) )day = toint( TIME(:,2) ) ; check for calendar attribute if (isatt(TIME,"calendar")) then ; default is gregorian year@calendar = TIME@calendar end ifddd = day_of_year(year, month, day) if (isatt(year,"calendar")) then ; default is gregorian ddd@calendar = year@calendar end ifyyyyddd = year*1000 + ddd ; needed for inputif (isatt(ddd,"calendar")) then ; default is gregorian yyyyddd@calendar = ddd@calendar end if;***********************************************************; Read data: short2flt ;*********************************************************** hgt = short2flt( f->hgt(:,0,:,:) ) ; convert to float printVarSummary( hgt ) ;***********************************************************; Compute daily climatology: raw daily means ;***********************************************************hClmDay = clmDayTLL(hgt, yyyyddd) ; daily climatology at each grid point printVarSummary(hClmDay)
2
calcDayAnomTLL:
💫具体见ncl官网例子:[color=rgba(0, 0, 0, 0.98)]calcDayAnomTLL
Calculates daily anomalies from a daily data climatology.
Compute daily anomalies using a climatology created by clmDayTLL or smthClmDayTLL. The input is daily 500 hPa heights spanning 1990-1999. The values are packed as type short and the time is in units "hours since 1-1-1 00:00:0".
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" diri = "./" ; input directory fili = "HGT.nc" ; input file f = addfile (diri+fili , "r") ;***********************************************************; Read time and create required yyyyddd ;***********************************************************time = f->time ; time:units = "hours since 1-1-1 00:00:0.0" TIME = cd_calendar(time, 0) ; type float year = toint( TIME(:,0) )month = toint( TIME(:,1) )day = toint( TIME(:,2) ) ddd = day_of_year(year, month, day) yyyyddd = year*1000 + ddd ; needed for input;***********************************************************; Read data: short2flt ;*********************************************************** hgt = short2flt( f->hgt(:,0,:,:) ) ; convert to float printVarSummary( hgt ) ;***********************************************************; Compute daily climatology: raw and then 'smoothed' ;***********************************************************hClmDay = clmDayTLL(hgt, yyyyddd) ; daily climatology at each grid point printVarSummary(hClmDay) ;***********************************************************;Compute smoothed daily climatology using 2 harmonics;***********************************************************hClmDay_sm = smthClmDayTLL(hClmDay, 2)printVarSummary(hClmDay_sm);***********************************************************; Compute daily anomalies using raw and smoothed daily climatologies;***********************************************************hAnom = calcDayAnomTLL (hgt, yyyyddd, hClmDay) printVarSummary(hAnom_sm)printMinMax(hAnom, 0)hAnom_sm = calcDayAnomTLL (hgt, yyyyddd, hClmDay_sm) hAnom_sm@long_name = "Anomalies from Smooth Daily Climatology"printVarSummary(hAnom_sm)printMinMax(hAnom_sm, 0)去趋势去趋势是为了消除数据中的线性趋势或高阶趋势,去趋势后的时间序列反应的是气候内部变率。如果不去趋势,可能会得到一个“虚假的”全球变暖的模态,因此在分析前应去趋势,即去掉全球变暖的信号。去趋势和标准化是两个概念,如果要标准化序列是需要再进行标准化的。
dtrend_msg_n
💫具体见ncl官网例子:[color=rgba(0, 0, 0, 0.98)] calcDayAnomTLL
ncl中去趋势去掉的是线性趋势。
|
|