[ncl-talk] How to correct the co ordinates?

Ipshita Majhi ipmajhi at alaska.edu
Mon Feb 29 12:12:26 MST 2016


Dear NCL,

I want to plot snow cover extent after multiplying it with snow cover area.
Here is the code for it. I am also attaching the figure with this email.

;*******************************************
;Reading in the weekly snow cover extent
;*******************************************

a=addfile("~/Documents/NCL_files/Sea_ice/nhsce_v01r01_19661004_20140602.nc
","r")
sce=a->snow_cover_extent ; The values are either 0 or 1

lat=a->latitude
lon=a->longitude

sce!1="lat"
sce!2="lon"

sce at lat2d=lat
sce at lon2d=lon

;********************************************
:Reading in the snow cover are
;********************************************

sce_area=a->area

sce_area!0="lat"
sce_area!1="lon"

copy_VarAtts(sce,sce_area)
copy_VarCoords_1(sce,sce_area)

;*******************************************
;Muliplying Snow cover extent and Area
;*******************************************

B = new((/2487,88,88/),float)

     do i = 0,2486
      B(i,:,:)=sce(i,:,:)#sce_area(:,:)
      end do

B!0="time"
B!1="lat"
B!2="lon"

B at lat2d=lat
B at lon2d=lon

copy_VarAtts(sce,B)
copy_VarCoords_1(sce,B)

printVarSummary(B)

B at _FillValue = -9


;************************************************
; create plot
;************************************************
  wks = gsn_open_wks("pdf" ,"Snow_cover_area")
  res            = True                          ; plot mods desired
  res at gsnPolar   = "NH"                          ; specify the hemisphere
  plot = gsn_csm_contour_map_polar(wks,B(0,:,:),res)    ; create the plot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160229/a58f9be6/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Snow_cover_area.pdf
Type: application/pdf
Size: 141942 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160229/a58f9be6/attachment.pdf 


More information about the ncl-talk mailing list