作図
NCL 6.3.0使用
[2017年 3月 9日 木曜日 19:09:31 JST]
[~/2017.LLC.Pacific/MODIS.Plot/Plot.NCL]
[am@aofd165]
$ ncl < modis.plot.test.ncl
Copyright (C) 1995-2015 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.3.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
(0)
(0) Output: MOD06_L2.A2003188.0055.png
(0)
$ srcdump.sh modis.plot.test.ncl
------------------------------
List of the following files:
------------------------------
modis.plot.test.ncl
------------------------------
Machine info
------------------------------
aofd165.bio.mie-u.ac.jp
/work1/am/2017.LLC.Pacific/MODIS.Plot/Plot.NCL
Thu Mar 9 19:12:18 JST 2017
======================
modis.plot.test.ncl
======================
;
; Tested under: NCL 6.3.0
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
dir="/mnt/raid112MANDA/data/MODIS/hdf/TERRA_out/"
;;;MOD06_L2.A2003188.0055.006.2014326062210.hdf
header="MOD06_L2" ;MOD=Terra(AM) MYD=Aqua(PM)
data_date="A" ;A=Aquisition
yyyyddd=tostring(2003188) ;Data year and juliand date
hhmm="0055" ;Data hour and minute start time
vvv="006" ;Collection version
yyyydddhhmmss="2014326062210" ;Production date (& time)
suffix="hdf"
figtype="png"
infle=header+"."+data_date+yyyyddd+"."+hhmm+"."+vvv+"."+yyyydddhhmmss+"."+suffix
f = addfile(dir+infle,"r")
; Read cloud temperature.
wv1s = f->Cloud_Top_Temperature
; Apply scale and offset and convert to double.
wv1 = wv1s@scale_factor*1.d * (wv1s - wv1s@add_offset)
; Extract start time from the first data in the first file.
time_start = doubletoint(f->Scan_Start_Time(0,0))
gdate_start = cd_inv_calendar(1993,1,1,0,0,time_start(0),"seconds since 1993-01-01", 0)
date2d_start = cd_calendar(gdate_start,0)
date_start = date2d_start(0,:)
; Extract end time from the last data in the last file.
time_end = doubletoint(f->Scan_Start_Time(405,269))
gdate_end = cd_inv_calendar(1993,1,1,0,0,time_end(0),"seconds since 1993-01-01", 0)
date2d_end = cd_calendar(gdate_end,0)
date_end = date2d_end(0,:)
lat2d1 = f->Latitude
lon2d1 = f->Longitude
figname=header+"."+data_date+yyyyddd+"."+hhmm
; Start the graphics.
wks = gsn_open_wks(figtype, figname)
; Choose colormap.
gsn_define_colormap(wks,"rainbow+gray")
res = True
res@gsnMaximize = True ; maximize pot in frame
res@gsnFrame = False ; don't advance frame
res@gsnDraw = False ; don't draw plot
res@gsnAddCyclic = False ; Data is not cyclic
res@cnFillOn = True ; color Fill
res@cnFillMode = "CellFill" ; Raster Mode
res@cnRasterSmoothingOn = True
res@cnRasterMinCellSizeF = 0.0005
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@trGridType = "TriangularMesh"
res1 = res
res@lbTitleString = wv1s@long_name + " (" + wv1s@units + ")"
res@lbTitleFontHeightF = 0.015 ; Make font smaller
res@lbLabelAutoStride = True ; Nice stride for labels
res@lbLabelFontHeightF = 0.012 ; Make labels bigger
res@lbTitleOffsetF = -0.3
res@lbBoxLinesOn = False
res@mpDataBaseVersion = "MediumRes" ; Higher res coastline
res@mpProjection = "Mercator" ;"Orthographic"
; Set limits of map, based on the min/max of all four datasets.
res@mpLimitMode = "LatLon"
res@mpMinLatF = min((/lat2d1/))
res@mpMaxLatF = max((/lat2d1/))
res@mpMinLonF = min((/lon2d1/))
res@mpMaxLonF = max((/lon2d1/))
res@mpGridAndLimbOn = True
; Change map center to view all 4 datasets.
res@mpCenterLonF = 180
res@mpCenterLatF = 35
res@pmTickMarkDisplayMode = "Always"
date_start_str = date_start(0) + "/" + date_start(1) + "/" + date_start(2) + "-"+ date_start(3) + ":" + date_start(4) + ":" + date_start(5)
date_end_str = date_end(0) + "/" + date_end(1) + "/" + date_end(2) + "-" + date_end(3) + ":" + date_end(4) + ":" + date_end(5)
res@tiMainString = header+"~C~from "+ date_start_str + " to " + date_end_str
res@sfXArray = lon2d1
res@sfYArray = lat2d1
plot = gsn_csm_contour_map(wks,wv1, res)
;getvalues plot@contour
; "cnMinLevelValF" : minlevel
; "cnMaxLevelValF" : maxlevel
; "cnLevelSpacingF" : levelspacing
;end getvalues
;
;res1 = True
;res1@cnLevelSelectionMode = "ManualLevels" ; Set manual contour levels
;res1@cnMinLevelValF = minlevel
;res1@cnMaxLevelValF = maxlevel
;res1@cnLevelSpacingF = levelspacing
;res1@cnInfoLabelOn = False
;res1@lbLabelBarOn = False ; Turn off b/c we already
draw(plot)
frame(wks)
print("")
print("Output: "+figname+"."+figtype)
print("")
end
----------------------
End of modis.plot.test.ncl
----------------------
MODISデータのファイル名の意味
https://modisatmos.gsfc.nasa.gov/products_filename.html