Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

This is a reference manual for algorithms implemented for the Integrated Data Processing Environment for Time Correlation Experiments. All work-flow can be split for main procedures:

  • Pre-processing,
  • Data processing, and
  • Presentation of results,

covered by this note with extensive references to the specific code.

Content

Table of Contents

Pre-processing

Pre-processing algorithms consist of four procedures

  • Dark run scan

...

  • ,
  • Pedestals averaging,
  • Data scan, and
  • Data averaging,

described in this section.

Dark run scan

Defines for Defines for the dark run

  • the number of events
  • time records and average time interval

...

Pedestals averaging

Defines for the dark run

  • pedestals
  • RMS
  • hot pixel mask

...

The ImgAlgos.ImgMaskEvaluation produces the saturated pixel mask; the image size txt file *-satpix-mask-level-65000ADU.

...

txt, consistiong 0(zero) or 1(one) for each bin.

Data processing

Data processing

...

stage consists of three procedures:

  • Spliting,
  • Processing, and
  • Merging,
    described in this section.

Spliting

Submit command

Code Block

Split

Submit command

Code Block
psana -c /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-cora-xcsi0112-r0015-split.cfg /reg/d/ana12/xcs/xcsi0112/xtc/e167-r0015-*.xtc

...

Code Block
[psana] 
# Command to run this script from release directory: 
# psana -c ImgAlgos/data/psana-split.cfg <path-to-xtc-file-name-pattern-for-one-run> 

#files = /reg/d/ana12/xcs/xcsi0112/xtc/e167-r0015-*.xtc 
skip-events = 0 
events = 500 

modules = ImgAlgos.Tahometer ImgAlgos.PrincetonImageProducer ImgAlgos.ImgCalib ImgAlgos.ImgIntMonCorr ImgAlgos.ImgIntForBins ImgAlgos.ImgVsTimeSplitInFiles ImgAlgos.ImgAverage

[ImgAlgos.Tahometer] 
print_bits = 7 

[ ImgAlgos.PrincetonImageProducer ] 
source = DetInfo(:Princeton) 
key_in = 
key_out = img 
print_bits = 1 

[ImgAlgos.ImgCalib] 
source = DetInfo(:Princeton) 
key_in = img 
key_out = calibrated 
fname_peds = /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-xcsi0112-r0020-peds-ave.txt 
fname_bkgd = 
fname_gain = 
fname_mask = 
fname_rms =  
threshold_nrms = 0 
do_threshold = true 
threshold = 20.0 
below_thre_value = 0 
print_bits = 5 

[ImgAlgos.ImgIntMonCorr] 
source = DetInfo(:Princeton) 
key_in = calibrated 
key_out = imon_corrected 
fname_imon_cfg = /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-cora-xcsi0112-r0015-imon-cfg.txt 
print_bits = 1 

[ImgAlgos.ImgIntForBins] 
source = DetInfo(:Princeton) 
key_in = imon_corrected 
fname_map_bins = /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-cora-r0015-map-static-q.txt 
fname_int_bins = /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-cora-r0015-int-static-q.txt 
number_of_bins = 1 
print_bits = 33 


[ImgAlgos.ImgVsTimeSplitInFiles] 
source = DetInfo(:Princeton) 
key = imon_corrected 
fname_prefix = /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-cora 
file_type = bin 
add_tstamp = false 
ampl_thr = 20.0 
ampl_min = 01 
nfiles_out = 8 
print_bits = 29 


[ImgAlgos.ImgAverage] 
#======EOF====== 
source = DetInfo(:Princeton) 
key = calibrated 
avefile = /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-xcsi0112-r0015-data-ave.txt 
rmsfile = /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-xcsi0112-r0015-data-rms.txt
#======EOF====== 

PSANA module PSANA module ImgAlgos.ImgCalib

  • ImgAlgos.ImgCalib.cpp
  • ImgAlgos.ImgCalib.h
    This module is responsible for basic image intensity transformation. For correlation analysis it applys a couple of corrections:
  • subtract pedestals and
  • apply LLD threshold.

PSANA module ImgAlgos.PSANA module ImgAlgos.ImgIntMonCorr

  • ImgAlgos.ImgIntMonCorr.cpp
  • ImgAlgos.ImgIntMonCorr.h
    Gets intensity monitor configuration file imon-cfg.txt produced in GUI:
    Code Block
     BldInfo(FEEGasDetEnergy)         FEEGasDetEnergy  1 1 1 1   0 0     -1.0000   -1.0000    1.0000
     BldInfo(XCS-IPM-02)              XCS-IPM-02       1 1 1 1   0 0     -1.0000   -1.0000    1.0000
     BldInfo(XCS-IPM-mono)            XCS-IPM-mono     1 1 1 1   0 0     -1.0000   -1.0000   -1.0000
     DetInfo(XcsBeamline.1:Ipimb.4)   Ipimb.4          1 1 1 1   0 0     -1.0000   -1.0000    1.0000
     DetInfo(XcsBeamline.1:Ipimb.5)   Ipimb.5          1 1 1 1   0 0     -1.0000   -1.0000    1.0000
    

...

Module ImgAlgos.corana

Module ImgAlgos.CorAnaData

Evaluation of correlators:

...

Code Block

ImgAlgos/include/CorAna.h:  typedef float cor_t;

void CorAnaData::evaluateCorTau(unsigned tau) // tau in number of frames between images
{
  m_log << "\nCorAnaData::evaluateCorTau(tau): tau=" << tau;
  std::fill_n(m_sum_gi, m_blk_size, double(0));
  std::fill_n(m_sum_gf, m_blk_size, double(0));
  std::fill_n(m_sum_g2, m_blk_size, double(0));
  std::fill_n(m_sum_st, m_blk_size, unsigned(0));
  std::fill_n(m_cor_gi, m_blk_size, cor_t(0));
  std::fill_n(m_cor_gf, m_blk_size, cor_t(0));
  std::fill_n(m_cor_g2, m_blk_size, cor_t(0));

  for (unsigned ti=0; ti<m_tind_size-tau; ti++) {
       unsigned tf=ti+tau;

       if ( ! (tf<m_tind_size) ) break;
       
       // get the event index in array for time index
       int evi = m_tind_to_evind[ti];
       int evf = m_tind_to_evind[tf];

       // If the event does not exist for specified time index -> skip it in sum
       if(evi<0) continue;
       if(evf<0) continue;

       sumCorTau((unsigned)evi,(unsigned)evf);
  }
}

//----------------
void CorAnaData::sumCorTau(unsigned i, unsigned f) // i and f are the event indexes
{
   data_t* p_i = &m_data[i*m_blk_size];
   data_t* p_f = &m_data[f*m_blk_size];
   double Ii, If;

   for(unsigned pix=0; pix<m_blk_size; pix++) {
     Ii = p_i[pix]; 
     If = p_f[pix]; 
     m_sum_gi[pix] += Ii; 
     m_sum_gf[pix] += If; 
     m_sum_g2[pix] += Ii*If; 
     m_sum_st[pix] ++; 
   }
}

Averaging:

Code Block

   for(unsigned pix=0; pix<m_blk_size; pix++) {
       if(m_sum_st[pix]<1) continue;
       m_cor_gi[pix] = cor_t( m_sum_gi[pix] / m_sum_st[pix] ); 
       m_cor_gf[pix] = cor_t( m_sum_gf[pix] / m_sum_st[pix] ); 
       m_cor_g2[pix] = cor_t( m_sum_g2[pix] / m_sum_st[pix] ); 
   }

Module ImgAlgos.CorAna

...

Presentation of results

Presentation of results is implemented in the GUIViewResults.py, which basically is a panel of buttons for different plots.

Summary

In this note we presented a functional description of implemented procedures for time correlation analysis. All modules have convenient reference to the latest version of the code.

References

...