[ncl-talk] trend_query

Kunal Bali kunal.bali9 at gmail.com
Mon Jan 2 03:01:48 MST 2017


Dear NCL users,

I have the data with time steps > 1000

I want to plot the spatial map of trend analysis of the given dataset.
So I tried the script given below for getting the desired plot but couldn't
successed.

the given error is


*fatal:regCoef: The rightmost dimension of x must be at least
2fatal:["Execute.c":8567]:Execute: Error occurred at or near line 32 in
file trend.ncl*

Could anyone please help me out



   tmp  = a->SWTNTCLR
   ts   = tmp(time|:,lat|:,lon|:)               ; reorder variable

   delete(tmp)                                  ; no longer needed

;************************************************
; create x and calculate the regression coefficients (slopes, trends)
;************************************************
   time         = ts&time                       ; days since 1850-01-01
   rc           = regCoef(time,ts)

   rc at long_name = "regression coefficient (trend)"
   rc at units     = ts at units+"/day"
;   copy_VarCoords(ts(:,:,0), rc)                ; copy lat,lon coords


;************************************************
; plotting parameters
;************************************************
   wks  = gsn_open_wks("ps" ,"regress")
   gsn_define_colormap(wks,"ViBlGrWhYeOrRe")    ; choose colormap

   res                       = True
   res at gsnMaximize           = True             ; make large

   res at cnFillOn              = True             ; turn on color
   res at cnLinesOn             = False            ; turn off contour lines
   res at cnLineLabelsOn        = False            ; turn off contour line
labels
 ;;res at cnFillMode            = "RasterFill"

;   res at cnLevelSelectionMode  = "ManualLevels"   ; set manual contour levels
;   res at cnMinLevelValF        =  -1.00           ; set min contour level
;   res at cnMaxLevelValF        =   1.00           ; set max contour level
   res at cnLevelSpacingF       =   0.10           ; set contour interval
;
   res at mpFillOn              = False            ; turn off default
background gray
 ;  res at mpCenterLonF          = 210

   res at tiMainString          = fili
   plot = gsn_csm_contour_map_ce(wks,rc,res)
  end








Regards
Kunal Bali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170102/49108d20/attachment.html 


More information about the ncl-talk mailing list