爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 9893|回复: 13

olr与风场做回归问题

[复制链接]

新浪微博达人勋

发表于 2022-4-27 09:26:41 | 显示全部楼层 |阅读模式

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

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

x
请教各位大佬,想将滤波之后的olr和风场做回归应该如何处理呢?例子如下图,应该将u和v分别计算吗,回归的函数可以使用ncl里面的regCoef_n函数嘛?如有回答感激不尽!
8.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2022-5-15 20:22:18 | 显示全部楼层
310030613 发表于 2022-4-28 13:56
我也有这个疑虑,请问某指数和风场用regCoef算出回归系数以后,如何将回归的矢量画出来呢?回归返回的结果 ...

就是这个指数要分别和U、V回归然后用回归后的UV数据画矢量图,我的程序仅供参考,我画的是OLR经过EOF分析之后的PC1与OLR回归并且叠加PC1和UV回归之后的风场
begin
  f1 = addfile("/home/mars/Liubs/QBWO_PC_INDEX.nc","r")
   x = (f1->PC1)
  ;print(x)
  f2 = addfile("/home/mars/Liubs/lunwen/processing data/10-20olr.nc","r")

    time = (f2->time)
    time@units  = "hours since 1800-01-01 00:00:0.0"

; Convert to UTC time.

   time_ut  = cd_calendar(time,0)

; Store return information into more meaningful variables.

    ;year   = time_ut(:,0)  ; Convert to integer for

    month   = time_ut(:,1)  ; Convert to integer for

; print(year)

   indtime = ind((month.ge.6).and.(month.le.11))
  
   y = f2->olr(indtime,:,:)

    rc   = regCoef_n(x, y, 0, 0) ; rc(nlat,mlon)
    ;print(rc)
    rc!0   = "lat"    ; name dimensions
    rc!1   = "lon"
    rc&lat = y&lat    ; assign coordinate values to named dimensions
    rc&lon = y&lon
    tval = onedtond(rc@tval , dimsizes(rc))
    tval@FillValue=  -9.96921e+36
    tval!0   = "lat"    ; name dimensions
    tval!1   = "lon"
    tval&lat = y&lat
    tval&lon = y&lon
    tval = onedtond(rc@tval , dimsizes(rc))   ;t-statistic
    df   = onedtond(rc@nptxy, dimsizes(rc)) - 2  ;自由度
    b = tval    ; b must be same size as tval (and df)
    b    = 0.5          ; b must be same size as tval (and df)
    prob  = betainc(df/(df+tval^2),df/2.0,b)
    prob!0   = "lat"    ; name dimensions
    prob!1   = "lon"
    prob&lat = y&lat
    prob&lon = y&lon   ; assign coordinate values to named dimensions
   ;print (prob)
   rc@long_name   = "regression coefficient"
   prob@long_name = "probability"
  f2 = addfile ("/home/mars/Liubs/QBWO-PC1_U-anormal.nc", "r")
  f3 = addfile ("/home/mars/Liubs/QBWO-PC1_V-anormal.nc", "r")

  u = (f2->uwnd(:,:))
  v = (f3->vwnd(:,:))
;*******************************************
;  plots
;*******************************************

   wks = gsn_open_wks ("png", " QBWO-PC1&UV1")
  
;;set contour;;
   res                     = True
   res@gsnAddCyclic           = False
   res@gsnLeftString          =  ""
   res@gsnRightString         =  ""
   res@tiYAxisString          =  ""
   res@tiMainString           =  "QBWO"
   res@cnFillOn               =  True
  ;res@cnFillMode             =  "AreaFill"
   res@cnFillPalette          =  "BlueDarkRed18"
   res@cnFillColor            =  True
   ;res@cnMonoFillColor        =  False
   res@cnLinesOn              =  False
   ;res@cnLineThicknessF       =  2
   res@cnLineLabelsOn         =  False
   res@mpMinLatF              =  0
   res@mpMaxLatF              =  50
   res@mpMinLonF              =  100
   res@mpMaxLonF              =  180
   res@cnLevelSelectionMode   =  "AutomaticLevels"
   ;res@lbBoxMinorExtentF    = 0.15
   res@pmLabelBarWidthF            = 0.6
   res@pmLabelBarHeightF           = 0.08
   res@pmLabelBarOrthogonalPosF    = 0.1
   res@lbLabelFontHeightF          = 0.01
   res@lbLabelAngleF               = 0

  res2 = True
  res2@gsnDraw = False
  res2@gsnFrame = False
  res2@cnFillOn = True
  res@cnLinesOn = False
  res2@cnLineLabelsOn = False
  res2@cnInfoLabelOn = False
  res2@lbLabelBarOn = False
  res2@cnMonoFillPattern = False
  res2@cnLevelSelectionMode = "ExplicitLevels"
  res2@cnLevels = (/0.05/)                       ;; set to significance level
  res2@cnFillPatterns = (/17,-1/)
  res2@cnFillColors = (/1,0/)
  res2@gsnLeftString = ""


   gsn_define_colormap(wks,"BkBlAqGrYeOrReViWh200")
        res                = True
        res@gsnDraw        = False
        res@gsnFrame       = False
        res@gsnMaximize    = True
        res@tmXTOn         = False
        res@tmYROn         = False
        res@gsnLeftString  = ""
        res@gsnRightString = ""
        
;;set map;;
        mpres                             = res
        mpres@mpDataSetName               = "Earth..4"
        mpres@mpDataBaseVersion           = "MediumRes"
        mpres@mpOutlineOn                 = True
        mpres@mpGeophysicalLineThicknessF = 2
        mpres@mpNationalLineThicknessF    = 2
        mpres@mpFillDrawOrder             = "PostDraw"
        mpres@mpFillOn                    = False
      
;;set area;;

        mpres@mpMinLatF                   = 0
        mpres@mpMaxLatF                   = 50
        mpres@mpMinLonF                   = 100
        mpres@mpMaxLonF                   = 180
        
;;set vector;;
         res_vc                            = True
        res_vc@vcGlyphStyle               = "LineArrow"
        res_vc@vcLineArrowThicknessF      = 2.5
        res_vc@vcMinDistanceF             = 0.025
        res_vc@vcRefLengthF               = 0.02
        res_vc@vcGlyphStyle               = "CurlyVector"
        res_vc@vcMinFracLengthF           = 0
        res_vc@vcRefMagnitudeF            = 2.0
        res_vc@vcRefAnnoOn               = True
        res_vc@vcRefMagnitudeF           = 1
        res_vc@vcRefAnnoString1          = "1"
        res_vc@vcRefAnnoSide             = "Top"
        res_vc@vcRefAnnoString2On        = False
        res_vc@vcRefAnnoPerimOn          = False
        res_vc@vcRefAnnoOrthogonalPosF   = -0.12
        res_vc@vcRefAnnoParallelPosF     = 0.999
       ;res_vc@vcRefAnnoBackgroundColor  = "Purple"
        res_vc@vcVectorDrawOrder         = "PostDraw"
        res_vc@gsnLeftString            = ""

      txres                       = True
      txres@txFontHeightF         = 0.02
      txres@txFontColor           = "black"
      txres@txPerimOn               = True
      txres@txPerimColor            = "black"
      txres@txBackgroundFillColor = "White"
      txres@txFontOpacityF        = 0.8
      txres@txFontThicknessF      = 5.0
      

;;plot;;
        map     = gsn_csm_map(wks,mpres)
        vector  = gsn_csm_vector(wks,u,v,res_vc)
       plot1 = gsn_csm_contour(wks,rc, res)
       plot2 = gsn_csm_contour(wks,prob,res2)
       dum = gsn_add_text(wks,(/map/),"(a)PC1-OLR-UV",110,47,txres)
;;overlay filled contours and vectors on the map;;
        overlay(map,plot1)
        overlay(map,plot2)
        overlay(map,vector)
        overlay(plot1,plot2)
;;drawing "map" will draw everything: map, contours, vectors, and text;;
        draw(map)
        frame(wks)
end
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

发表于 2022-4-27 10:41:48 | 显示全部楼层
不太明白你的意思,是风场回归至OLR做的一个指数吗?还是风场点对点回归至OLR?
是需要分别计算的,是reg_coef
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-4-27 10:56:01 | 显示全部楼层
massage 发表于 2022-4-27 10:41
不太明白你的意思,是风场回归至OLR做的一个指数吗?还是风场点对点回归至OLR?
是需要分别计算的,是reg_ ...

啊啊感谢回复!其实我也还不太理解,我的毕业论文导师让我把滤波后的olr、u、v场做回归之后画到一张图里面,就是这个范例,可以看出大气振荡的一个变化情况这样子,感觉我需要学习的还有好多哈哈,我猜应该是风场点对点回归吧?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-4-27 11:04:27 | 显示全部楼层
什夜0.0 发表于 2022-4-27 10:56
啊啊感谢回复!其实我也还不太理解,我的毕业论文导师让我把滤波后的olr、u、v场做回归之后画到一张图里 ...

如果是点对点的话就把两个三维变量放进r函数里,对时间进行回归。

但我觉得用olr和风场点对点的意义不大,应该pattern对pattern,可不可以考虑把OLR做EOF的PC与风场进行回归,这样是不是更能反应ISO?可以参考一下MJO指数的定义
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-4-27 11:15:16 | 显示全部楼层
massage 发表于 2022-4-27 11:04
如果是点对点的话就把两个三维变量放进r函数里,对时间进行回归。

但我觉得用olr和风场点对点的意义不 ...

嗯嗯我觉得你说的有道理!我看的文献里面好多都用到了这个方法,但是我可能不够时间分析八个位相所以老师就让我分析一下olr时间序列为正和为负的正负位相,这样子也可以做eof分析然后pc和风场回归嘛
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-4-27 11:19:19 | 显示全部楼层
什夜0.0 发表于 2022-4-27 11:15
嗯嗯我觉得你说的有道理!我看的文献里面好多都用到了这个方法,但是我可能不够时间分析八个位相所以老师 ...

我不是做MJO的所以不清楚是否用正负两个位相就能完全代表MJO,但就指数分正负两个位相来看的话是没有问题的。不过序列为正和为负应该是做的合成分析。

先做EOF得到PC,然后按照阈值挑选正负位相年份进行合成
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-4-27 11:25:05 | 显示全部楼层
massage 发表于 2022-4-27 11:19
我不是做MJO的所以不清楚是否用正负两个位相就能完全代表MJO,但就指数分正负两个位相来看的话是没有问题 ...

喔喔喔!我明白一些了我试着做一下eof分析吧,太感谢啦!好人一生平安!
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-4-28 13:56:04 | 显示全部楼层
我也有这个疑虑,请问某指数和风场用regCoef算出回归系数以后,如何将回归的矢量画出来呢?回归返回的结果:rc是一个数,那结果图像上的矢量风场又是什么意思呢?求赐教
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-5-2 13:19:28 来自手机 | 显示全部楼层
310030613 发表于 2022-04-28 13:56
我也有这个疑虑,请问某指数和风场用regCoef算出回归系数以后,如何将回归的矢量画出来呢?回归返回的结果:rc是一个数,那结果图像上的矢量风场又是什么意思呢?求赐教

我也想问这个
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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