Changeset 608 in ETALON


Ignore:
Timestamp:
May 10, 2016, 9:19:19 AM (8 years ago)
Author:
malovyts
Message:

modified offline scripts

Location:
SPESO/ana2015
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • SPESO/ana2015/data_select.m

    r459 r608  
    1313
    1414switch vartype
    15     case dvar.RAWINFO
    16         switch varidx
    17             case 1
    18             dataArray=allData.timestamp;
    19             case 2
    20             dataArray=allData.hoursNum;
    21             case 11
    22             dataArray=allData.timestamp-now;
    23         end;
     15        case dvar.RAWINFO
     16                switch varidx
     17                        case 1
     18                                dataArray=allData.timestamp;
     19         case 2
     20                                dataArray=allData.hoursNum;
     21         case 11
     22                                dataArray=allData.timestamp-now;
     23                end;
    2424   case dvar.BEAMINFO
    2525        dataArray=allData.beamInfo(:,varidx);
    26     case dvar.DATAINFO
    27         switch varidx
    28             case 1
    29             dataArray=allData.ch2signalValLPM(:);
    30             case 2
    31             dataArray=allData.ch2signalNegPeakLPM(:);
    32             case 3
    33             dataArray=allData.ch2signalValSPM(:);
    34             case 4
    35             dataArray=allData.ch2signalNegPeakSPM(:);
    36             case 29
    37             dataArray=( fix(allData.hoursNum(:)/10000)*60+...
    38                         fix(mod(allData.hoursNum(:),10000)/100)+...
    39                         mod(allData.hoursNum(:),100)/60);
    40             case 30
    41             dataArray=mod(( fix(allData.hoursNum(:)/10000)*60+...
    42                         fix(mod(allData.hoursNum(:),10000)/100)+...
    43                         mod(allData.hoursNum(:),100)/60), 30);
    44             %case 41
    45             %RS_params=get_RS_params(allData.timestamp);
    46             %dataArray=allData.beamInfo(:,5)-RS_params.RS1_offset.';
    47             %case 42
    48             %RS_params=get_RS_params(allData.timestamp);
    49             %dataArray=allData.beamInfo(:,7)-RS_params.RS2_offset.';
    50             %case 43
    51             %RS_params=get_RS_params(allData.timestamp);
    52             %dataArray=allData.beamInfo(:,9)-RS_params.RS3_offset.';
    53             %case 44
    54             %RS_params=get_RS_params(allData.timestamp);
    55             %dataArray=allData.beamInfo(:,11)-RS_params.RS4_offset.';
    56             otherwise
    57                 warning_sp([ 'The varidx ' varidx ' is unknown.' ]);
    58                 error('end');
    59             end %switch
    60     otherwise
    61         warning_sp([ 'The vartype ' vartype ' is unknown.' ]);
    62         error('end');
     26        case dvar.DATAINFO
     27                switch varidx
     28                        case 1
     29                                dataArray=allData.ch2signalValLPM(:);
     30                        case 2
     31                                dataArray=allData.ch2signalNegPeakLPM(:);
     32                        case 3
     33                                dataArray=allData.ch2signalValSPM(:);
     34                        case 4
     35                                dataArray=allData.ch2signalNegPeakSPM(:);
     36                        case 29
     37                                dataArray=( fix(allData.hoursNum(:)/10000)*60+...
     38                                fix(mod(allData.hoursNum(:),10000)/100)+...
     39                                mod(allData.hoursNum(:),100)/60);
     40                        case 30
     41                                dataArray=mod(( fix(allData.hoursNum(:)/10000)*60+...
     42                                fix(mod(allData.hoursNum(:),10000)/100)+...
     43                                mod(allData.hoursNum(:),100)/60), 30);
     44                        case 41
     45                                RS_params=get_RS_params(allData.timestamp);
     46                                dataArray=allData.beamInfo(:,5)-RS_params.RS1_offset.';
     47                        case 42
     48                                RS_params=get_RS_params(allData.timestamp);
     49                                dataArray=allData.beamInfo(:,7)-RS_params.RS2_offset.';
     50                        case 43
     51                                RS_params=get_RS_params(allData.timestamp);
     52                                dataArray=allData.beamInfo(:,9)-RS_params.RS3_offset.';
     53                        case 44
     54                                RS_params=get_RS_params(allData.timestamp);
     55                                dataArray=allData.beamInfo(:,11)-RS_params.RS4_offset.';
     56
     57                        case 45
     58                                SPOS_offset=-645000; % position of the grating in TS
     59                                X0_pos=220000; % position of the grating in TX
     60                                raw_th=atan((X0_pos-allData.beamInfo(:,15))./...
     61                                                                (allData.beamInfo(:,13)-SPOS_offset)./...
     62                                                                0.6.*0.5)*180/pi;
     63                                % 0.6 - coeff between TS and mm
     64                                % 0.5 - coeff between TX and mm
     65                                dataArray=(-raw_th+(1+sign(raw_th))/2*180)';
     66                                 % conver from 0:-pi/2 - pi/2:0 to 0:pi
     67                        case 46
     68                                SPOS_offset=-470000; % position of the grating in TS
     69                                X0_pos=220000; % position of the grating in TX
     70                                raw_th=atan((X0_pos-allData.beamInfo(:,15))./...
     71                                                                (allData.beamInfo(:,13)-SPOS_offset)./...
     72                                                                0.6.*0.5)*180/pi;
     73                                % 0.6 - coeff between TS and mm
     74                                % 0.5 - coeff between TX and mm
     75                                dataArray=(-raw_th+(1+sign(raw_th))/2*180)';
     76                                 % conver from 0:-pi/2 - pi/2:0 to 0:pi
     77                        case 47
     78                                ZPOS_offset=-66000; % position of the grating in TS
     79                                X0_pos=220000; % position of the grating in TX
     80                                raw_th=atan((X0_pos-allData.beamInfo(:,15))./...
     81                                                                (allData.beamInfo(:,17)-ZPOS_offset)./...
     82                                                                2.48.*0.5)*180/pi;
     83                                % 2.48 - coeff between TZ and mm
     84                                % 0.5 - coeff between TX and mm
     85                                dataArray=(raw_th-sign(raw_th)*90)';
     86                                 % conver from -0:pi/2 - pi/2:0 to -pi/2:pi/2
     87                        case 48
     88                                ZPOS_offset=-66000; % position of the grating in TS
     89                                X0_pos=220000; % position of the grating in TX
     90                                raw_th=atan((X0_pos-allData.beamInfo(:,15))./...
     91                                                                (allData.beamInfo(:,17)-ZPOS_offset)./...
     92                                                                2.48.*0.5)*180/pi;
     93                                % 2.48 - coeff between TZ and mm
     94                                % 0.5 - coeff between TX and mm
     95                                dataArray=(raw_th-sign(raw_th)*90)';
     96                                 % conver from 0:-pi/2 - pi/2:0 to -pi/2:pi/2
     97                        otherwise
     98                                warning_sp([ 'The varidx ' varidx ' is unknown.' ]);
     99                                error('end');
     100      end %switch
     101        otherwise
     102        warning_sp([ 'The vartype ' vartype ' is unknown.' ]);
     103        error('end');
    63104end %switch
    64105
  • SPESO/ana2015/offline_analysis/offline_analyse_multi.m

    r503 r608  
    99
    1010% 2016 03/09 -- 01/01
    11 offline_analysis('2016JanFeb', '20160{30?,2??,1??}.dayFullInfo', 1001); % histo
    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
     11offline_analysis('2016JanFeb', '20160{30?,2[^0]?}.dayFullInfo', 1001); % histo
     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
    1414
    1515% 2016 04/09 -- 03/09
    16 offline_analysis('2016Mar', '20160{40?,3[^1]?,31[^3]}.dayFullInfo', 2002); % colorplots
     16%offline_analysis('2016Mar', '20160{40?,3[^1]?,31[^3]}.dayFullInfo', 2002); % colorplots
    1717
    1818%offline_analysis('1', );
  • SPESO/ana2015/offline_analysis/offline_histograms.m

    r512 r608  
    4848x_pos=cell(array_length,1);
    4949theta=cell(array_length,1);
     50spos=cell(array_length,1);
    5051values=cell(array_length,1);
    5152value_error=cell(array_length,1);
     
    148149                close(fih);
    149150                % -------------------------------------------------
    150        
     151
     152                if POSloop==2
     153                        idx=idx+1;
     154                        Q{idx}=QICT1loop;
     155                        Signal_PM{idx}=LPMloop;
     156                        x_pos{idx}=XPOSloop;
     157                        spos{idx}=bins.bins1(2,:);
     158                        values{idx}=bins.bins1(1,:)-bins.bins2(1,:);
     159                        bins_elem_num{idx}=bins.bins1(4,:);
     160                        Detector{idx}=DetLoop;
     161                        value_error{idx}=bins.bins1(3,:);
     162                        %signal_values=signal_bins.bins1(1,:);
     163                        %bg_values=signal_bins.bins2(1,:);
     164                        %positions=signal_bins.bins1(2,:);
     165                end;
     166                       
     167                % detector efficiency limits
     168                        y1=97.58;
     169                        y2=75;
     170                        y3=84.78;
     171                        y4=66.42;
     172                % select the rotation coordinate, based on the detector and the coordiante of movement
    151173                switch(POSloop+(DetLoop-1)*2)
    152174                                case 1
    153                                         DATA_RS=dvar.DATA_RS3_OFFSET;                           
     175                                        DATA_RS=dvar.DATA_DET1_PHI;                             
    154176                                        RS_edges=[-50:1:50];
    155177                                case 2
    156                                         DATA_RS=dvar.DATA_RS1_OFFSET;                           
     178                                        DATA_RS=dvar.DATA_DET1_THETA;                           
    157179                                        RS_edges=[40:2:140];
    158180                                case 3
    159                                         DATA_RS=dvar.DATA_RS4_OFFSET;                           
     181                                        DATA_RS=dvar.DATA_DET2_PHI;                             
    160182                                        RS_edges=[-50:1:50];
    161183                                case 4
    162                                         DATA_RS=dvar.DATA_RS2_OFFSET;                           
     184                                        DATA_RS=dvar.DATA_DET2_THETA;                           
    163185                                        RS_edges=[40:2:140];
    164186                                otherwise
     
    180202                close(fih);
    181203                % -------------------------------------------------
     204                %{
     205                % save val vs RS
    182206                if POSloop==2
    183207                        idx=idx+1;
     
    194218                        %positions=signal_bins.bins1(2,:);
    195219                end;
    196 
     220                %}
     221                % ================ angle vs pos ===============
     222                fih = figure(1);
     223                        sch=data_scatter2d(POS_var{POSloop}, DATA_RS);
     224                        xlimits=get(gca, 'XLim');
     225                        set(sch, 'MarkerFaceColor', 'r')
     226                        % if S_POS
     227                        if POSloop==2
     228                                % angles to display
     229                                ylim([60 120]);
     230                                hold on
     231                                % efficiency of current detectro
     232                                p1=plot(xlimits, [y1 y1],xlimits, [y2 y2], 'LineWidth', 2);
     233                                set(p1(1), 'Color', 'r')
     234                                set(p1(2), 'Color', 'r')
     235                                % efficiency of other detector
     236                                p2=plot(xlimits, [y3 y3],xlimits, [y4 y4], 'LineWidth', 2);
     237                                set(p2(1), 'Color', 'b')
     238                                set(p2(2), 'Color', 'b')
     239                                hold off
     240                                legend({'Angles vs Pos', 'Det1 eff.', ' ','Det2 eff.', ' '}, 'Location', 'best');
     241                        end
     242                        set(gcf,'PaperUnits','inches','PaperPosition',[0 0 12 9]);
     243                        print_fig(fih, [ figures_path 'POS_vs_ANG' num2str(DetLoop) '_' pars_txt '.png' ]);
     244                close(fih);
     245                % -------------------------------------------------
    197246          end; % DetLoop
    198247         end; % XPOSloop
     
    205254                'Signal_PM',...
    206255                'x_pos',...
    207                 'theta',...
     256                'spos',...
    208257                'values',...
    209258                'value_error',...
  • SPESO/ana2015/offline_analysis/offline_histograms_html.m

    r503 r608  
    5656  html_print_img(img_name, '400');
    5757
     58                html_print_tag('br');
     59                html_print_tag('/');
    5860  for LPMloop  =1:length(LPM_txt)
    59         for QICT1loop=1:length(QICT1_txt)
    60     for XPOSloop =1:length(XPOS_txt)
     61   for XPOSloop =1:length(XPOS_txt)
     62                html_print_tag('table');
     63                html_print_tag('tr');
     64         for QICT1loop=1:length(QICT1_txt)
     65                html_print_tag('td');
    6166                pars_txt=[LPM_txt{LPMloop}...
    6267                                         '_vs_POS_' POS_txt{POSloop}...
     
    6671                params_list='';
    6772
    68           html_print_tag('table', 'border="2"');
     73          html_print_tag('table', 'border="2" style="display: inline-table;"');
     74
     75          html_print_tag('tr');
     76          html_print_tag('td', 'colspan="4"', pars_txt);
     77     html_print_tag('/tr');
    6978
    7079     html_print_tag('tr');
     
    98107     html_print_tag('/tr');
    99108               
     109
     110          html_print_tag('tr');
     111          html_print_tag('td', 'colspan="4"', pars_txt);
     112     html_print_tag('/tr');
     113
    100114          html_print_tag('tr');
    101115          html_print_tag('td', '','Comparison');
     
    105119      html_print_tag('/td');
    106120          html_print_tag('td', '','');
     121     html_print_tag('/tr');
     122
     123
     124          html_print_tag('tr');
     125          html_print_tag('td', 'colspan="4"', pars_txt);
    107126     html_print_tag('/tr');
    108127
     
    117136          html_print_tag('td', '','');
    118137     html_print_tag('/tr');
     138     html_print_tag('tr');
     139
     140          html_print_tag('td', '','Polar');
     141     for DetLoop=1:2
     142                img_name=([ 'POS_vs_ANG' num2str(DetLoop) '_' pars_txt '.png'] );
     143           html_print_tag('td');
     144           html_print_img(img_name, '400');
     145           html_print_tag('/td');
     146          end;
     147          html_print_tag('td', '','');
     148     html_print_tag('/tr');
     149
    119150          html_print_tag('/table');
    120     end;% XPOSloop
    121    end;% QICT1loop
     151                html_print_tag('/td');
     152         end;% QICT1loop
     153                html_print_tag('/tr');
     154                html_print_tag('/table');
     155   end;% XPOSloop
    122156  end;% LPMloop
    123157                  html_print_tag('/body');
  • SPESO/ana2015/offline_analysis/offline_normalize_spectrum.m

    r513 r608  
     1addpath('../');
    12load('ExperimentSpectrum_20160421.mat')
    2 
     3wr_28_bar;
     4wr_22_bar;
     5
     6% script to analyse data from the offline_histogram
     7% the radius is selected for each X_POS
     8% X_POS=400k (2), r=310mm
     9% X_POS=200k (1), r=210mm
     10% for other values see offline_select;
    311global offline_figures_path;
    412
     
    614
    715r0=x_pos;
     16
     17theta=spos;
     18delta_th=spos;
     19ant_eff=spos;
     20for thetaloop=1:length(r0)
     21        switch x_pos{thetaloop}
     22                case 1
     23                        r0{thetaloop}=310-100;
     24                        TposX=-200000;
     25                        TposZ=-66000;
     26                case 2
     27                        r0{thetaloop}=310;
     28                        TposX=-400000;
     29                        TposZ=-66000;
     30                otherwise
     31                        r0{thetaloop}=310; %mm
     32        end;
     33        if Detector{thetaloop}==1
     34                ds=-632000;
     35        else
     36                ds=-465000;
     37        end;
     38        raw_th=atan(r0{thetaloop}./(spos{thetaloop}-ds).*1000./0.6)*180/pi;
     39        theta{thetaloop}=180-(-raw_th+(1+sign(raw_th))/2*180);
     40        rs=SPESO_get_angles(TposX,spos{thetaloop},TposZ);
     41        if Detector{thetaloop}==1
     42                %theta{thetaloop}
     43                %rs{1}
     44                delta_th{thetaloop}=rs{1}-theta{thetaloop};
     45                for jloop=1:length(theta{thetaloop})
     46                        eff_sum=interp1(wr_28_corr(1,:),wr_28_corr(2,:),...
     47                                                                         (delta_th{thetaloop}(jloop)+[-7:7]));
     48                        ant_eff{thetaloop}(jloop)=sum(eff_sum)/length(eff_sum);
     49                end
     50        else
     51                %theta{thetaloop}
     52                %rs{2}
     53                delta_th{thetaloop}=rs{2}-theta{thetaloop};
     54                for jloop=1:length(theta{thetaloop})
     55                        eff_sum=interp1(wr_22_corr(1,:),wr_22_corr(2,:),...
     56                                                                         (delta_th{thetaloop}(jloop)+[-7:7]));
     57                        ant_eff{thetaloop}(jloop)=sum(eff_sum)/length(eff_sum);
     58                end
     59        end;
     60end;
     61
     62
    863Q_bunch=Q;
    964PM=Signal_PM;
     
    1166nu=theta;
    1267correction_factor=theta;
     68corrected_values=theta;
     69corrected_value_error=theta;
     70% detector effeciency ranges
     71% first detector
     72y1=97.58;
     73y2=75;
     74% second detector
     75y3=84.78;
     76y4=66.42;
    1377
    1478for iloop=1:length(Q)
     79        % remove bins with zero elements
    1580        zero_elems=find(bins_elem_num{iloop}==0);
    1681        bins_elem_num{iloop}(zero_elems)=[];
     
    2186        value_error{iloop}(zero_elems)=[];
    2287        correction_factor{iloop}(zero_elems)=[];
    23 
     88   corrected_values{iloop}(zero_elems)=[];
     89   corrected_value_error{iloop}(zero_elems)=[];
     90        delta_th{iloop}(zero_elems)=[];
     91        ant_eff{iloop}(zero_elems)=[];
     92        lambda{iloop}=10.*(1-cos(theta{iloop}.*pi./180));
     93        nu{iloop}=3*10^11./lambda{iloop};
     94       
     95        if Detector{iloop}==1
     96                eff_selection=find(nu{iloop}>40*10^9|nu{iloop}<26.5*10^9);
     97        end;
    2498        if Detector{iloop}==2
    25                 values{iloop}=-values{iloop};
    26         end;
    27 
     99                eff_selection=find(nu{iloop}>50*10^9|nu{iloop}<33*10^9);
     100                % invert values of the second detector
     101                % normalize, to be the same intensity as the first detector signal
     102                values{iloop}=-values{iloop}*3;
     103        end;
     104       
     105%{     
     106        %remove the data out of the efficiency boundaries
     107        bins_elem_num{iloop}(eff_selection)=[];
     108   lambda{iloop}(eff_selection)=[];
     109   nu{iloop}(eff_selection)=[];
     110   theta{iloop}(eff_selection)=[];
     111   values{iloop}(eff_selection)=[];
     112   value_error{iloop}(eff_selection)=[];
     113   correction_factor{iloop}(eff_selection)=[];
     114   corrected_values{iloop}(eff_selection)=[];
     115   corrected_value_error{iloop}(eff_selection)=[];
     116        delta_th{iloop}(eff_selection)=[];
     117        ant_eff{iloop}(eff_selection)=[];
     118%}     
     119
     120        % select radius from the x_pos #
    28121        switch x_pos{iloop}
    29122                case 1
     
    35128        end;
    36129
     130        % select charge from the Q #
    37131        switch Q{iloop}
    38132                case 1
     
    55149        end;
    56150        % d, theta, N, r0
    57    correction_factor{iloop}=data_corrFactor(10, theta{iloop}, 9, r0{iloop});
    58         corrected_values{iloop}=values{iloop}.*correction_factor{iloop};
    59         corrected_value_error{iloop}=value_error{iloop}.*correction_factor{iloop};
    60         lambda{iloop}=10.*(1-cos(theta{iloop}.*pi./180));
    61         nu{iloop}=3*10^11./lambda{iloop};
     151        for th_loop=1:length(theta{iloop})
     152                % taking into account different distances, based on theta
     153                r_tmp=r0{iloop}/sin(theta{iloop}(th_loop)*pi/180);
     154                correction_factor{iloop}(th_loop)=data_corrFactor(10, theta{iloop}(th_loop), 9, r_tmp);
     155                corrected_values{iloop}(th_loop)=...
     156                        values{iloop}(th_loop)...
     157                        ./correction_factor{iloop}(th_loop)...
     158                        .*r_tmp^2/r0{iloop}^2;
     159                corrected_value_error{iloop}(th_loop)=...
     160                        value_error{iloop}(th_loop)...
     161                        ./correction_factor{iloop}(th_loop).*r_tmp^2/r0{iloop}^2;
     162        end
     163end; % iloop
     164
     165val_comb=cell(length(Q)/2,1);
     166val_norm_comb=cell(length(Q)/2,1);
     167theta_comb=cell(length(Q)/2,1);
     168lambda_comb=cell(length(Q)/2,1);
     169nu_comb=cell(length(Q)/2,1);
     170
     171det1_idx=7;
     172det2_idx=8;
     173
     174Det2_val_raw=[values{det2_idx}]/3;
     175Det1_val_raw=[values{det1_idx}];
     176bins_elem_num{det1_idx}
     177bins_elem_num{det2_idx}
     178Det2_val=[corrected_values{det2_idx}]/3;
     179Det1_val=[corrected_values{det1_idx}];
     180Det2_th=[theta{det2_idx}];
     181Det1_th=[theta{det1_idx}];
     182Det2_lambda=[lambda{det2_idx}];
     183Det1_lambda=[lambda{det1_idx}];
     184Det2_nu=[nu{det2_idx}];
     185Det1_nu=[nu{det1_idx}];
     186Det2_err=[corrected_value_error{det2_idx}];
     187Det1_err=[corrected_value_error{det1_idx}];
     188Det2_bor=[delta_th{det2_idx}];
     189Det1_bor=[delta_th{det1_idx}];
     190Det2_ant_eff=[ant_eff{det2_idx}];
     191Det1_ant_eff=[ant_eff{det1_idx}];
     192
     193load('SC_RRR_10000fs.mat');
     194
     195dth_det1=interp1([40 Det1_th 140], [Det1_bor(1) Det1_bor Det1_bor(end)],sp_theta);
     196d_eff1=ones(1,length(sp_theta));
     197for iloop=1:length(sp_theta);
     198eff_sum=interp1(wr_28_corr(1,:),wr_28_corr(2,:), (dth_det1(iloop)+[-7:7]));
     199d_eff1(iloop)=sum(eff_sum)/length(eff_sum);
     200end
     201
     202dth_det2=interp1([40 Det2_th 140], [Det2_bor(1) Det2_bor Det2_bor(end)],sp_theta);
     203d_eff2=ones(1,length(sp_theta));
     204for iloop=1:length(sp_theta);
     205eff_sum=interp1(wr_22_corr(1,:),wr_22_corr(2,:), (dth_det2(iloop)+[-7:7]));
     206d_eff2(iloop)=sum(eff_sum)/length(eff_sum);
     207end
     208
     209        coeff=1/20*10^12/310^2*data_corrFactor(10, sp_theta, 9, r0{7})...
     210                /1000*1000*(1-exp(-50*10^6*20*10^-12)).*exp(d_eff2/10)*30;
     211               
    62212        fih=figure(1);
    63         plot(theta{iloop}, values{iloop})
    64         print(fih, [figures_path 'test_plot' num2str(iloop) '.png'] , '-dpng')
    65         close(fih);
    66         fih=figure(1);
    67         plot(theta{iloop}, corrected_values{iloop})
    68         print(fih, [figures_path 'ntest_plot' num2str(iloop) '.png'] , '-dpng')
    69         close(fih);
    70 end; % iloop
     213        plot(Det1_th, Det1_val_raw-0.002, '--', 'LineWidth', 2, 'Color', [0 0.5 0]);
     214        xlim([40 140]);
     215        hold on
     216        plot(Det2_th, Det2_val_raw*3-0.002, '--', 'LineWidth', 2, 'Color', [0.19 0.55 0.91]);
     217   %plot(Det1_th, Det1_val, 'LineWidth', 2, 'Color', [0 0.75 0.24]);
     218        %plot(Det2_th, Det2_val*3, 'LineWidth', 2, 'Color', [0 0 1]);
     219        %plot(sp_theta, sp_val_sum_RRR_far.*4*10^2, 'LineWidth', 2, 'Color', [1 1 0]);
     220%{
     221        load('SC_RRR_10000fs.mat')
     222        %sp_val_sum_SC=sp_val_sum_SC(1,1:15).*exp(d_eff(1,1:15)/10);
     223        %sp_val_sum_SC=sp_val_sum_SC.*max(Det1_val_raw)/max(sp_val_sum_SC.*...
     224        %                                       data_corrFactor(10, sp_theta, 9, r0{7})).*...
     225        %                                       data_corrFactor(10, sp_theta, 9, r0{7});
     226        sp_val_sum_SC=sp_val_sum_SC.*coeff;
     227        plot(sp_theta, sp_val_sum_SC, '-s', 'LineWidth', 1, 'Color', [0 0 0]);
     228        load('SC_RRR_12000fs.mat')
     229        %sp_val_sum_SC=sp_val_sum_SC(1,1:15).*exp(d_eff(1,1:15)/10);
     230        %sp_val_sum_SC=sp_val_sum_SC.*max(Det1_val_raw)/max(sp_val_sum_SC.*...
     231        %                                       data_corrFactor(10, sp_theta, 9, r0{7})).*...
     232        %                                       data_corrFactor(10, sp_theta, 9, r0{7});
     233        sp_val_sum_SC=sp_val_sum_SC.*coeff;
     234
     235        plot(sp_theta, sp_val_sum_SC, '-+', 'LineWidth', 1, 'Color', [0 0 0]);
     236        load('SC_RRR_12500fs.mat')
     237        sp_val_sum_SC=sp_val_sum_SC.*coeff;
     238        %sp_val_sum_SC=sp_val_sum_SC(1,1:15).*exp(d_eff(1,1:15)/10);
     239        %sp_val_sum_SC=sp_val_sum_SC.*max(Det1_val_raw)/max(sp_val_sum_SC.*...
     240        %                                       data_corrFactor(10, sp_theta, 9, r0{7})).*...
     241        %                                       data_corrFactor(10, sp_theta, 9, r0{7});
     242        plot(sp_theta, sp_val_sum_SC, '-o',  'LineWidth', 1, 'Color', [0 0 0]);
     243        load('SC_RRR_15000fs.mat')
     244        sp_val_sum_SC=sp_val_sum_SC.*coeff;
     245        %sp_val_sum_SC=sp_val_sum_SC(1,1:15).*exp(d_eff(1,1:15)/10);
     246        %sp_val_sum_SC=sp_val_sum_SC.*max(Det1_val_raw)/max(sp_val_sum_SC.*...
     247        %                                       data_corrFactor(10, sp_theta(1,1:15), 9, r0{7})).*...
     248        %                                       data_corrFactor(10, sp_theta(1,1:15), 9, r0{7});
     249        plot(sp_theta, sp_val_sum_SC, '-x', 'LineWidth', 1, 'Color', [0 0 0]);
     250        load('SC_RRR_20000fs.mat')
     251        sp_val_sum_SC=sp_val_sum_SC.*coeff;
     252        %sp_val_sum_SC=sp_val_sum_SC(1,1:15).*exp(d_eff(1,1:15)/10);
     253        %sp_val_sum_SC=sp_val_sum_SC.*max(Det1_val_raw)/max(sp_val_sum_SC.*...
     254        %                                       data_corrFactor(10, sp_theta(1,1:15), 9, r0{7})).*...
     255        %                                       data_corrFactor(10, sp_theta(1,1:15), 9, r0{7});
     256        plot(sp_theta, sp_val_sum_SC, '-^', 'LineWidth', 1, 'Color', [0 0 0]);
     257%}
     258        hold off
     259        legend('Det1 raw', 'Det2 raw',...
     260                                ... 'Det1 corrected', 'Det2 corrected',...
     261                         'SC FWHM=10ps', 'SC FWHM=12ps', 'SC FWHM=12.5ps', 'SC FWHM=15ps', 'SC FWHM=20ps',...
     262                         'Location', 'northwest');
     263        xlabel('theta, degree');
     264        ylabel('magnitude, V')
     265        title('SPM Data. R=310mm')
     266   set(findall(gcf,'type','text'),'FontSize',20)%'fontWeight','bold')
     267    set(gca,'fontsize',20)
     268   set(gcf,'PaperUnits','inches','PaperPosition',[0 0 12 9])
     269   print(fih, [figures_path 'test_plot.png'] , '-dpng', '-r300')
     270   close(fih);
     271       
     272 %  fih=figure(1);
     273 %  plot(new_nu1, new_val1)
     274 %  print(fih, [figures_path 'ntest_plot.png'] , '-dpng')
     275 %  close(fih);
     276       
     277%for iloop=1:length(val_comb)
     278%val_comb
     279%end; % iloop
     280
    71281
    72282
     
    87297                '-mat');
    88298
     299save('NormalizedSpectrum_20160429.mat',...
     300                'Det1_val',... % corrected value
     301                'Det1_val_raw',... % raw value
     302                'Det1_th',... % observation angle
     303                'Det1_lambda',... % wavelength
     304                'Det1_nu',... % frequency
     305                'Det1_err',... % errors
     306                'Det1_bor',... % aifference of observation and detector angles
     307                'Det2_val',...
     308                'Det2_val_raw',...
     309                'Det2_th',...
     310                'Det2_lambda',...
     311                'Det2_nu',...
     312                'Det2_err',...
     313                'Det2_bor',...
     314                '-mat');
     315
Note: See TracChangeset for help on using the changeset viewer.