- Timestamp:
- Apr 21, 2016, 1:51:52 PM (8 years ago)
- Location:
- SPESO/ana2015/offline_analysis
- Files:
-
- 5 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
SPESO/ana2015/offline_analysis/make_colormap.m
r497 r503 5 5 colormap_viridis; 6 6 7 magnitude=data;7 data=data'; 8 8 pos1=y; 9 9 pos2=x; … … 12 12 13 13 14 min_magnitude=min(m agnitude(:));15 color_coeff=(max(ma gnitude(:))-min(magnitude(:)));16 colors=round(( magnitude-min_magnitude)./color_coeff.*255)+1;14 min_magnitude=min(min(data)); 15 color_coeff=(max(max(data))-min_magnitude); 16 colors=round((data-min_magnitude)./color_coeff.*255)+1; 17 17 color_to_magn=@(color_in)((color_in-1)/255*color_coeff+min_magnitude); 18 18 -
SPESO/ana2015/offline_analysis/offline_analyse_multi.m
r497 r503 11 11 offline_analysis('2016JanFeb', '20160{30?,2??,1??}.dayFullInfo', 1001); % histo 12 12 offline_analysis('2016JanFeb', '20160{30?,2??,1??}.dayFullInfo', 2001); % colorplots 13 offline_analysis('2016JanFebMarch', '20160{3[^1]?,31[^3],2??,1??}.dayFullInfo', 3002); % reseau analysis 13 14 14 15 % 2016 04/09 -- 03/09 15 16 offline_analysis('2016Mar', '20160{40?,3[^1]?,31[^3]}.dayFullInfo', 2002); % colorplots 16 offline_analysis('2016Mar', '20160{40?,3[^1]?,31[^3]}.dayFullInfo', 3002); % reseau analysis17 17 18 18 %offline_analysis('1', ); -
SPESO/ana2015/offline_analysis/offline_analyse_reseau.m
r497 r503 10 10 figures_path=offline_figures_path; 11 11 12 offline_reseau_html(' reseau_positions')12 offline_reseau_html('main', selection_id) 13 13 14 14 % load selections … … 50 50 51 51 % "background" (pos_reseau<50000) 52 data_select(POS_selection{1}{ 1}{:});53 data_select(POS_selection{1}{ 2}{:});54 data_select(POS_selection{2}{ 1}{:});55 data_select(POS_selection{2}{ 2}{:});52 data_select(POS_selection{1}{3}{:}); 53 data_select(POS_selection{1}{4}{:}); 54 data_select(POS_selection{2}{3}{:}); 55 data_select(POS_selection{2}{4}{:}); 56 56 data_select(XPOS_selection{1}{1}{:}); 57 57 data_select(XPOS_selection{1}{2}{:}); … … 117 117 end % function 118 118 119 function print_fig(fig_handle, fig_name)120 %print figure121 set(gca,'FontSize',16)122 print(fig_handle, '-dpng', '-r300', fig_name);123 end -
SPESO/ana2015/offline_analysis/offline_analysis.m
r497 r503 14 14 % add path to the SPESO analysis scripts, if this script was called from the offline_analysis folder 15 15 addpath('../'); 16 addpath('lib_offline'); 16 17 17 18 %global variables … … 37 38 % load data 38 39 %date_mask='20160{3[^1]?,31[^3],2??,1??}.dayFullInfo'; % months 01, 02, 03 except day 13th 40 39 41 load_analysis_data(date_mask); 40 42 … … 61 63 if ((fix(selection_id/1000)==3)||(fix(selection_id/1000)==0)) 62 64 %create reseau anlysis plots 63 offline_ histograms(selection_id);65 offline_analyse_reseau(selection_id); 64 66 end; 65 67 -
SPESO/ana2015/offline_analysis/offline_colorplots.m
r497 r503 7 7 figures_path=offline_figures_path; 8 8 9 offline_colorplots_html('main', selection_id) 10 9 11 % load selections 10 12 data_sel=offline_selection(selection_id);% load selection … … 13 15 Y_edges= data_sel.Y_edges; 14 16 Z_edges= data_sel.Z_edges; 17 18 X_axis_var=data_sel.X_axis_var; 19 X_axis_edges=data_sel.X_axis_edges; 20 Y_axis_var=data_sel.Y_axis_var; 21 Y_axis_edges=data_sel.Y_axis_edges; 15 22 16 23 % save selections in current function … … 35 42 LPM_txt = data_sel.LPM_txt; 36 43 37 if (selection_id==1)||(selection_id==2)38 %select positions39 end;% selection id40 44 41 45 % make plots … … 67 71 68 72 fih = figure(1) 69 det_signal=data_colorplot( dvar.DETECT_SPOS, dvar.DETECT_XPOS, data_types(det_type), Y_edges, X_edges);73 det_signal=data_colorplot(X_axis_var, Y_axis_var, data_types(det_type), X_axis_edges, Y_axis_edges); 70 74 set(gcf,'PaperUnits','inches','PaperPosition',[0 0 12 9]); 71 75 print_fig(fih, [ figures_path 'signal_' pars_txt '.png' ]); … … 79 83 80 84 fih = figure(1); 81 det_BG=data_colorplot( dvar.DETECT_SPOS, dvar.DETECT_XPOS, data_types(det_type), Y_edges, X_edges);85 det_BG=data_colorplot(X_axis_var, Y_axis_var, data_types(det_type), X_axis_edges, Y_axis_edges); 82 86 set(gcf,'PaperUnits','inches','PaperPosition',[0 0 12 9]); 83 87 print_fig(fih,[ figures_path 'bg_' pars_txt '.png' ]); … … 92 96 93 97 signal_bg=det_BG.bins(:,:,1); 94 signal_stat=det_signal.bins(:,:,3) 98 signal_stat=det_signal.bins(:,:,3); 95 99 96 100 % data w/o backgroung 97 101 fih = figure(1); 98 102 make_colormap(signal_vals-signal_bg, x_vals, y_vals); 99 xlabel(get_var_name( dvar.DETECT_SPOS));100 ylabel(get_var_name( dvar.DETECT_XPOS));103 xlabel(get_var_name(X_axis_var)); 104 ylabel(get_var_name(Y_axis_var)); 101 105 title(base_selected_text); 102 106 set(gcf,'PaperUnits','inches','PaperPosition',[0 0 12 9]); … … 106 110 fih = figure(1); 107 111 make_colormap(signal_stat, x_vals, y_vals); 108 xlabel(get_var_name( dvar.DETECT_SPOS));109 ylabel(get_var_name( dvar.DETECT_XPOS));112 xlabel(get_var_name(X_axis_var)); 113 ylabel(get_var_name(Y_axis_var)); 110 114 title(base_selected_text); 111 115 set(gcf,'PaperUnits','inches','PaperPosition',[0 0 12 9]); … … 119 123 end % function 120 124 121 function print_fig(fig_handle, fig_name)122 %print figure123 set(gca,'FontSize',16)124 print(fig_handle, '-dpng', '-r300', fig_name);125 end -
SPESO/ana2015/offline_analysis/offline_colorplots_html.m
r497 r503 32 32 33 33 % create menu making JS 34 if exist('links.js') 35 hrefs = fopen('links.js', 'r+'); 36 js_script = fscanf(hrefs, '%s'); 37 hyper_link = ['<a href="' page_link '.html">' page_link_text '</a></br>']; 38 if isempty(strfind(js_script, )) 39 fseek(hrefs, -3, 'eof'); 40 fprintf(hrefs, '%s'');', hyper_link); 41 end 42 fclose(hrefs); 43 else 44 hrefs = fopen('links.js', 'w'); 45 fprintf(hrefs, '%s', ['document.write(''<a href="' 46 page_link '.html">' 47 page_link_text '</a></br> '');']); 48 fclose(hrefs); 49 end 34 html_links_list(figures_path, page_link, page_link_text); 50 35 51 36 file_id = fopen([figures_path page_link '.html'], 'w'); … … 55 40 tabstops=0; 56 41 57 print_tag('HTML') 42 fprintf(file_id, '%s\n', '<!doctype html>'); 43 html_print_tag('HTML') 58 44 59 print_tag('head', '', '');60 print_tag('body');61 print_tag('H1', '', ['Simulation time:' datestr(now)]);62 print_tag('H2', '', ['SVN revision:' svn_revision{1}]);45 html_print_tag('head', '', ''); 46 html_print_tag('body'); 47 html_print_tag('H1', '', ['Simulation time:' datestr(now)]); 48 html_print_tag('H2', '', ['SVN revision:' svn_revision{1}]); 63 49 64 50 % print links 65 print_tag('script', 'src="links.js"', '');51 html_print_tag('script', 'src="links.js"', ''); 66 52 67 53 % all period statistics 68 54 img_name=[ '9plots_monthly.png' ]; 69 print_img(img_name, '400');55 html_print_img(img_name, '400'); 70 56 71 for LPMloop =1:length(LPM_ selection)57 for LPMloop =1:length(LPM_txt) 72 58 for DetLoop=1:2 73 59 74 60 75 print_tag('table', 'border="2"');76 print_tag('tr');77 print_tag('td', '', '');61 html_print_tag('table', 'border="2"'); 62 html_print_tag('tr'); 63 html_print_tag('td', '', ''); 78 64 % QICT labels 79 65 for QICT1loop=1:length(QICT1_txt); 80 print_tag('td', '', ['Q=' QICT1_txt{QICT1loop}]);66 html_print_tag('td', '', ['Q=' QICT1_txt{QICT1loop}]); 81 67 end;% QICT1loop 82 print_tag('/tr');68 html_print_tag('/tr'); 83 69 84 70 % signal 85 print_tag('tr');86 print_tag('td', '', [data_names{DetLoop}]);71 html_print_tag('tr'); 72 html_print_tag('td', '', [data_names{DetLoop} '<br>' 'Signal']); 87 73 for QICT1loop=1:length(QICT1_txt); 88 74 pars_txt=[LPM_txt{LPMloop}... 89 ' Det' num2str(DetLoop)...75 '_Det' num2str(DetLoop)... 90 76 '_Q' QICT1_txt{QICT1loop}... 91 77 ]; 92 78 img_name=[ 'signal_' pars_txt '.png' ]; 93 print_tag('td');94 print_img(img_name, '400');95 print_tag('/td');79 html_print_tag('td'); 80 html_print_img(img_name, '400'); 81 html_print_tag('/td'); 96 82 end; % QICT1loop 97 print_tag('/tr');83 html_print_tag('/tr'); 98 84 99 85 % background 100 print_tag('tr');101 print_tag('td', '', [data_names{DetLoop}]);86 html_print_tag('tr'); 87 html_print_tag('td', '', [data_names{DetLoop} '<br>' 'background']); 102 88 for QICT1loop=1:length(QICT1_txt); 103 89 pars_txt=[LPM_txt{LPMloop}... 104 ' Det' num2str(DetLoop)...90 '_Det' num2str(DetLoop)... 105 91 '_Q' QICT1_txt{QICT1loop}... 106 92 ]; 107 93 img_name=[ 'bg_' pars_txt '.png' ]; 108 print_tag('td');109 print_img(img_name, '400');110 print_tag('/td');94 html_print_tag('td'); 95 html_print_img(img_name, '400'); 96 html_print_tag('/td'); 111 97 end; % QICT1loop 112 print_tag('/tr');98 html_print_tag('/tr'); 113 99 114 100 % signal w/o background 115 print_tag('tr');116 print_tag('td', '', [data_names{DetLoop}]);101 html_print_tag('tr'); 102 html_print_tag('td', '', [data_names{DetLoop} '<br>' 'Signal w/o bg']); 117 103 for QICT1loop=1:length(QICT1_txt); 118 104 pars_txt=[LPM_txt{LPMloop}... 119 ' Det' num2str(DetLoop)...105 '_Det' num2str(DetLoop)... 120 106 '_Q' QICT1_txt{QICT1loop}... 121 107 ]; 122 108 img_name=[ 'signal_wo_bg_' pars_txt '.png' ]; 123 print_tag('td');124 print_img(img_name, '400');125 print_tag('/td');109 html_print_tag('td'); 110 html_print_img(img_name, '400'); 111 html_print_tag('/td'); 126 112 end; % QICT1loop 127 print_tag('/tr');113 html_print_tag('/tr'); 128 114 129 115 % number of points in the bins 130 print_tag('tr');131 print_tag('td', '', [data_names{DetLoop}]);116 html_print_tag('tr'); 117 html_print_tag('td', '', [data_names{DetLoop} '<br>' 'Number of data points']); 132 118 for QICT1loop=1:length(QICT1_txt); 133 119 pars_txt=[LPM_txt{LPMloop}... 134 ' Det' num2str(DetLoop)...120 '_Det' num2str(DetLoop)... 135 121 '_Q' QICT1_txt{QICT1loop}... 136 122 ]; 137 123 img_name=[ 'stat_' pars_txt '.png' ]; 138 print_tag('td');139 print_img(img_name, '400');140 print_tag('/td');124 html_print_tag('td'); 125 html_print_img(img_name, '400'); 126 html_print_tag('/td'); 141 127 end; % QICT1loop 142 print_tag('/tr');128 html_print_tag('/tr'); 143 129 144 print_tag('/table');130 html_print_tag('/table'); 145 131 end; % detloop 146 132 end; %LPMloop 147 133 148 print_tag('/body');149 print_tag('/HTML');134 html_print_tag('/body'); 135 html_print_tag('/HTML'); 150 136 fclose(file_id); 151 137 152 138 end % function 153 139 154 function result_text = print_tag(tagName, tag_params, tag_txt)155 % print html tag, with neat tabshifts156 % 1 arg - only <tagname>157 % 2 args - <tagname tagparams>158 % 3 args - <tagname tagparams>tagtxt</tagname>159 global prev_tag160 global tabstops161 global file_id162 tabchar='\t';163 164 if nargin<1165 return166 end; % if not enough arguments167 168 if (tagName(1)=='/')&&(length(tagName)==1)169 tabstops=tabstops-2;170 return171 end; % shift tabulation to the left172 173 174 if nargin<2175 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName '>']);176 elseif nargin<3177 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName ' ' tag_params '>']);178 else179 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName ' ' tag_params '>']);180 fprintf(file_id, [repmat(tabchar,1,tabstops+1) '%s\n'], [tag_txt]);181 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['</' tagName '>']);182 end;183 184 if tagName(1)=='/'185 tabstops=tabstops-1;186 else187 tabstops=tabstops+1;188 end;189 190 prev_tag=tagName;191 end192 193 function print_img(image_name, width)194 % print image with link to itself195 print_tag('a', 'href="image_name"');196 print_tag('img', ['src="' image_name '"' ' width="' width '"']);197 print_tag('/');198 print_tag('/a');199 end -
SPESO/ana2015/offline_analysis/offline_histograms.m
r497 r503 156 156 end % function 157 157 158 function print_fig(fig_handle, fig_name)159 %print figure160 set(gca,'FontSize',16)161 print(fig_handle, '-dpng', '-r300', fig_name);162 end -
SPESO/ana2015/offline_analysis/offline_histograms_html.m
r497 r503 30 30 for POSloop =1:length(POS_txt) 31 31 %print html pages for each POSITION(Z,S) 32 file_id = fopen([figures_path page_name POS_txt{POSloop} '.html'], 'w');33 32 34 33 prev_tag=''; 35 34 tabstops=0; 36 35 37 page_link=[page_name POS_txt{ linkloop}];38 page_link_text=['Position' POS_txt{ linkloop}];36 page_link=[page_name POS_txt{POSloop}]; 37 page_link_text=['Position' POS_txt{POSloop}]; 39 38 40 39 % create menu making JS 41 if exist('links.js') 42 hrefs = fopen('links.js', 'r+'); 43 js_script = fscanf(hrefs, '%s'); 44 hyper_link = ['<a href="' page_link '.html">' page_link_text '</a></br>']; 45 if isempty(strfind(js_script, )) 46 fseek(hrefs, -3, 'eof'); 47 fprintf(hrefs, '%s'');', hyper_link); 48 end 49 fclose(hrefs); 50 else 51 hrefs = fopen('links.js', 'w'); 52 fprintf(hrefs, '%s', ['document.write(''<a href="' 53 page_link '.html">' 54 page_link_text '</a></br> '');']); 55 fclose(hrefs); 56 end 40 html_links_list(figures_path, page_link, page_link_text); 57 41 58 print_tag('HTML')42 file_id = fopen([figures_path page_name POS_txt{POSloop} '.html'], 'w'); 59 43 60 print_tag('head', '', ''); 61 print_tag('body'); 62 print_tag('H1', '', ['Simulation time:' datestr(now)]); 63 print_tag('H2', '', ['SVN revision:' svn_revision{1}]); 44 fprintf(file_id, '%s\n', '<!doctype html>'); 45 html_print_tag('HTML') 46 47 html_print_tag('head', '', ''); 48 html_print_tag('body'); 49 html_print_tag('H1', '', ['Simulation time:' datestr(now)]); 50 html_print_tag('H2', '', ['SVN revision:' svn_revision{1}]); 64 51 65 52 % print links 66 print_tag('script', 'src="links.js"', '');53 html_print_tag('script', 'src="links.js"', ''); 67 54 68 55 img_name=[ '9plots_monthly.png' ]; 69 print_img(img_name, '400'); 70 71 % for each detector and signal type type make colorplot 72 for dataloop = 1:length(data_names); 73 img_name=[ 'colorplot_' data_names{dataloop} '.png' ]; 74 print_img(img_name, '400'); 75 end; % data_loop 56 html_print_img(img_name, '400'); 76 57 77 58 for LPMloop =1:length(LPM_txt) … … 85 66 params_list=''; 86 67 87 print_tag('table', 'border="2"');68 html_print_tag('table', 'border="2"'); 88 69 89 print_tag('tr');90 print_tag('td', '','');70 html_print_tag('tr'); 71 html_print_tag('td', '',''); 91 72 for DetLoop=1:2 92 print_tag('td', '', ['Det' num2str(DetLoop)]);73 html_print_tag('td', '', ['Det' num2str(DetLoop)]); 93 74 end; 94 print_tag('td', '','');95 print_tag('/tr');75 html_print_tag('td', '',''); 76 html_print_tag('/tr'); 96 77 97 print_tag('tr');98 print_tag('td', '','Scatter');78 html_print_tag('tr'); 79 html_print_tag('td', '','Scatter'); 99 80 for DetLoop=1:2 100 81 img_name=([ 'scatter_Det' num2str(DetLoop) '_' pars_txt '.png'] ); 101 print_tag('td'); 102 print_img(img_name, '400'); 103 print_tag('/'); % decrease tabstops 104 print_tag('/td'); 82 html_print_tag('td'); 83 html_print_img(img_name, '400'); 84 html_print_tag('/td'); 105 85 end; 106 print_tag('td', '','');107 print_tag('/tr');86 html_print_tag('td', '',''); 87 html_print_tag('/tr'); 108 88 109 print_tag('tr');110 print_tag('td', '','Histogram');89 html_print_tag('tr'); 90 html_print_tag('td', '','Histogram'); 111 91 for DetLoop=1:2 112 92 img_name=([ 'hist_Det' num2str(DetLoop) '_' pars_txt '.png'] ); 113 print_tag('td'); 114 print_img(img_name, '400'); 115 print_tag('/'); % decrease tabstops 116 print_tag('/td'); 93 html_print_tag('td'); 94 html_print_img(img_name, '400'); 95 html_print_tag('/td'); 117 96 end; 118 print_tag('td', '','');119 print_tag('/tr');97 html_print_tag('td', '',''); 98 html_print_tag('/tr'); 120 99 121 print_tag('tr');122 print_tag('td', '','Comparison');100 html_print_tag('tr'); 101 html_print_tag('td', '','Comparison'); 123 102 img_name=(['compare_Det1_Det2_' pars_txt '.png' ]); 124 print_tag('td', 'colspan="2"'); 125 print_img(img_name, '800'); 126 print_tag('/'); % decrease tabstops 127 print_tag('/td'); 128 print_tag('td', '',''); 129 print_tag('/tr'); 103 html_print_tag('td', 'colspan="2"'); 104 html_print_img(img_name, '800'); 105 html_print_tag('/td'); 106 html_print_tag('td', '',''); 107 html_print_tag('/tr'); 130 108 131 print_tag('tr');132 print_tag('td', '','Polar');109 html_print_tag('tr'); 110 html_print_tag('td', '','Polar'); 133 111 for DetLoop=1:2 134 112 img_name=([ 'polar_Det' num2str(DetLoop) '_' pars_txt '.png'] ); 135 print_tag('td'); 136 print_img(img_name, '400'); 137 print_tag('/'); % decrease tabstops 138 print_tag('/td'); 113 html_print_tag('td'); 114 html_print_img(img_name, '400'); 115 html_print_tag('/td'); 139 116 end; 140 print_tag('td', '','');141 print_tag('tr');142 print_tag('/table');117 html_print_tag('td', '',''); 118 html_print_tag('/tr'); 119 html_print_tag('/table'); 143 120 end;% XPOSloop 144 121 end;% QICT1loop 145 122 end;% LPMloop 146 print_tag('/body');147 print_tag('/HTML');123 html_print_tag('/body'); 124 html_print_tag('/HTML'); 148 125 fclose(file_id); 149 126 end;% POSloop … … 154 131 end % function 155 132 156 function result_text = print_tag(tagName, tag_params, tag_txt)157 % print html tag, with neat tabshifts158 % 1 arg - only <tagname>159 % 2 args - <tagname tagparams>160 % 3 args - <tagname tagparams>tagtxt</tagname>161 % after single tags it is good to call "print_tag('/');"162 global prev_tag163 global tabstops164 global file_id165 tabchar='\t';166 167 if nargin<1168 return169 end; % if not enough arguments170 171 if (tagName(1)=='/')&&(length(tagName)==1)172 tabstops=tabstops-2;173 return174 end; % shift tabulation to the left175 176 177 if nargin<2178 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName '>']);179 elseif nargin<3180 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName ' ' tag_params '>']);181 else182 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName ' ' tag_params '>']);183 fprintf(file_id, [repmat(tabchar,1,tabstops+1) '%s\n'], [tag_txt]);184 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['</' tagName '>']);185 end;186 187 if tagName(1)=='/'188 tabstops=tabstops-1;189 else190 tabstops=tabstops+1;191 end;192 193 prev_tag=tagName;194 end195 196 function print_img(image_name, width)197 % print image with link to itself198 print_tag('a', 'href="image_name"');199 print_tag('img', ['src="' image_name '"' ' width="' width '"']);200 print_tag('/');201 print_tag('/a');202 end -
SPESO/ana2015/offline_analysis/offline_reseau_html.m
r497 r503 31 31 32 32 % create JS, that prints links 33 if exist('links.js') 34 hrefs = fopen('links.js', 'r+'); 35 js_script = fscanf(hrefs, '%s'); 36 hyper_link = ['<a href="' page_link '.html">' page_link_text '</a></br>']; 37 if isempty(strfind(js_script, )) 38 fseek(hrefs, -3, 'eof'); 39 fprintf(hrefs, '%s'');', hyper_link); 40 end 41 fclose(hrefs); 42 else 43 hrefs = fopen('links.js', 'w'); 44 fprintf(hrefs, '%s', ['document.write(''<a href="' 45 page_link '.html">' 46 page_link_text '</a></br> '');']); 47 fclose(hrefs); 48 end 33 html_links_list(figures_path, page_link, page_link_text); 49 34 50 file_id = fopen([figures_path page_ name'.html'], 'w');35 file_id = fopen([figures_path page_link '.html'], 'w'); 51 36 52 37 prev_tag=''; 53 38 tabstops=0; 54 39 55 print_tag('HTML') 40 fprintf(file_id, '%s\n', '<!doctype html>'); 41 html_print_tag('HTML') 56 42 57 print_tag('head', '', '');58 print_tag('body');59 print_tag('H1', '', ['Simulation time:' datestr(now)]);60 print_tag('H2', '', ['SVN revision:' svn_revision{1}]);43 html_print_tag('head', '', ''); 44 html_print_tag('body'); 45 html_print_tag('H1', '', ['Simulation time:' datestr(now)]); 46 html_print_tag('H2', '', ['SVN revision:' svn_revision{1}]); 61 47 62 48 % print links 63 print_tag('script', 'src="links.js"', '');49 html_print_tag('script', 'src="links.js"', ''); 64 50 65 51 img_name=[ '9plots_monthly.png' ]; 66 print_img(img_name, '400');52 html_print_img(img_name, '400'); 67 53 68 54 for DetLoop=1:4 69 print_tag('table', 'border="2"');70 print_tag('tr');71 print_tag('td', '', '');55 html_print_tag('table', 'border="2"'); 56 html_print_tag('tr'); 57 html_print_tag('td', '', ''); 72 58 for QICT1loop=1:length(QICT1_txt); 73 print_tag('td', '', ['Q=' QICT1_txt{QICT1loop}]);59 html_print_tag('td', '', ['Q=' QICT1_txt{QICT1loop}]); 74 60 end;% QICT1loop 75 print_tag('/tr');76 print_tag('tr');77 print_tag('td', '', [data_names{DetLoop}]);61 html_print_tag('/tr'); 62 html_print_tag('tr'); 63 html_print_tag('td', '', [data_names{DetLoop}]); 78 64 for QICT1loop=1:length(QICT1_txt); 79 65 img_name=[ 'Reseau_'... 80 66 data_names{DetLoop}... 81 67 '_Q' QICT1_txt{QICT1loop} '.png' ]; 82 print_tag('td');83 print_img(img_name, '400');84 print_tag('/td');68 html_print_tag('td'); 69 html_print_img(img_name, '400'); 70 html_print_tag('/td'); 85 71 end;% QICT1loop 86 print_tag('/tr');87 print_tag('/table');72 html_print_tag('/tr'); 73 html_print_tag('/table'); 88 74 end;% DetLoop 89 75 90 76 91 print_tag('/body');92 print_tag('/HTML');77 html_print_tag('/body'); 78 html_print_tag('/HTML'); 93 79 fclose(file_id); 94 80 … … 98 84 end % function 99 85 100 function result_text = print_tag(tagName, tag_params, tag_txt)101 % print html tag, with neat tabshifts102 % 1 arg - only <tagname>103 % 2 args - <tagname tagparams>104 % 3 args - <tagname tagparams>tagtxt</tagname>105 global prev_tag106 global tabstops107 global file_id108 tabchar='\t';109 110 if nargin<1111 return112 end; % if not enough arguments113 114 if ((prev_tag(1)=='/')&&(tagName(1)=='/'))115 tabstops=tabstops-1;116 end;117 if ((tagName(1)=='/')&&(length(tagName)==1))118 prev_tag='/';119 tabstops=tabstops-1;120 return121 end;122 123 if nargin<2124 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName '>']);125 elseif nargin<3126 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName ' ' tag_params '>']);127 else128 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['<' tagName ' ' tag_params '>']);129 fprintf(file_id, [repmat(tabchar,1,tabstops+1) '%s\n'], [tag_txt]);130 fprintf(file_id, [repmat(tabchar,1,tabstops) '%s\n'], ['</' tagName '>']);131 tagName=['/' tagName];132 %tabstops=tabstops-1;133 end;134 135 if tagName(1)~='/'136 tabstops=tabstops+1;137 end;138 139 prev_tag=tagName;140 end141 142 function print_img(image_name, width)143 print_tag('a', ['href="' image_name '"']);144 print_tag('img', ['src="' image_name '"' ' width="' width '"']);145 print_tag('/');146 print_tag('/a');147 end -
SPESO/ana2015/offline_analysis/offline_selection.m
r497 r503 7 7 define_data_var(); 8 8 9 if mod(selection_id,1000)==110 % before 2016031011 % ======================== from balayage =================12 pos_hublot_Z=-66000;13 pos_hublot_Y=-575000;14 15 N_DAYS=5;16 %if (mod(theDate,N_DAYS)>0)17 theDate=1:N_DAYS-1;18 %zloop=2*str2num(datestr(now,'HH'))+floor((str2num(datestr(now,'MM')))/30)19 zloop=0:47;20 21 pos_next_Y=-200000+(-1).*(floor(600000/48).*(zloop+0.5));22 pos_next_Z=(-1).*(floor(140000/48).*(zloop+0.5));23 pos_next_X=[-200000 -400000];24 25 %----------------------- end balayage --------------------26 elseif mod(selection_id,1000)==227 % after 2016/03/10 before 2016/04/0928 % ======================== from balayage =================29 pos_hublot_Z=-66000;30 pos_hublot_Y=-575000;31 32 N_DAYS=8;33 %if (mod(theDate,N_DAYS)>0)34 theDate=1:N_DAYS-1;35 %zloop=2*str2num(datestr(now,'HH'))+floor((str2num(datestr(now,'MM')))/30)36 zloop=0:47;37 pos_next_Y=-200000+(-1).*(floor(600000/48).*(zloop+0.5));38 pos_next_X=-200000+(-1).*(floor(200000/(N_DAYS-1)).*(mod(theDate,N_DAYS)-1));39 40 pos_next_Z=[0 pos_hublot_Z];41 42 %----------------------- end balayage --------------------43 else44 % do nothing45 return46 end; % selection id47 48 delta_pos_Y=pos_next_Y(1)-pos_next_Y(2);49 delta_pos_X=pos_next_X(1)-pos_next_X(2);50 delta_pos_Z=pos_next_Z(1)-pos_next_Z(2);51 52 % from end to start -> from min to max53 data_sel.X_edges=[pos_next_X(end)-delta_pos_X/2:delta_pos_X:pos_next_X(1)+delta_pos_X/2];54 data_sel.Y_edges=[pos_next_Y(end)-delta_pos_Y/2:delta_pos_Y:pos_next_Y(1)+delta_pos_Y/2];55 data_sel.Z_edges=[pos_next_Z(end)-delta_pos_Z/2:delta_pos_Z:pos_next_Z(1)+delta_pos_Z/2];56 57 9 data_sel.data_types=[dvar.DATA1_VAL_LPM dvar.DATA2_VAL_LPM dvar.DATA1_VAL_SPM dvar.DATA2_VAL_SPM]; 58 10 data_sel.data_names={'DATA1_LPM','DATA2_LPM','DATA1_SPM','DATA2_SPM'}'; 59 60 % XPOS = -200000;61 data_sel.XPOS_selection{1}{1}={dvar.DETECT_XPOS, '<', -190000};62 data_sel.XPOS_selection{1}{2}={dvar.DETECT_XPOS, '>', -210000};63 data_sel.XPOS_txt{1}='200k';64 65 % XPOS = -400000;66 data_sel.XPOS_selection{2}{1}={dvar.DETECT_XPOS, '<', -390000};67 data_sel.XPOS_selection{2}{2}={dvar.DETECT_XPOS, '>', -410000};68 data_sel.XPOS_txt{2}='400k';69 70 % exclude pos_hublot_Z71 data_sel.POS_selection{1}{1}={dvar.DETECT_ZPOS, '<', pos_hublot_Z-100};72 data_sel.POS_selection{1}{2}={dvar.DETECT_ZPOS, '>', pos_hublot_Z+100};73 data_sel.POS_var{1}=dvar.DETECT_ZPOS;74 data_sel.POS_txt{1}='Z';75 data_sel.POS_edges{1}=Z_edges;76 data_sel.POS_offset{1}(1)=0;77 data_sel.POS_offset{1}(2)=0;78 79 % exclude pos_hublot_S80 data_sel.POS_selection{2}{1}={dvar.DETECT_SPOS, '<', pos_hublot_Y-100};81 data_sel.POS_selection{2}{2}={dvar.DETECT_SPOS, '>', pos_hublot_Y+100};82 data_sel.POS_var{2}=dvar.DETECT_SPOS;83 data_sel.POS_txt{2}='S';84 data_sel.POS_edges{2}=Y_edges;85 data_sel.POS_offset{2}(1)=-650000;86 data_sel.POS_offset{2}(2)=-450000;87 88 % RESEAU_POS > 100000089 data_sel.RESEAU_POS_selection{1}{1}={dvar.RESEAU_POS, '>', 1000000};90 91 % RESEAU_POS < 100000092 data_sel.RESEAU_POS_selection{2}{1}={dvar.RESEAU_POS, '<', 1000000};93 11 94 12 % QICT1 = 3.5 … … 115 33 data_sel.LPM_txt{2}='SPM'; 116 34 35 % ======================== from balayage ================= 36 if mod(selection_id,1000)==1 37 % before 20160310 38 pos_hublot_Z=-66000; 39 pos_hublot_Y=-575000; 40 41 N_DAYS=5; 42 theDate=1:N_DAYS-1; 43 zloop=0:47; 44 45 pos_next_Y=-200000+(-1).*(floor(600000/48).*(zloop+0.5)); 46 pos_next_Z=(-1).*(floor(140000/48).*(zloop+0.5)); 47 pos_next_X=[-200000 -400000]; 48 49 elseif mod(selection_id,1000)==2 50 % after 2016/03/10 before 2016/04/09 51 pos_hublot_Z=-66000; 52 pos_hublot_Y=-575000; 53 54 N_DAYS=8; 55 theDate=1:N_DAYS-1; 56 zloop=0:47; 57 pos_next_Y=-200000+(-1).*(floor(600000/48).*(zloop+0.5)); 58 pos_next_X=-200000+(-1).*(floor(200000/(N_DAYS-1)).*(mod(theDate,N_DAYS)-1)); 59 60 pos_next_Z=[0 pos_hublot_Z]; 61 62 else 63 % do nothing 64 return 65 end; % selection id 66 %----------------------- end balayage -------------------- 67 68 delta_pos_Y=pos_next_Y(1)-pos_next_Y(2); 69 delta_pos_X=pos_next_X(1)-pos_next_X(2); 70 delta_pos_Z=pos_next_Z(1)-pos_next_Z(2); 71 72 % from end to start -> from min to max 73 data_sel.X_edges=[pos_next_X(end)-delta_pos_X/2:delta_pos_X:pos_next_X(1)+delta_pos_X/2]; 74 data_sel.Y_edges=[pos_next_Y(end)-delta_pos_Y/2:delta_pos_Y:pos_next_Y(1)+delta_pos_Y/2]; 75 data_sel.Z_edges=[pos_next_Z(end)-delta_pos_Z/2:delta_pos_Z:pos_next_Z(1)+delta_pos_Z/2]; 76 77 % ========================================================= 78 % selection axis/edges for colorplots 79 if (mod(selection_id,1000)==1)||(mod(selection_id,1000)==2) 80 % before 20160410 81 % colorplot X axis - S_POS 82 % colorplot Y axis - X_Pos 83 data_sel.X_axis_var=dvar.DETECT_SPOS; 84 data_sel.X_axis_edges=data_sel.Y_edges; 85 data_sel.Y_axis_var=dvar.DETECT_XPOS; 86 data_sel.Y_axis_edges=data_sel.X_edges; 87 elseif (mod(selection_id,1000)==3) 88 % after 20160409 89 %return 90 end;% selection id 91 % --------------------------------------------------------- 92 93 % XPOS = -200000; 94 data_sel.XPOS_selection{1}{1}={dvar.DETECT_XPOS, '<', -190000}; 95 data_sel.XPOS_selection{1}{2}={dvar.DETECT_XPOS, '>', -210000}; 96 data_sel.XPOS_txt{1}='200k'; 97 98 % XPOS = -400000; 99 data_sel.XPOS_selection{2}{1}={dvar.DETECT_XPOS, '<', -390000}; 100 data_sel.XPOS_selection{2}{2}={dvar.DETECT_XPOS, '>', -410000}; 101 data_sel.XPOS_txt{2}='400k'; 102 103 % exclude pos_hublot_Z 104 data_sel.POS_selection{1}{1}={dvar.DETECT_ZPOS, '<', pos_hublot_Z-100}; 105 data_sel.POS_selection{1}{2}={dvar.DETECT_ZPOS, '>', pos_hublot_Z+100}; 106 % only position pos_hublot_Z 107 data_sel.POS_selection{1}{3}={dvar.DETECT_ZPOS, '>', pos_hublot_Z-100}; 108 data_sel.POS_selection{1}{4}={dvar.DETECT_ZPOS, '<', pos_hublot_Z+100}; 109 data_sel.POS_var{1}=dvar.DETECT_ZPOS; 110 data_sel.POS_txt{1}='Z'; 111 data_sel.POS_edges{1}=data_sel.Z_edges; 112 data_sel.POS_offset{1}(1)=0; 113 data_sel.POS_offset{1}(2)=0; 114 115 % exclude pos_hublot_S 116 data_sel.POS_selection{2}{1}={dvar.DETECT_SPOS, '<', pos_hublot_Y-100}; 117 data_sel.POS_selection{2}{2}={dvar.DETECT_SPOS, '>', pos_hublot_Y+100}; 118 % only position pos_hublot_S 119 data_sel.POS_selection{2}{3}={dvar.DETECT_SPOS, '>', pos_hublot_Y-100}; 120 data_sel.POS_selection{2}{4}={dvar.DETECT_SPOS, '<', pos_hublot_Y+100}; 121 122 data_sel.POS_var{2}=dvar.DETECT_SPOS; 123 data_sel.POS_txt{2}='S'; 124 data_sel.POS_edges{2}=data_sel.Y_edges; 125 data_sel.POS_offset{2}(1)=-650000; 126 data_sel.POS_offset{2}(2)=-450000; 127 128 % RESEAU_POS > 1000000 129 data_sel.RESEAU_POS_selection{1}{1}={dvar.RESEAU_POS, '>', 1000000}; 130 131 % RESEAU_POS < 1000000 132 data_sel.RESEAU_POS_selection{2}{1}={dvar.RESEAU_POS, '<', 1000000}; 133 117 134 end % function 118 135
Note: See TracChangeset
for help on using the changeset viewer.