; This ncl script will plot the DEC PM2.5 data ; begin ;************************************ ; f = "Albany0005PM-S702.out" f = "tester4.test" ; Column information (NOTE NCL COLUMN COUNT IS IN PARENTHIESE) ; 1 (0) sensor ID number ; 2 (1) Date in YYYYMMDD.PPPPPP format P is hourly julian day decimal ; 3 (2) PM2.5 data missing data is -999 ; ; data = asciiread(f,(/112728,4/),"float") ; Albany0005PM-S702.out ; data = asciiread(f,(/112728,3/),"float") data = asciiread(f,(/112728,3/),"double") ; data = asciiread(f,(/24,4/),"float") ; Alb1.test x = data(:,1) yyyymmdd = toint(x) ; convert to yyyymmdd yyyymmddhh = yyyymmdd*100.d ; * by 100 to prepare for yyyymmddhh setting do gg = 0,23 yyyymmddhh(gg::24) = yyyymmddhh(gg::24)+gg end do yyyyfrac = yyyymmddhh_to_yyyyfrac(yyyymmddhh,0) print(x+" "+yyyymmddhh+" "+yyyyfrac) ; x@long_name = "PM2.5 concentration (ug/m^3)" x@long_name = "Date/Time" y = data(:,2) ; y@long_name = "Date/Time" y@long_name = "PM2.5 concentration (ug/m^3)" y@_FillValue=integertoshort(-999) y=where(y.lt.0,y@FillValue,y) ;************************************ ; Plotting parameters ;************************************ plot = new (1, "graphic") wks = gsn_open_wks ("png","test.png") res = True res@tiMainString = "Basic line plot" ; Title res@trXMaxF = 2006 ; set minimum X-axis value res@trXMaxF = 2020 ; set maximum X-axis value res@tmXBMode = "Explicit" res@tmXBValues = ispan(2006,2022,4) res@tmXBLabels = ispan(2006,2022,4) ; or (/"2006","2010","2014","2018","2022"/) plot = gsn_csm_xy (wks,yyyyfrac,y,res) ; create plot end