Polyline Trouble with NARR data

From: DJ Rasmussen <dj.rasmussen_at_nyahnyahspammersnyahnyah>
Date: Tue, 04 Aug 2009 13:47:54 -0500

Ncl Support Group,

I am trying to plot lat/lon gridlines to show the NARR
resolution on a map, but it seems some extra unwanted
polylines appear in one half of the plot. Any ideas to
why this is? I have attached a post script file.

Cheers,

DJ Rasmussen

Code (NCL v. 5.1.1)

*************************************************************

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"

begin

;****************************************************************
;Open Files
;****************************************************************

   CtmDir = "/home/rasmussen/NARCCAP/NARR/grib/"
   appl = "narrmon-a_221_20000101_0000_000"
   f = addfile(CtmDir+appl+".grb","r")
   LAT2d = f->gridlat_221
   LON2d = f->gridlon_221
   nlat = dimsizes(LAT2d(:,0))
   nlon = dimsizes(LON2d(0,:))

   dum1 = new(nlat,graphic) ; Create arrays to hold dummy
objects.
   dum2 = new(nlon,graphic)

;****************************************************************
;Map Parameters
;****************************************************************

   wks = gsn_open_wks("ps","CaliforniaMap")

   res = True
   res_at_gsnFrame = False ; So we can
draw markers
   res_at_gsnDraw = False
   res_at_gsnMaximize = True

   res_at_gsnMaximize = True
   res_at_mpFillOn = True
   res_at_mpSpecifiedFillColors = 22
   res_at_mpFillAreaSpecifiers = (/"California"/)

   res_at_mpDataBaseVersion = "mediumres"
   res_at_mpDataSetName = "Earth..4"

   res_at_mpGridAndLimbOn = False
   res_at_mpPerimOn = True
   res_at_mpOutlineDrawOrder = "PostDraw"
   

   res_at_mpMinLatF = 32.
   res_at_mpMaxLatF = 43.
   res_at_mpMinLonF = -125.
   res_at_mpMaxLonF = -114.

   res_at_tmXBLabelFontHeightF = 0.01 ;
resize tick labels
   res_at_tmYLLabelFontHeightF = 0.01
   res_at_tmXTOn = False
   res_at_tmYROn = False

   res_at_tiMainFontHeightF = 0.018
   ;res_at_tiMainString = ":F22:California and its
Wind Farms"
   
;****************************************************************
;Draw Map
;****************************************************************

   map = gsn_csm_map(wks,res)

;************************************************
; draw latitude lines
;************************************************
   do i=0,nlat-1,1
      dum1(i) =
gsn_add_polyline(wks,map,LON2d(i,:),LAT2d(i,:),gsres)
    end do

;************************************************
; draw longitude lines
;************************************************
   do i=0,nlon-1,1
      dum2(i) =
gsn_add_polyline(wks,map,LON2d(:,i),LAT2d(:,i),gsres)
    end do

draw(map)
frame(wks) ; Advance the frame

end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Aug 04 2009 - 12:47:54 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 05 2009 - 20:36:03 MDT