% PPALLDATA_P43
%
%    PPALLDATA_P43 - Analyse 30/10/06 Pepperpot data with P43 screen

    clear all ; close all ;

%    'E:\pepperpot\30_10_06\Background01.tif'
%    'E:\pepperpot\30_10_06\Ruler_30-10_06A.tif'
%    'E:\pepperpot\30_10_06\Ruler_30-10_06B.tif'

%    ppbgfname = (['E:\pepperpot\30_10_06\Ruler_30-10_06A.tif']) ;
    ppbgfname = (['E:\pepperpot\30_10_06\Ruler_30-10_06A_data.mat']) ;

    midpos = [1126 1180] ;
    lpos = [231 156] ;
    rpos_14 = [1920 169] ;
    diff = rpos_14 - lpos ;
    diff_16 = (diff./14).*16 ;
    rpos = round(lpos + diff_16) ;
    pplim = 120 ;
    width = 51 ;
    zlen = 13 ;
    rotang = ( ( 90 + 11.25 )./360 ).*( 2.*pi ) ;
%    rotang = 0 ;
%    plt = [0 0 0 0 0 1 0 1] ;
    plt = [2 2 0 1 0 1 1 1] ;

%    [ppimbg,stdmbg,pphistbg,ppbgminmax] = pepperplotfun(ppbgfname,0,[2 0]) ;

%    ppbgmin = ppbgminmax(1) ; ppbgmax = ppbgminmax(2) ;
%    load E:\pepperpot\cal_data\pixcal.mat ;
%    load E:\pepperpot\cal_data\ppcaldat_good.mat ;

%    [midp,imtilt,rulen] = pptiltfind(ppimbg,lpos,rpos) ;

    [ppposdat_35,ppemitdat_35,ppimstdxy_35] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_35_2,ppemitdat_35_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_35kV_10_2.tif',pplim,width,zlen,rotang,35e3,plt) ;

    break

    [ppposdat_0,ppemitdat_0] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_0kV_10.tif',pplim,width,zlen,rotang,0e3,plt) ;
    [ppposdat_11,ppemitdat_11] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_11kV_10.tif',pplim,width,zlen,rotang,11e3,plt) ;
    [ppposdat_20,ppemitdat_20] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_20kV_10.tif',pplim,width,zlen,rotang,20e3,plt) ;
    [ppposdat_25,ppemitdat_25] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_25kV_10.tif',pplim,width,zlen,rotang,25e3,plt) ;
    [ppposdat_30,ppemitdat_30] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_30kV_10.tif',pplim,width,zlen,rotang,30e3,plt) ;
    [ppposdat_35,ppemitdat_35] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_0_2,ppemitdat_0_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_0kV_10_2.tif',pplim,width,zlen,rotang,0e3,plt) ;
    [ppposdat_11_2,ppemitdat_11_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_11kV_10_2.tif',pplim,width,zlen,rotang,11e3,plt) ;
    [ppposdat_20_2,ppemitdat_20_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_20kV_10_2.tif',pplim,width,zlen,rotang,20e3,plt) ;
    [ppposdat_25_2,ppemitdat_25_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_25kV_10_2.tif',pplim,width,zlen,rotang,25e3,plt) ;
    [ppposdat_30_2,ppemitdat_30_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\30_10_06\10ms_11kV_30kV_10_2.tif',pplim,width,zlen,rotang,30e3,plt) ;

    return


