% PPALLDATA_YAG
%
%    PPALLDATA_YAG - Analyse 22/11/06 Pepperpot data with YAG:Ce screen

    clear all ; close all ;

%    'E:\pepperpot\22_11_06_YAG\YAG_500ms_ruler_10.tif'

%    ppbgfname = (['E:\pepperpot\22_11_06_YAG\YAG_500ms_ruler_10.tif']) ;
    ppbgfname = (['E:\pepperpot\22_11_06_YAG\YAG_500ms_ruler_10_data.mat']) ;

    midpos = [1165 907] ;
    lpos = [260 1695] ;
    rpos = [1958 1804] ;
    pplim = 110 ;
    width = 51 ;
    zlen = 13 ;
    rotang = ( ( 90 + 11.25 )./360 ).*( 2.*pi ) ;
%    rotang = 0 ;
    plt = [2 2 0 1 1 1 0 1] ;
%    plt = [2 0 0 0 1 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) ;
%    [midp,imtilt,rulen] = pptiltfind(ppimbg,lpos,rpos) ;

    [ppposdat_10ms,ppemitdat_10ms,pppixemit5d_10ms,pppixemit2d_10ms,ppemithist_10ms] = ...
        ppanalyse(ppbgfname,lpos,rpos,midpos,'E:\pepperpot\22_11_06_YAG\YAG_10ms_17kV_35kV_10.tif', ...
        pplim,width,zlen,rotang,35e3,plt) ;

    break

    [ppposdat_100ms,ppemitdat_100ms,ppimstdxy_100ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_100ms_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_100ms_2,ppemitdat_100ms_2,ppimstdxy_100ms_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_100ms_17kV_35kV_10_2.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_50ms,ppemitdat_50ms,ppimstdxy_50ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_50ms_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_20ms,ppemitdat_20ms,ppimstdxy_20ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_20ms_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_10ms,ppemitdat_10ms,ppimstdxy_10ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_10ms_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_5ms,ppemitdat_5ms,ppimstdxy_5ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_5ms_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_2ms,ppemitdat_2ms,ppimstdxy_2ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_2ms_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_1ms,ppemitdat_1ms,ppimstdxy_1ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_1ms_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_500us,ppemitdat_500us,ppimstdxy_500us] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_500us_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_200us,ppemitdat_200us,ppimstdxy_200us] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_200us_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_100us,ppemitdat_100us,ppimstdxy_100us] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_100us_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_50us,ppemitdat_50us,ppimstdxy_50us] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_50us_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_20us,ppemitdat_20us,ppimstdxy_20us] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_20us_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_10us,ppemitdat_10us,ppimstdxy_10us] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_10us_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;

    [ppposdat_1ms,ppemitdat_1ms,ppimstdxy_1ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_1ms_17kV_35kV_10.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_1ms_2,ppemitdat_1ms_2,ppimstdxy_1ms_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_1ms_17kV_35kV_10_2.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_1ms_3,ppemitdat_1ms_3,ppimstdxy_1ms_3] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_1ms_17kV_35kV_10_3.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_1ms_4,ppemitdat_1ms_4,ppimstdxy_1ms_4] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_1ms_17kV_35kV_10_4.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_1ms_5,ppemitdat_1ms_5,ppimstdxy_1ms_5] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_1ms_17kV_35kV_10_5.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_1ms_6,ppemitdat_1ms_6,ppimstdxy_1ms_6] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\22_11_06_YAG\YAG_1ms_17kV_35kV_10_6.tif',pplim,width,zlen,rotang,35e3,plt) ;

    return


