; 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/),"float") ; data = asciiread(f,(/24,4/),"float") ; Alb1.test x = data(:,1) printMinMax(x,0) x@_FillValue=integertoshort(-999) x=where(x.lt.0,x@_FillValue,x) ; 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) ;************************************************************ ; Setting up to correct for juliandate decimals ;************************************************************ tstart = 2006 tend = 2020 yyyymmddhhmm_time = x ; Date infromation in the column is in YYYYMMDD.P P is the days julian hour value yyyymmddhhmm = yyyymmddhhmm_time(tstart, tend, "integer") yyyyfrac = yyyymmddhhmm_to_yyyyfrac(yyyymmdd,0) ; create fractional years for plotting purposes ;************************************ ; 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 = "Manual" res@tmXBTickStartF = 2006 res@tmXBTickEndF = 2020 res@tmXBTickSpacingF= 4 plot = gsn_csm_xy (wks,yyyyfrac,y,res) ; create plot end