%BAOPLT10100300 % Plot daily combined data for levels 10, 100 and 300 meters. function [retval] = baoozone_daily_func( by, bm, bd, ey, em, ed ) %clear pltflg = 1; % do the plot 1=yes 0=no pngflg = 1; % save data to png's flag 1= yes 0 = no if ispc inpath = 'z:\bao\Tower\Ozone\Processed\'; outpath = 'z:\bao\Tower\Ozone\Processed_Images\'; else inpath = '/archive/BAO/Tower/Ozone/Processed/'; outpath = '/archive/BAO/Tower/Ozone/Processed_Images/'; end %cd(inpath); if( nargin == 0 ) bys = input('Input year to process (2007) ','s'); bms = input('Input the month to process (1-12) ','s'); bds = input('Input the beginning day to process (1-31) ','s'); eys = input('Input year to process (2007) ','s'); ems = input('Input the month to process (1-12) ','s'); eds = input('Input end day to process (1-31) ','s'); by = str2double( bys ); bm = str2double( bms ); bd = str2double( bds ); ey = str2double( eys ); em = str2double( ems ); ed = str2double( eds ); end bdn = datenum([by bm bd 0 0 0]); edn = datenum([ey em ed 0 0 0]); nmax = 3000; for i = bdn:edn dv=datevec(i); if i == bdn && dv(4) > 0 continue end yday = md2yd( dv(1), dv(2), dv(3) ); %name10 = sprintf('%sBAO_010_%4d%03d.dat', inpath, dv(1), yday ); %name100 = sprintf('%sBAO_100_%4d%03d.dat', inpath, dv(1), yday ); name300 = sprintf('%sBAO_OZ3_%4d%03d.dat', inpath, dv(1), yday ); fprintf(1,'*** Processing Ozone daily %d %d %d ***\n',dv(1),dv(2),dv(3)); fid300 = fopen( name300 ); if( fid300 > 0 ) fclose( fid300 ); else fprintf(1,'No 300m: %s\n',name300); continue; end [data300 dt n] = load300ozone( name300, nmax); jdb = fix(dt(1,7)); jde = jdb+1; if pltflg %skip plotting figure1 = figure('Position',[10 50 650 650]); plot(dt(1:n,7),data300(1:n,1),'r') stitle=sprintf('BAO %4d-%02d-%02d 300m Ozone **Not Calibrated**', dv(1),dv(2),dv(3)); title(stitle) elim = max(data300(1:n,1))+5; ylim([0 elim]) xlim([jdb,jde]) ylabel('O3 (PPB)') xlabel('Hour (UTC)') datetick('x','HH','keeplimits'); legend('300m','Location','Best','Orientation','horizontal'); legend('boxoff'); grid on annotation(figure1,'textbox',[0.007154 0.01077 0.4498 0.02462],... 'String',{'NOAA/ESRL PSD and GMD'},... 'FontSize',8,'FitBoxToText','off','LineStyle','none'); if pngflg print_buffer = sprintf('%sBAO_10300_%4d%03d_Ozo.png',... outpath, dv(1), yday ); set(gcf,'PaperPositionMode','auto'); print('-dpng', print_buffer); %f=getframe(gcf); %imwrite(f.cdata,print_buffer,'png'); end end % skip plotting clear data300 dt data10 data100 close all end %loop through days retval = 0;