% ppalldata_04_05_07_0mm

    clear all ; close all ;

    cent = [1024 1024] ;
%    cent = [1051 1045] ;
    pplim = 140 ;
    width = 45 ;
    zlen = 10 ;
    rotang = 0 ;
%    energy = 35e3 ;
%    plt = [2 2 1 1 1 2 1 0 1 2] ;
    plt = [0 0 1 0 0 2 1 0 1 2] ;
    calplt = 0 ;
    bitdiv = 4 ;

    [ppdir,slash] = getppdir ;
    datdir = ('04_05_07') ;
    dir = ([ppdir slash datdir slash]) ;

    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_6kV_35kV_0mm_cal.tif'],[974 956],[1115 957],calplt) ;

%    [ppposdat_0mm_6kV,ppemitdat_0mm_6kV,ppim_0mm_6kV,pppixemit5d_0mm_6kV,pppixemit2d_0mm_6kV,ppemithist_0mm_6kV] = ...
    [ppposdat_0mm_6kV,ppemitdat_0mm_6kV,ppim_0mm_6kV] = ...
        ppanalyse41([dir 'pp_6kV_35kV_0mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_9kV_35kV_0mm_cal.tif'],[974 956],[1115 957],calplt) ;

%    [ppposdat_0mm_9kV,ppemitdat_0mm_9kV,ppim_0mm_9kV,pppixemit5d_0mm_9kV,pppixemit2d_0mm_9kV,ppemithist_0mm_9kV] = ...
    [ppposdat_0mm_9kV,ppemitdat_0mm_9kV,ppim_0mm_9kV] = ...
        ppanalyse41([dir 'pp_9kV_35kV_0mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_13kV_35kV_0mm_cal.tif'],[974 958],[1115 959],calplt) ;

%    [ppposdat_0mm_13kV,ppemitdat_0mm_13kV,ppim_0mm_13kV,pppixemit5d_0mm_13kV,pppixemit2d_0mm_13kV,ppemithist_0mm_13kV] = ...
    [ppposdat_0mm_13kV,ppemitdat_0mm_13kV,ppim_0mm_13kV] = ...
        ppanalyse41([dir 'pp_13kV_35kV_0mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_17kV_35kV_0mm_cal.tif'],[974 957],[1115 958],calplt) ;

%    [ppposdat_0mm_17kV,ppemitdat_0mm_17kV,ppim_0mm_17kV,pppixemit5d_0mm_17kV,pppixemit2d_0mm_17kV,ppemithist_0mm_17kV] = ...
    [ppposdat_0mm_17kV,ppemitdat_0mm_17kV,ppim_0mm_17kV] = ...
        ppanalyse41([dir 'pp_17kV_35kV_0mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

    return