[ncl-talk] Ease grid map is misaligned
Mary Haley
haley at ucar.edu
Wed Jun 1 17:49:08 MDT 2016
Hi Ipshita,
This is indeed strange.
As a quick test, can you try (for the gsn_csm_contour_map plot):
res at gsnAddCyclic = False
Also, are you getting any kind of error messages?
You can also try using raster contours:
res at cnFillMode = "RasterFill"
If you continue to have problems, we may need to take a look at your data,
and in particular the lat/lon arrays on the file. It looks like you are
doing everything correctly otherwise.
--Mary
On Wed, Jun 1, 2016 at 5:33 PM, Ipshita Majhi <ipmajhi at alaska.edu> wrote:
> 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
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160601/bf370aa7/attachment.html
More information about the ncl-talk
mailing list