function L_month_plots(datafile, l1sciencelist, texname) %LTMon_plots Creates TimeMon data plots for LLO S5 run % % LTMon_plots(datafile, crapfile, l1sciencelist, texname) reads the % output datafile created by LTMon_data, the list of L1 science % segments, and creates plots of S5 science segment time data from the 'mean' % channels ignoring the zeros and known crappy data.One set of plots is produced for % every 30 days. It saves Tex reference to the eps files in the file texname. % % l1sciencelistshould contain the two dimensional matrices titled % H1_science_segments and H2_science_segments each of which should hold % four columns: % % Science segment length % Science segment start GPS time % Science segment end GPS time % Science segment serial number % % Example: L_month_plots('LTimeMon_all.mat', 'L1_science_segments.list', 'LTMon.tex') % % See also: LTMon_data, HTMon_plots % % Rubab Khan, GECo, Columbia % https://geco.phys.columbia.edu/~rubab/ % November 29, 2007. % Channel names chandata=[ 'L0:DMT-TIME_EX.mean '; 'L0:DMT-TIME_EX.max '; 'L0:DMT-TIME_EX.min '; 'L0:DMT-TIME_EX.n '; 'L0:DMT-TIME_EX.rms '; 'L1:DMT-TIME_EY.mean '; 'L1:DMT-TIME_EY.max '; 'L1:DMT-TIME_EY.min '; 'L1:DMT-TIME_EY.n '; 'L1:DMT-TIME_EY.rms '; 'L1:DMT-TIME_PEM.mean'; 'L1:DMT-TIME_PEM.max '; 'L1:DMT-TIME_PEM.min '; 'L1:DMT-TIME_PEM.n '; 'L1:DMT-TIME_PEM.rms ']; channame=[ 'L0:DMT-TIME\_EX.mean '; 'L0:DMT-TIME\_EX.max '; 'L0:DMT-TIME\_EX.min '; 'L0:DMT-TIME\_EX.n '; 'L0:DMT-TIME\_EX.rms '; 'L1:DMT-TIME\_EY.mean '; 'L1:DMT-TIME\_EY.max '; 'L1:DMT-TIME\_EY.min '; 'L1:DMT-TIME\_EY.n '; 'L1:DMT-TIME\_EY.rms '; 'L1:DMT-TIME\_PEM.mean'; 'L1:DMT-TIME\_PEM.max '; 'L1:DMT-TIME\_PEM.min '; 'L1:DMT-TIME\_PEM.n '; 'L1:DMT-TIME\_PEM.rms ']; chandata2=[ 'L0_DMT-TIME_EX.mean '; 'L0_DMT-TIME_EX.max '; 'L0_DMT-TIME_EX.min '; 'L0_DMT-TIME_EX.n '; 'L0_DMT-TIME_EX.rms '; 'L1_DMT-TIME_EY.mean '; 'L1_DMT-TIME_EY.max '; 'L1_DMT-TIME_EY.min '; 'L1_DMT-TIME_EY.n '; 'L1_DMT-TIME_EY.rms '; 'L1_DMT-TIME_PEM.mean'; 'L1_DMT-TIME_PEM.max '; 'L1_DMT-TIME_PEM.min '; 'L1_DMT-TIME_PEM.n '; 'L1_DMT-TIME_PEM.rms ']; channame2=[ 'L0_DMT-TIME\_EX.mean '; 'L0_DMT-TIME\_EX.max '; 'L0_DMT-TIME\_EX.min '; 'L0_DMT-TIME\_EX.n '; 'L0_DMT-TIME\_EX.rms '; 'L1_DMT-TIME\_EY.mean '; 'L1_DMT-TIME\_EY.max '; 'L1_DMT-TIME\_EY.min '; 'L1_DMT-TIME\_EY.n '; 'L1_DMT-TIME\_EY.rms '; 'L1_DMT-TIME\_PEM.mean'; 'L1_DMT-TIME\_PEM.max '; 'L1_DMT-TIME\_PEM.min '; 'L1_DMT-TIME\_PEM.n '; 'L1_DMT-TIME\_PEM.rms ']; chan = cellstr(channame); load(datafile); % Load data file created by LTMon_data d = L_time'; h = (d-tLStart)/(60*60*24); h = h'; % Time as days tLEnd = tLStart + tLLength; r = []; % Load science segment list load(l1sciencelist); st = L1_science_segments(:,2); en = L1_science_segments(:,3); M = length(st); for j = 1:M rr=find(d>=st(j)&d<=en(j)); r = [r rr]; end fid1 = fopen(texname,'w'); texname_png = (['png_' texname]); fid2 = fopen(texname_png,'w'); html_name = 'LLO_L_Month.html'; fid3 = fopen(html_name,'w'); fprintf(fid2,'%s\n\n', '% Please use the pdflatex package instead of the conventional latex package to compile documents with png figures.'); fprintf(fid3,'%s\n',''); fprintf(fid3,'%s\n','
'); fprintf(fid3,'%s%s%s\n','| Data period '); fprintf(fid3,'%s\n',' | ');
fprintf(fid3, '%s\n', 'GPS Start | ');
fprintf(fid3, '%s\n', 'GPS End | ');
fprintf(fid3,'%s\n','EX-PEM | ');
fprintf(fid3,'%s\n','EY-PEM | '); fprintf(fid3,'%s\n','LVEA-PEM | '); fprintf(fid3,'%s\n','Figure '); fprintf(fid3,'%s\n','tex png_tex'); fprintf(fid3,'%s\n',' | ');
fprintf(fid3,'%s\n','|||
| Mean | '); fprintf(fid3,'%s\n','Std | ');
fprintf(fid3,'%s\n','Mean | '); fprintf(fid3,'%s\n','Std | ');
fprintf(fid3,'%s\n','Mean | '); fprintf(fid3,'%s\n','Std | '); fprintf(fid3,'%s\n','||||
| Month ', month, ' '); fprintf(fid3,'%s\n',' | ');
fprintf(fid3,'%s%d%s\n','',start_time,' | '); fprintf(fid3,'%s%d%s\n','',end_time,' | '); clf; figure(1) i=0; n = 5*i+1; % First of every five chgannels: mean channels a = [h L0EX_mean]; g = a(r,1); j = a(r,2); bb = [g j]; % Pick science segment data only i=find(g>=start_day&g',Std,' | '); grid; xlabel('\Deltat[\mus]'); ylabel('N.events') title(chan(n)); subplot (3,3,3) % Create normal fit plots normplot(b(i,2)*1000000) xlabel('\Deltat[\mus]'); title(chan(n)); % Repeat the steps for all channels i=1; n = 5*i+1; a = [h L1EY_mean]; g = a(r,1); j = a(r,2); bb = [g j]; % Pick science segment data only i=find(g>=start_day&g',Std,' | '); grid; xlabel('\Deltat[\mus]'); ylabel('N.events') title(chan(n)); subplot (3,3,6) normplot(b(i,2)*1000000) xlabel('\Deltat[\mus]'); title(chan(n)); i=2; n = 5*i+1; a = [h L1PM_mean]; g = a(r,1); j = a(r,2); bb = [g j]; % Pick science segment data only i=find(g>=start_day&g',Std,' | '); grid; xlabel('\Deltat[\mus]'); ylabel('N.events') title(chan(n)); subplot (3,3,9) normplot(b(i,2)*1000000) xlabel('\Deltat[\mus]'); title(chan(n)); figure_title = sprintf('GPS Start Time: %d and GPS Stop Time: %d', start_time, end_time); suptitle(figure_title); FigL.png = sprintf('%s',[strcat(chandata2(1,:)) '_' strcat(chandata2(6,:)) '_and_' strcat(chandata2(11,:)) '_month_' num2str(month) '.png']); FigL.eps = sprintf('%s',[strcat(chandata2(1,:)) '_' strcat(chandata2(6,:)) '_and_' strcat(chandata2(11,:)) '_month_' num2str(month) '.eps']); set(figure(1),'PaperOrientation','portrait'); set(figure(1),'PaperPosition',[0.25 0.25 10.5 8]); print(figure(1),'-dpng',FigL.png); set(figure(1),'PaperOrientation','landscape'); set(figure(1),'PaperPosition',[0.25 0.25 10.5 8]); print(figure(1),'-depsc2',FigL.eps); abc = sprintf('\\begin{figure}[!t]\n\\includegraphics[angle=0,width=180mm]{%s}\n\\caption{Time series of channels %s, %s and %s for GPS time %s to %s}\n\\label{fig:%s}\n\\end{figure}\n\n',... FigL.eps,strcat(channame2(1,:)),strcat(channame2(6,:)),strcat(channame2(11,:)),num2str(start_time),num2str(end_time),FigL.eps); fprintf(fid1,'%s',abc); abc_png = sprintf('\\begin{figure}[!t]\n\\includegraphics[angle=90,width=180mm]{%s}\n\\caption{Time series of channels %s, %s and %s for GPS time %s to %s}\n\\label{fig:%s}\n\\end{figure}\n\n',... FigL.png,strcat(channame2(1,:)),strcat(channame2(6,:)),strcat(channame2(11,:)),num2str(start_time),num2str(end_time),FigL.png); fprintf(fid2,'%s',abc_png); fprintf(fid3,'%s\n',''); fprintf(fid3,'%s%s%s\n','png'); fprintf(fid3,'%s%s%s\n','eps'); fprintf(fid3,'%s\n',' | '); fprintf(fid3,'%s\n','|||