% ppalldata_04_05_07_6kV

    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] ;
    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],1) ;

%    [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_6kV_35kV_100mm_cal.tif'],[973 946],[1114 947],1) ;

%    [ppposdat_100mm_6kV,ppemitdat_100mm_6kV,ppim_100mm_6kV,pppixemit5d_100mm_6kV,pppixemit2d_100mm_6kV,ppemithist_100mm_6kV] = ...
    [ppposdat_100mm_6kV,ppemitdat_100mm_6kV,ppim_100mm_6kV] = ...
        ppanalyse41([dir 'pp_6kV_35kV_100mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_6kV_35kV_200mm_cal.tif'],[974 942],[1115 943],1) ;

%    [ppposdat_200mm_6kV,ppemitdat_200mm_6kV,ppim_200mm_6kV,pppixemit5d_200mm_6kV,pppixemit2d_200mm_6kV,ppemithist_200mm_6kV] = ...
    [ppposdat_200mm_6kV,ppemitdat_200mm_6kV,ppim_200mm_6kV] = ...
        ppanalyse41([dir 'pp_6kV_35kV_200mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        150,width,zlen,rotang,35e3,plt,bitdiv) ;

    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_6kV_35kV_300mm_cal.tif'],[974 944],[1115 945],1) ;

%    [ppposdat_300mm_6kV,ppemitdat_300mm_6kV,ppim_300mm_6kV,pppixemit5d_300mm_6kV,pppixemit2d_300mm_6kV,ppemithist_300mm_6kV] = ...
    [ppposdat_300mm_6kV,ppemitdat_300mm_6kV,ppim_300mm_6kV] = ...
        ppanalyse41([dir 'pp_6kV_35kV_300mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

    return