;This ncl script will plot the DEC PM2.5 data ; begin ;************************************ ; f = "Albany0005PM-S702.out" f = "County029-CO-0005-Final.out" ; 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,(/6754,2/),"float") data = asciiread(f,(/6754,2/),"double") ; data = asciiread(f,(/24,4/),"float") ; Alb1.test x = data(:,0) ;************************************** ; x = new(1,scalar) ; print(ismissing(x)) ; if(x.le.0) then ; print("x is < 0") ; end if ;************************************** 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) yyyyfrac = yyyymmdd_to_yyyyfrac(yyyymmdd,0) print(x+" "+yyyymmdd+" "+yyyyfrac) ; x@long_name = "PM2.5 concentration (ug/m^3)" x@long_name = "Date/Time" y = data(:,1) y = new(1,float) print(ismissing(y)) if(y.le.0) then print("y is < 0") end if ; y@long_name = "Date/Time" y@long_name = "SO2 concentration (ppb)" y@_FillValue=integertoshort(-999.000000) y=where(y.lt.0,y@FillValue,y) ;************************************ ; Plotting parameters ;************************************ plot = new (1, "graphic") wks = gsn_open_wks ("png","County001-CO-0012-Final.png") res = True res@tiMainString = "County001-CO-0012-Final 2002-2019" ; Title ; res@trXMaxF = 2008 ; set minimum X-axis value ; res@trXMaxF = 2009 ; set maximum X-axis value res@tmXBMode = "Explicit" res@tmXBValues = ispan(2002,2020,4) res@tmXBLabels = ispan(2002,2020,4) ; or (/"2006","2010","2014","2018","2022"/) ; 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