[ncl-talk] Ease grid map is misaligned

Ipshita Majhi ipmajhi at alaska.edu
Wed Jun 1 17:33:37 MDT 2016


Dear NCL,

I have been trying to plot this map correctly for a long time. I don't know
where I am going wrong. I will be grateful if you could guide me on this. I
am also attaching the pdf version of the map I am getting.

Best Regards
Ipshita
;***************************************************
;*******************************************
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"
;*******************************************

;============================================
; set up parameters
;============================================

;********************************************
;This is reading in Snow water equivalent which goes from 0 to 250 mm
; from 1982 to 2012
;********************************************

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

swe_FillValue=-9.99e+08

printVarSummary(swe)

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

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

;*******************************************
; Create plots
;*******************************************

    wks = gsn_open_wks("pdf","ease_map")
    gsn_define_colormap(wks,"amwg")             ; Change color map

    res                     = True              ; Plot modes desired.
    res at gsnMaximize         = True              ; Maximize plot

;---This resource not needed in V6.1.0
    res at gsnSpreadColors     = True              ; use full range of colormap

    res at cnFillOn            = True              ; color plot desired
    res at cnLinesOn           = False             ; turn off contour lines
    res at pmLabelBarWidthF    = 0.9               ; make wider
    res at pmLabelBarHeightF   = 0.1               ; default is taller
    res at lbLabelFontHeightF  = .018              ; default is HUGE

    res at cnLevelSelectionMode= "ExplicitLevels" ; set explicit contour levels
    res at cnLevels            = (/0,1,5,10,25,100,200,300,400/)

;************************************************
;No georeferencing: simple contour. Draws faster
;************************************************
    res at tiMainString = "gsn_csm_contour"
    plot = gsn_csm_contour(wks,swe,res)    ; contour, no map

;*******************************************
; georeferencing: plot on polar projection
;*******************************************
                                             ; georeference
    swe at lat2d = a->lat
    swe at lon2d = a->lon

    res at trGridType = "TriangularMesh"        ; allow missing coordinates

    res at gsnPolar   = "NH"                          ; specify the hemisphere
    res at mpMinLatF  = 35
    res at tiMainString = "gsn_csm_contour_map_polar"

    plot = gsn_csm_contour_map_polar(wks,swe(0,:,:),res)


-- 
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/20160601/ac4283ed/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ease_map.pdf
Type: application/pdf
Size: 2152040 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160601/ac4283ed/attachment-0001.pdf 


More information about the ncl-talk mailing list