爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6781|回复: 8

[其他] 傅里叶 Fourier Analysis 运行出错 求助

[复制链接]
发表于 2016-3-14 18:26:08 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
本帖最后由 qq469015280 于 2016-3-14 18:37 编辑

用Fourier Analysis  滤波,官网例子
;----------------------------------------------------------------------
; fanal_3.ncl
;
; Concepts illustrated:
;   - Calculating wave information of a monthly climatology
;---------------------------------------------------------
; Calculate wave information of a monthly climatology
; .  Plot wave numbers 1, 2, 3
;---------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"   
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
  id = "./"
  in = addfile(id+"ERAI.1989-2005.climo.subset.nc","r")  ; climatology: 1989-2005
  z  = in->Z300                               ; (time,lat,lon)  ; ( 12 ,121,240)
  dimz = dimsizes(z)
  nmos = dimz(0)
;****************************************
; Calculate amplitude of each harmonic
;****************************************
                                              ; reorder: ezfftf works on right dim
  CF = ezfftf (z)                             ; ezfftf works on right dim
  printVarSummary(CF)                         ; [2] x [12] x [121] x [120]
  cf = CF
  cf(:,:,:,1:)  = 0.0                         ; set waves 2 and higher to 0.0
  z_wave1 = ezfftb (cf, 0.0)                  ; [12] x [121] x [240]
  copy_VarMeta(z, z_wave1)                    ; [time | 12] x [lat | 121] x [lon | 240]
  cf = CF
  cf(:,:,:,0:0) = 0.0                         ; set wave 1 to 0.0
  cf(:,:,:,2: ) = 0.0                         ; set wave 3 and higher to 0.0
  z_wave2 = ezfftb (cf, 0.0)                  ; [12] x [121] x [240]
  copy_VarMeta(z, z_wave2)                    ; [time | 12] x [lat | 121] x [lon | 240]
  cf = CF
  cf(:,:,:,0:1) = 0.0                         ; set wave 1 and 2 to 0.0                  
  cf(:,:,:,3: ) = 0.0                         ; set wave 4 and higher to 0.0
  z_wave3 = ezfftb (cf, 0.0)                  ; [12] x [121] x [240]
  copy_VarMeta(z, z_wave3)                    ; [time | 12] x [lat | 121] x [lon | 240]
;****************************************
; Create plot
;****************************************
  month   = (/"January","Feb","Mar","Apr","May","Jun"\
             ,"July"   ,"Aug","Sep","Oct","Nov","Dec"/)
  plot    = new (3,"graphic")

  pltType = "ps"
  pltName = "fanal_wave"
  wks     = gsn_open_wks(pltType, pltName)   
  gsn_define_colormap(wks,"BlAqGrYeOrReVi200")

  res                      = True          ; individual plot
  res@gsnDraw              = False
  res@gsnFrame             = False
  res@gsnSpreadColors      = True
  res@cnFillOn             = True          ; turn on color
  res@cnLinesOn            = False         ; turn on line labels
  res@cnLineLabelsOn       = False         ; turn on line labels
  res@lbOrientation        = "vertical"    ; vertical label bar
  res@lbLabelAutoStride    = True          ; choose best stride
  resP                     = True          ; panel resources
;resP@gsnPaperOrientation = "portrait"
  resP@gsnSpreadColors     = True          ; use full range of colormap
  resP@gsnMaximize         = True

  do nmo=0,nmos-1,6
     res@gsnLeftString     = "Wave 1"
     symMinMaxPlt (z_wave1(nmo,:,:),16,False,res)
     plot(0) = gsn_csm_contour_map_ce(wks,z_wave1(nmo,:,:),res)
   
     res@gsnLeftString     = "Wave 2"
     symMinMaxPlt (z_wave2(nmo,:,:),16,False,res)
     plot(1) = gsn_csm_contour_map_ce(wks,z_wave2(nmo,:,:),res)
   
     res@gsnLeftString     = "Wave 3"
     symMinMaxPlt (z_wave3(nmo,:,:),16,False,res)
     plot(2) = gsn_csm_contour_map_ce(wks,z_wave3(nmo,:,:),res)

     resP@txString         = "ERA-Interim: 1989-2005: Z300: "+month(nmo)
     gsn_panel(wks,plot,(/3,1/),resP)
  end do


但是我的数据是海温,缺测是地形,出现以下错误


这种情况应该怎么改啊??
QQ截图20160314182333.png





密码修改失败请联系微信:mofangbao
发表于 2016-3-14 18:40:28 | 显示全部楼层
牛逼!!!!学习了
密码修改失败请联系微信:mofangbao
发表于 2016-3-17 14:59:25 | 显示全部楼层
路过帮顶
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

 楼主| 发表于 2017-1-2 16:00:09 | 显示全部楼层
请问楼主做出来了吗??
也是滤波问题 ,请教
求助 滤波  急~
http://bbs.06climate.com/forum.p ... 2&fromuid=22714
(出处: 气象家园)
密码修改失败请联系微信:mofangbao
发表于 2017-5-5 13:01:20 | 显示全部楼层
請問哪裡可以下載檔案"ERAI.1989-2005.climo.subset.nc", 謝謝
密码修改失败请联系微信:mofangbao
发表于 2017-5-5 13:01:58 | 显示全部楼层
請問哪裡可以下載檔案"ERAI.1989-2005.climo.subset.nc", 謝謝
密码修改失败请联系微信:mofangbao
发表于 2017-5-5 13:02:13 | 显示全部楼层
請問哪裡可以下載檔案"ERAI.1989-2005.climo.subset.nc", 謝謝
密码修改失败请联系微信:mofangbao
发表于 2017-5-11 11:03:18 | 显示全部楼层
请问楼主解决了吗
密码修改失败请联系微信:mofangbao
发表于 2017-11-14 13:05:43 | 显示全部楼层
这里说的是输入的矩阵中不能有missing value,我觉得你不要只用海温数据,用全球的地表温度数据(包括海陆温)计算,最后作图的时候只做海洋上的就行了
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表