;--- Read HDF-EOS file: ; + HDFEOSVersion : HDFEOS_V2.19 ; + StructMetadata_0 : GROUP=SwathStructure ; ;--- he2 extension 'flattens' the GROUP and may add value added variables dir_hdf = "./" fil_nam = "MYDAODHD.A2017305.0000.061.NRT" ; used later for plot fil_hdf = fil_nam+".hdf" ; add extension fhe2 = addfile(dir_hdf+fil_hdf+".he2", "r") ; apply 'he2' extension ;--- Swath; (think 'time series' of locations and values) varName = "Aerosol_Optical_Depth_Ocean_Aqua_AOD" ;;oc_aod1 = fhe2->Aerosol_Optical_Depth_Ocean_Aqua_AOD x = fhe2->$varName$ lat1 = fhe2->Latitude_Ocean_Aqua_AOD lon1 = fhe2->Longitude_Ocean_Aqua_AOD ;--- **********LOOK at your data************* printVarSummary(x) printMinMax(x,0) print("-------------") printVarSummary(lat1) printMinMax(lat1,0) print("-------------") printVarSummary(lon1) printMinMax(lon1,0) print("-------------") print(sprintf("%7.2f", lat1)+" "+sprintf("%7.2f", lon1)+" "+sprintf("%7.2f", x)) print("-------------") ;--- **********LOOK at distribution of x ****** optx = True optx@PrintStat = True statx = stat_dispersion(x, optx ) ;-------------------------------------------- ; plot ;-------------------------------------------- pltDir = "./" pltName = fil_nam pltType = "png" ; send graphics to PNG file pltPath = pltDir + pltName wks = gsn_open_wks(pltType,pltName) res = True ; plot mods desired res@gsnDraw = False ; don't draw it yet res@gsnFrame = False ; don't advance frame res@gsnMaximize = True ;res@mpFillOn = False ; don't use gray over land res@mpCenterLonF = 180 res@gsnCenterString = varName res@tiMainString = fil_hdf res@mpGridAndLimbOn = True ; draw map grid lines res@mpGridLatSpacingF = 10 res@mpGridLonSpacingF = 10 res@mpGridLineColor = "LightGray" res@mpGridLineDashPattern= 6 ; http://www.ncl.ucar.edu/Document/Graphics/Images/dashpatterns.png map1=gsn_csm_map(wks, res) ;-------------------------------------------- ; define color levels ;-------------------------------------------- ; statx ... arbitrary choice col_min = 0.010 ; ~ low dec value: statx(3) col_max = 0.100 ; ~ high dec value: satax(13) color_arr = (/"azure", "purple","navy","blue","seagreen","green","yellow","orange","red","red"/) cnum = dimsizes(color_arr) clevels = fspan(col_min, col_max, cnum) nlevels = dimsizes(clevels) pmres = True pmres@gsMarkerIndex = 16 pmres@gsMarkerSizeF = 0.002 markerid = new(nlevels+1,graphic) do i=0,nlevels-1 if (i.eq.0) then ii := ind(x.lt.clevels(0)) ; bottom limit else if (i.eq.nlevels) then ii := ind(x.ge.clevels(nlevels-1)) ; top limit else ii := ind(x.ge.clevels(i-1) .and. x.lt.clevels(i)) ; middle levels end if end if if (.not.any(ismissing(ii))) then pmres@gsMarkerColor = color_arr(i) ; add polymarkers for MOPITT level 2 pixels markerid(i) = gsn_add_polymarker(wks,map1,lon1(ii),lat1(ii),pmres) end if end do draw(map1) ;------------ ; add labelbarl ;------------ lbres = True lbres@vpWidthF = 0.8 lbres@vpHeightF = 0.1 lbres@lbPerimOn = False lbres@lbOrientation = "Horizontal" lbres@vpYF = 0.2 ; y-location of label bar lbres@lbLabelAlignment = "InteriorEdges" lbres@lbFillColors = color_arr lbres@lbMonoFillPattern = True lbres@lbLabelFontHeightF = 0.018 ;lbres@lbTitleOn = True ;lbres@lbTitleString = "" ;lbres@lbTitleFontHeightF = 0.018 ;lbres@lbTitlePosition = "Bottom" labels = sprintf("%4.2f",clevels) gsn_labelbar_ndc(wks, nlevels+1, labels, 0.1, 0.23, lbres) frame(wks)