overlay trajectory on satellite map

From: Avel O <avel.o_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 20 2011 - 04:15:28 MDT

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
Received on Wed Apr 20 04:15:38 2011

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