[ncl-talk] I am not able to plot corr plot with dtrend data correctly

Ipshita Majhi ipmajhi at alaska.edu
Wed Mar 30 16:43:30 MDT 2016


Dear NCL,

I am able to get a reasonable plot with correlation with out detrending the
data
.When I detrend it then the whole plot is one color.

Here is the printVarSummary of Snow Water Equivalent (SWE_82_12)

Variable: swe_82_12
Type: float
Total Size: 773523408 bytes
            193380852 values
Number of Dimensions: 3
Dimensions and sizes: [time | 372] x [lat | 721] x [lon | 721]
Coordinates:
            time: [ 672..271656]
            lat: [  30.. 750]
            lon: [   0.. 720]

snow water equivalent: min=-2   max=354.662

when the data is detrended the min max is
min=-9.4341e+08   max=1.03525e+09

;Listed below is the whole code
a=addfile("/Users/ipshita/Desktop/GlobsnowV2.0/version02/monthly_82_13.nc
","r")
swe=a->swe

time=a->time
lat=a->lat
lon=a->lon

print(dimsizes(lat))
print(dimsizes(lon))

swe_FillValue=-9.99e+08

utc_date = cd_calendar(time, 0)
year=utc_date(:,0)
month=utc_date(:,1)

;********************************************
;This is to extract 1982-2012 of swe data
;********************************************
swe_82_12=swe(0:371,:,:)
printVarSummary(swe_82_12)

;********************************************

;********************************************
;This is to read in All India Rainfall
;For June,July,August and Sept
;********************************************

JJAS_1871_2012
=asciiread("~/Documents/NCL_files/SST/Monthly/jjas_1871_2012.txt",(/142,1/),"float")

;*******************************************
;Now this is to extract 1982 to 2012
;*******************************************

JJAS_82_12=JJAS_1871_2012(111:141,0)

;*******************************************
;============================================
;Extracting monthly data for sce

Dec_swe = new((/31,721,721/),float)

Dec_swe at _FillValue = -9.99e+08

do nyr=0,371,12

Dec_swe(nyr/12,:,:) =swe_82_12(nyr+11,:,:)

end do

Dec_swe at _FillValue = -9.99e+08

print(dimsizes(Dec_swe))

;=========================================
Dec_reorder=Dec_swe(lat|:,lon|:,time|:)

printMinMax(Dec_reorder,False)
Dec_reorder at _FillValue =-9.99e+08

Dec_dt=dtrend(Dec_reorder,False)

printMinMax(Dec_dt,False)
corr_Dec=esccr(Dec_dt,JJAS_82_12,1)


;************************************************
; create plot
;************************************************

wks = gsn_open_wks("x11","SWE_Dec_JJAS")               ;
gsn_define_colormap(wks,"BlueRed")

 res = True
  res at tiMainString         = "SWE" ; plot title
 res at gsnAddCyclic        = False          ; Don't add a cyclic point.
  res at cnFillOn             = True               ; turns on the color
  res at cnLinesOn            = False              ; turn off contour lines
 res at cnLevelSelectionMode = "ManualLevels"     ; set manual contour levels

  plot = gsn_csm_contour(wks,corr_Dec(:,:,1),res)
;=================================================

printMinMax(corr_Dec,False)


On Wed, Mar 30, 2016 at 2:41 PM, Ipshita Majhi <ipmajhi at alaska.edu> wrote:

> Dear NCL,
>
> I am able to get a reasonable plot with correlation with out detrending
> the data
> .When I detrend it then the whole plot is one color.
>
> Here is the printVarSummary of Snow Water Equivalent (SWE_82_12)
>
>
>
>


-- 
Ipshita Majhi
PhD Candidate
University of Alaska , Fairbanks
Atmospheric Science Department
(907)978-4220 ipmajhi at alaska.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160330/d3ba8b0b/attachment.html 


More information about the ncl-talk mailing list