% ppalldata_04_05_07_13kV

    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_13kV_35kV_0mm_cal.tif'],[974 958],[1115 959],calplt) ;

%    [ppposdat_0mm_13kV,ppemitdat_0mm_13kV,ppim_0mm_13kV] = ...
    [ppposdat_0mm_13kV,ppemitdat_0mm_13kV,ppim_0mm_13kV,pppixemit5d_0mm_13kV,pppixemit2d_0mm_13kV,ppemithist_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_13kV_35kV_100mm_cal.tif'],[974 946],[1116 947],calplt) ;

%    [ppposdat_100mm_13kV,ppemitdat_100mm_13kV,ppim_100mm_13kV,pppixemit5d_100mm_13kV,pppixemit2d_100mm_13kV,ppemithist_100mm_13kV] = ...
    [ppposdat_100mm_13kV,ppemitdat_100mm_13kV,ppim_100mm_13kV] = ...
        ppanalyse41([dir 'pp_13kV_35kV_100mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_13kV_35kV_200mm_cal.tif'],[978 942],[1119 943],calplt) ;

%    [ppposdat_200mm_13kV,ppemitdat_200mm_13kV,ppim_200mm_13kV,pppixemit5d_200mm_13kV,pppixemit2d_200mm_13kV,ppemithist_200mm_13kV] = ...
    [ppposdat_200mm_13kV,ppemitdat_200mm_13kV,ppim_200mm_13kV] = ...
        ppanalyse41([dir 'pp_13kV_35kV_200mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

%    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_13kV_35kV_300mm_cal.tif'],[972 945],[1114 947],calplt) ;
    [midpos,sp2sp,imtilt] = ppcalfind2p([dir 'pp_13kV_35kV_300mm_cal.tif'],[973 946],[1114 947],calplt) ;

%    [ppposdat_300mm_13kV,ppemitdat_300mm_13kV,ppim_300mm_13kV,pppixemit5d_300mm_13kV,pppixemit2d_300mm_13kV,ppemithist_300mm_13kV] = ...
    [ppposdat_300mm_13kV,ppemitdat_300mm_13kV,ppim_300mm_13kV] = ...
        ppanalyse41([dir 'pp_13kV_35kV_300mm_dat.tif'],[],midpos,imtilt,sp2sp, ...
        pplim,width,zlen,rotang,35e3,plt,bitdiv) ;

    return
