Re: overlay trajectory on satellite map

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 20 2011 - 09:20:29 MDT

Hello,
Try changing this:
plot_rad = gsn_csm_contour_map(xwks,data_4,res)
to this:
plot_rad = gsn_csm_contour(xwks,data_4,res)

You are not allowed to overlay a plot created via any of the gsn_*_map
routines onto another plot. The plot to be overlaid should be created
with a function that is not drawing data over a map....

Let the group know if that doesn't solve your issue...
Adam

On 04/20/2011 04:15 AM, Avel O wrote:
> Hello,
>
> I try to overlay a trajectory from an ascii file on a AIRS radiance map.
> I get "fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay
> plot member" when I run the script and I only get the trajectory on the
> background map. Here is my script:
>
> load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
> eos_file=addfile("AIRS.2010.02.15.210.L1B.AIRS_Rad.v5.0.0.0.G10047121641.hdf.he2",
> "r") ; Read file.
>
> data=eos_file->radiances_L1B_AIRS_Science(:,:,0) ; read specific subset
> of data field
>
> data_4=eos_file->radiances_L1B_AIRS_Science(:,:,668) ; read specific
> subset of data field
> data_4@lat2d=eos_file->Latitude_L1B_AIRS_Science ; associate longitude
> and latitude
> data_4@lon2d=eos_file->Longitude_L1B_AIRS_Science
> data_4@_FillValue=-9999 ;
>
> ball = asciiread("../Bal/ts10V01N33.dat",(/32762,30/),"float")
> longi = ball(18363:21243,7)
> longi@_FillValue=999
> lati = ball(18363:21243,8)
> lati@_FillValue=999
>
> xwks=gsn_open_wks("ps","radtraj") ; open workstation
>
> res=True ; plot mods desired
> res@cnFillOn=True ; enable contour fill
> res@gsnMaximize=True; make plot large
> res@gsnPaperOrientation = "portrait" ; force portrait orientation
> res@cnLinesOn=False ; turn off contour lines
> res@cnLineLabelsOn = False; turn off contour line labels
> res@gsnSpreadColors=True ; use the entire color spectrum
> res@lbOrientation="vertical" ; vertical labels
> res@cnMissingValFillPattern = 0 ; missing value pattern is set to
> "SolidFill"
> res@cnMissingValFillColor=0; white color for missing values
>
> res@mpProjection = "CylindricalEquidistant" ; choose map projection
> "Satellite"
> res@mpCenterLonF = 65. ; choose center lon
> res@mpCenterLatF = -10. ; choose center lat
> res@mpLimitMode = "LatLon" ; required
> res@mpMinLatF = -30. ; min lat
> res@mpMaxLatF = 0. ; max lat
> res@mpMinLonF = 50. ; min lon
> res@mpMaxLonF = 80. ; max lon
>
> res@pmTickMarkDisplayMode = "Always" ; turn on automatic tickmarks
> res@mpGridAndLimbOn = True ; turn on lat/lon lines
> res@mpGridMaskMode = "MaskLand" ; Mask grid over land.
> res@gsnMaximize = True ; enlarge plot
> res@gsnAddCyclic = False
>
> res@cnLevelSelectionMode="ManualLevels" ; preset range defined to ensure
> uniform color legend across all levels
> res@cnLevelSpacingF=6 ; set interval
> res@cnMinLevelValF=10 ; set min and max values
> res@cnMaxLevelValF=88 ;
>
> res@gsLineThicknessF = 2.0
> res@gsLineColor = "black"
> res@gsnDraw = False ; don't draw yet
> res@gsnFrame = False
> res@mpFillDrawOrder = "PostDraw" ; draw continental outline last
> res@mpOutlineDrawOrder = "PostDraw" ; draw the map outline last
> res@mpGridAndLimbDrawOrder= "PostDraw" ; areas before map gets set
> res@mpPerimDrawOrder = "PostDraw" ; areas before map gets set
>
> plot = gsn_csm_map(xwks,res)
> gsn_polyline(xwks,plot,longi,lati,res)
>
> gsn_define_colormap(xwks,"amwg") ; define colormap
>
> plot_rad = gsn_csm_contour_map(xwks,data_4,res)
>
> overlay(plot, plot_rad)
> draw(plot)
> frame(xwks)
> delete(plot) ; cleaning up resources used
> delete(data)
> delete(data_4)
> delete(res)
>
> delete(eos_file)
> end
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 20 09:20:50 2011

This archive was generated by hypermail 2.1.8 : Tue May 03 2011 - 14:47:35 MDT