% ppalldata_04_04_07

    clear all ; close all ;

    tl = [952 952] ; tr = [1097 952] ;
    br = [1097 1096] ; bl = [952 1097] ;

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

    ppalignname = ([dir 'alignment01.tif']) ;

    [midpos,sp2sp,imtilt] = ppcalfind(ppalignname,tl,tr,bl,br,1) ;

    cent = [1024 1024] ;
%    cent = [1051 1045] ;
    pplim = 120 ;
    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 ;

%    [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 'PP04042007001.tif'],[],cent,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [ppposdat_30mm_9kV,ppemitdat_30mm_9kV,ppim_30mm_6kV] = ...
%        ppanalyse41([dir 'PP04042007002.tif'],[],cent,imtilt,sp2sp, ...
%        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [ppposdat_120mm_9kV,ppemitdat_120mm_9kV,ppim_120mm_9kV,pppixemit5d_120mm_9kV,pppixemit2d_120mm_9kV,ppemithist_120mm_9kV] = ...
    [ppposdat_120mm_9kV,ppemitdat_120mm_9kV,ppim_120mm_9kV] = ...
        ppanalyse41([dir 'PP04042007005.tif'],[],cent,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [ppposdat_240mm_9kV,ppemitdat_240mm_9kV,ppim_240mm_9kV,pppixemit5d_240mm_9kV,pppixemit2d_240mm_9kV,ppemithist_240mm_9kV] = ...
    [ppposdat_240mm_9kV,ppemitdat_240mm_9kV,ppim_240mm_9kV] = ...
        ppanalyse41([dir 'PP04042007009.tif'],[],cent,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

    tl2 = [858 809] ; tr2 = [1005 811] ;
    br2 = [1003 958] ; bl2 = [857 956] ;

    [midpos2,sp2sp2,imtilt2] = ppcalfind([dir 'PP04042007010.tif'],tl2,tr2,bl2,br2,1) ;

%    [ppposdat_260mm_9kV,ppemitdat_260mm_9kV,ppim_260mm_9kV,pppixemit5d_260mm_9kV,pppixemit2d_260mm_9kV,ppemithist_260mm_9kV] = ...
    [ppposdat_260mm_9kV,ppemitdat_260mm_9kV,ppim_260mm_9kV] = ...
        ppanalyse41([dir 'PP04042007010.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [ppposdat_0mm_15kV,ppemitdat_0mm_15kV,ppim_0mm_15kV,pppixemit5d_0mm_15kV,pppixemit2d_0mm_15kV,ppemithist_0mm_15kV] = ...
    [ppposdat_0mm_15kV,ppemitdat_0mm_15kV,ppim_0mm_15kV] = ...
        ppanalyse41([dir 'PP04042007022.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [ppposdat_100mm_15kV,ppemitdat_100mm_15kV,ppim_100mm_15kV,pppixemit5d_100mm_15kV,pppixemit2d_100mm_15kV,ppemithist_100mm_15kV] = ...
    [ppposdat_100mm_15kV,ppemitdat_100mm_15kV,ppim_100mm_15kV] = ...
        ppanalyse41([dir 'PP04042007021.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [ppposdat_200mm_15kV,ppemitdat_200mm_15kV,ppim_200mm_15kV,pppixemit5d_200mm_15kV,pppixemit2d_200mm_15kV,ppemithist_200mm_15kV] = ...
    [ppposdat_200mm_15kV,ppemitdat_200mm_15kV,ppim_200mm_15kV] = ...
        ppanalyse41([dir 'PP04042007020.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [ppposdat_260mm_15kV,ppemitdat_260mm_15kV,ppim_260mm_15kV,pppixemit5d_260mm_15kV,pppixemit2d_260mm_15kV,ppemithist_260mm_15kV] = ...
    [ppposdat_260mm_15kV,ppemitdat_260mm_15kV,ppim_260mm_15kV] = ...
        ppanalyse41([dir 'PP04042007019.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [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 'PP04042007032.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [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 'PP04042007033.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [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 'PP04042007034.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

%    [ppposdat_260mm_6kV,ppemitdat_260mm_6kV,ppim_260mm_6kV,pppixemit5d_260mm_6kV,pppixemit2d_260mm_6kV,ppemithist_260mm_6kV] = ...
    [ppposdat_260mm_6kV,ppemitdat_260mm_6kV,ppim_260mm_6kV] = ...
        ppanalyse41([dir 'PP04042007035.tif'],[],cent,imtilt2,sp2sp, ...
        pplim,width,zlen,rotang,energy,plt,bitdiv) ;

    return