plotting point symbol markers at select grid locations

From: Claudia Walters <ckwalter_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 18 2013 - 18:00:49 MDT

I am trying to plot symbol markers on a series of NARR grid cells based on their latitude/longitude coordinates, but I am getting an error message about an argument type mismatch. When I manually create 1-dimensional arrays for lat and lon, my script works, but when I read in two 1-dim arrays for lat, lon, I get an error message. Eventually, I would like to be able to vary the size of the symbol based on the jet speed. The attached data file only contains a portion of the original file (277x349 grid).

Thanks,
Claudia

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

;***********************************************************************
; read in data file
;***********************************************************************
  flnm = "2009032400ll.txt"
  head = readAsciiHead(flnm,1)
  
  data = asciiread(flnm,-1,"string")
  delim = " "
  nfields = str_fields_count(data, delim)
  
  jet_i = str_get_field(data,1,delim)
  jet_j = str_get_field(data,2,delim)
  jet_lon = str_get_field(data,22,delim)
  jet_lat = str_get_field(data,23,delim)
  u_wnd = str_get_field(data,9,delim)
  v_wnd = str_get_field(data,10,delim)

  dimi = dimsizes(jet_i)
  dimj = dimsizes(jet_j)
  

;***********************************************************************
; set parameters for plots
;***********************************************************************

  wks = gsn_open_wks ("x11", "narr")
  gsn_define_colormap (wks,"gui_default")
  
  res = True
  res@cnFillOn = True
  res@cnFillOpacityF = 0.3
  res@cnLinesOn = True
  res@cnMonoLineColor = False
  res@gsnSpreadColors = True
  res@gsnSpreadColorStart = 4
  res@gsnSpreadColorEnd = -1
  res@mpGridAndLimbOn = False
  res@pmTickMarkDisplayMode = "Always" ;
  res@tmXTOn = False
  res@gsnAddCyclic = False
  res@gsnDraw = False
  res@gsnFrame = False
  res@mpLimitMode = "LatLon"
  res@mpMinLatF = 25.
  res@mpMaxLatF = 50.
  res@mpMinLonF = -125.
  res@mpMaxLonF = -75.
  res@mpDataSetName = "Earth..4"
  res@mpDataBaseVersion = "Ncarg4_1"
  res@mpOutlineBoundarySets = "USStates"
  res@mpOutlineSpecifiers = "Canada"
  res@mpOutlineSpecifiers = "Mexico"
  res@tfDoNDCOverlay = True
  res@mpProjection = "LambertConformal"
  res@mpLambertParallel1F = lat2d@mpLambertParallel1F
  res@mpLambertParallel2F = lat2d@mpLambertParallel2F
  res@mpLambertMeridianF = -100
  res@gsnCenterString = " "
  res@gsnLeftString = "NARR LLJ locations"

;***********************************************************************
; set plotting parameters for points, plot points
;***********************************************************************
  polyres = True
  polyres@gsMarkerIndex = 16
  polyres@gsMarkerSizeF = 5.
  
  ;plot = gsn_csm_contour_map(wks,msl,res)

  points = new(dimi,graphic)
  
  do i=0,dimi-1
    points(i) = gsn_add_polymarker(wks,plot,jet_lon(i),jet_lat(i),polyres)
  end do
    
  draw(plot)
  frame(wks)
  
end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 18 18:01:02 2013

This archive was generated by hypermail 2.1.8 : Tue Mar 19 2013 - 16:31:18 MDT