load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin nlat = 4137 mlon = 130 lat = latGlobeFo(nlat,"lat","latitude","degrees_north") lon = lonGlobeFo(mlon,"lon","longitude","degrees_east") gbin = new ( (/nlat,mlon/), float ) gknt = new ( (/nlat,mlon/), integer) gbin = 0.0 ; initialization gknt = 0 files = systemfunc("ls MT1SAPSL1A2*") x= dimsizes(files) xNam = "Latitude_Pixels" yNam = "Longitude_Pixels" zNam = "TB_Pixels_S6" do i=0,x-1 a = addfile(files(i),"r") Latn1= a->$xNam$ Lonn1= a->$yNam$ TBn1 = a->$zNam$ Lat11 = tofloat(Latn1@scale_factor)*tofloat(Latn1) + tofloat(Latn1@add_offset) Lon11 = tofloat(Lonn1@scale_factor)*tofloat(Lonn1) + tofloat(Lonn1@add_offset) TB11 = tofloat(TBn1@scale_factor)*tofloat(TBn1) + tofloat(TBn1@add_offset) TB11@_FillValue = 655.35 bin_sum(gbin,gknt,lon,lat \ ,ndtooned(Lon11), ndtooned(Lat11),ndtooned(TB11) ) delete([/Latn1,Lonn1,Lat11,Lon11,TBn1,TB11/]) end do gknt = where(gknt.eq.0 , gknt@_FillValue, gknt) gbin = gbin/gknt gbin!0 = "lat" gbin!1 = "lon" gbin&lat = lat gbin&lon = lon copy_VarCoords(gbin, gknt) ; copy coords vNam = "TB_Pixels_S6" if (isfilevaratt(a, "TB_Pixels_S6", "long_name")) then gbin@long_name = "BINNED: "+vNam gknt@long_name = "BINNED COUNT: "+vNam end if if (isfilevaratt(a, vNam, "units")) then gbin@units = a->$vNam$@units end if ;printVarSummary(gbin) ;print(min(gbin)) ;print(max(gbin)) ;exit wks = gsn_open_wks ("pdf","s6") res = True res@gsnMaximize = True ; maximize pot in frame res@cnFillOn = True ; color Fill res@cnLinesOn = False ; Turn off contour lines res@cnLineLabelsOn = False ; Turn off contour lines res@cnMaxLevelCount = 100 res@gsnSpreadColors = True ; use full colormap res@gsnSpreadColorStart = 5 res@gsnSpreadColorEnd = -2 res@gsnAddCyclic = False ; Data is not cyclic res@mpMinLatF = -10.0 res@mpMaxLatF = 30.0 res@mpMinLonF = 60.0 res@mpMaxLonF = 100.0 plot = gsn_csm_contour_map(wks,gbin, res) end