Weekly progress of the Integrated Data Processing Environment (IDPE) for Time Correlation Experiments (TCE)

2012-11-05 – 2012-11-11 Week progress

A src/PsanaConfigFileGenerator.py
A src/FileNameManager.py
A src/BatchJobPedestals.py
A src/AppDataPath.py
A src/ConfigFileGenerator.py
A src/GUIDark.py
A src/ImgSpeButtons.py
A src/ImgSpeNavToolBar.py
A src/ImgSpeWidget.py
A src/ImgSpeWithGUI.py
A data/scripts/psana-pedestals.cfg
A data/scripts/psana-tahometer.cfg

2012-11-12 – 2012-11-18 Week progress

A src/GUIFileBrowser.py - file browser for text files of this project.
A src/GUIHelp.py - pop-up box with message as a widget.
A src/GUIWorkResDirs.py - separate widget for setting of work and result output directory and common prefix file name.

In src/GUILogger.py and src/Logger.py - now messages are accumulated in 2d tuple. Add filtration by the message type "debug", "info", "warning", etc.

src/GUIFiles.py is significantly re-organized; now it is GUI with tabs.
All significant fields are moved in GUIs like src/GUIDark.py (GUIData, GUIFlat).

src/GUIDark.py - is re-organized.

In the interactive plot:

2012-11-19 – 2012-11-25 Week progress

Suggestions from Marcin:

Progress:

2012-11-26 – 2012-12-02 Week progress

Suggestions from Marcin:

Progress:

2012-12-03 – 2012-12-09 Week progress

No meeting this week due to experiments in xcs hatch.

Progress:

2012-12-10 – 2012-12-16 Week progress

Q&A Marcin:

Suggestions from Marcin:

Progress

2012-12-17 – 2012-12-23 Week progress

Q&A Marcin:

Progress

2012-12-24 – 2013-01-06 Week progress (winter break)

Progress

2013-01-07 – 2013-01-13 Week progress

Progress

2013-01-14 – 2013-01-20 Week progress

Q&A Marcin:
(tick) Add lock for ELog submission dialog box
(tick) Add lock for nparts field in GUIRunInput
(tick) GUIIntensityMonitors:

Progress

2013-01-21 – 2013-02-03 Week progress

Q&A Marcin:
(tick) Reorganize GUISetupInfoLeft.py for CCD position input in modes: Beam Zero, Specular, and Data

Progress
(tick) Fixed image partitioning, processing, and merging in ImgAlgos/src/ImgVsTimeSplitInFiles.cpp, CorAnaData.cpp, and CorAnaMergeFiles.cpp
(tick) Add CCD orientation in GUICCDSettings

Work on

2013-02-04 – 2013-02-10 Week progress

Progress
Work in progress on

(tick) Currently available plots for:

Q to Marcin:

2013-02-11 – 2013-02-17 Week progress

Progress
Work on mask editor application:

2013-02-18 – 2013-02-24 Week progress

Progress
(tick) Mask Editor is completed at 1st approximation. Can be executed as an embedded and standalone application.

2013-02-25 – 2013-03-03 Week progress

Progress
(plus) Frame orientation in lab x-y coordinates
Use parameters: cp.y_is_flip.value() (True) and cp.ccd_orient.value()

Q: Is it ok?

2013-03-04 – 2013-03-10 Week progress

Progress

2013-03-11 – 2013-03-17 Week progress

Q to Marcin:

Progress

2013-MM-DD Results on g2 form Marcin

Q to Marcin

2013-03-18 – 2013-03-24 Week progress

Progress
(tick) Develop psana module ImgAlgos::ImgIntMonCorr to normalize image on intensity monotor data.
(tick) Include ImgAlgos::ImgIntMonCorr in data-flow processing in CorAna/data/scripts/psana-cora-split.cfg and ConfigFileGenerator.py etc.
(tick) Review of psana algorithms for data processing chain. Change data types for processing and inter-module exchange stages. Everything looks fine!
(tick) Submission of messages with attachments to ELog using response ID and Igor's new interface: Python module for posting message into ELog
(tick) Add protection against Split/Process/Merge job submission if Auto-processing is already active.

2013-03-25 – 2013-03-31 Week progress

Q&A with Marcin on 2013-03-28:

Comparison of data processing and results

Danial works on these variables:

Q map for reflected beam geometry

Progress

2013-04-01 – 2013-04-07 Week progress

Q to Marcin
In order to proceed with this project I need in your feedback;

Q map for reflection geometry

Progress

Reflective geometry

q map for comparison:

is obtained for parameters:

2013-04-08 – 2013-04-14 Week progress

Mtg with Marcin:

  1. Have to get the same results for g2(tau) function
  2. Need more plots for results

Fit results for function g2(tau|pars) = C*exp[-(2t/tau0)**beta] + B

Progress

2013-04-15 – 2013-04-21 Week progress

Work on LogBookGrabber project.

2013-04-22 – 2013-04-28 Week progress

2013-04-29 – 2013-05-05 Week progress

2013-04-06 – 2013-05-12 Week progress

Image and spertrum of the difference between my <Ip>(tau=20) and Marcin's IP_comp.np.npy

Marcin's and my spectrum of <Ip>(tau=20) at small amplitudes

Marcin's and my spectrum of <Ip>(tau=20)

New document: Algorithms for Time Correlation Experiments

2013-05-27 – 2013-06-22 Week progress

New results from Marcin

Reduced data files:
/reg/neh/home1/sikorski/xcs_pyana_current/e167-r0015-s00-c00/2013-04-03-10-39-22-734268/*.npy

Marcin's code description

Qs about code of import_data.py

Assume that import_data.py is intended to get data from xtc file, split image for 10x10 parts, and save them for ALL events in files like /reg/neh/home1/sikorski/xcs_pyana_current/e167-r0015-s00-c00/2013-04-03-10-39-22-734268/e167-r0015-s00-c00_data_520_268.npy

Open one file per (130,134) image segment and other files:

    def beginjob( self, evt, env ) :
        ...
        for i in range(0,self.frame_size[0],self.step_x):
            for j in range(0,self.frame_size[1],self.step_y):
                fina = path + '/' +fina_gen + '_data_' + str(i) + '_' +str(j) + '.npy'
                self.f_id.append(open(fina, 'w'))

        fina = path + '/' +fina_gen + '_avg_img' + '.txt'
        self.f_id_avg =  open(fina, 'w')
        ...

Get image from data, and saves its parrts in the SAME !!! file...
The last event is actually saved.

    def event( self, evt, env ) :
        ...
            if self.detector == 1:
                 PI = evt.get(xtc.TypeId.Type.Id_PrincetonFrame)
                 frame = np.array(PI.data()[self.R1:self.R2,self.C1:self.C2], dtype = np.float64)
                 a = np.where(frame >= self.saturation)
                 self.saturated_pixels[a] = 0
                 np.subtract(frame, self.dark, frame)
                 frame[frame < self.LLD] = self.not_zero
        ...

# NOT QUITE CLEAR, WHAT ARE YOU DOING HERE????
# In this job self.bin[0]=1 and self.bin[1]=1  
        if self.flag_bin == 1:
                np.multiply(self.frame_binned, self.zeros, self.frame_binned)
                for b1 in range(self.bin[0]):
                        for b2 in range(self.bin[1]):
                                np.add(self.frame_binned, frame[b1::self.bin[0], b2::self.bin[1]],self.frame_binned)
                frame = self.frame_binned
 
        np.add(self.avg_img, frame , self.avg_img)
        counter = 0
        for i in range(0,self.frame_size[0],self.step_x):
            for j in range(0,self.frame_size[1],self.step_y):
               np.save(self.f_id[counter], frame[i:i+self.step_x,j:j+self.step_y])
               counter += 1
        ...

Check for results of data pre-processing

Qs about code of xcs_correlator.py

/reg/neh/home1/sikorski/scripts/correlator/xcs_correlator.py
class img_correlator:
    def __init__ (self,path):
        # path to the data reduced using pyana "import_data.py" code 
        self.path = path
        self.LLD = 200 !!!!!!!!!!!
        self.notzero = 1
 
    def set_LLD(self, LLD): <--- IS NOT CALLED
        self.LLD = LLD

 
  def correlator_2D(self, fina):
           data[:,:,i][data[:,:,i]<(self.LLD)] = self.notzero

2013-08-27 New results from Marcin

After fixing LLD and normalization for one static bin Marcin plot the difference between our results for g2:

Marcin's results on g2 from file:  /reg/neh/home1/sikorski/xcs_pyana_current/e167-r0015-s00-c00/2013-08-27-14-28-40-303177/results_2013-08-27-15-07-34-961055/g2

tau [s]             g2             g2
8.088564        0.021423        3.380312       
16.177129       0.021402        3.645404       
24.265693       0.020048        3.287331       
32.354258       0.019998        3.425617       
40.442822       0.020130        3.482928       
48.531386       0.019919        3.460162       
56.619951       0.022181        3.771666       
64.708515       0.019538        3.435755       
72.797079       0.019489        3.398190       
80.885644       0.020371        3.387679       
97.062773       0.019899        3.473071       
113.239901      0.020628        3.352052       
129.417030      0.019564        3.417886       
161.771288      0.018648        3.352710

 

 

2013-08-30 results for run 11 (dark 20) of xcsi0112

<g2> for dynamic bins vs tau
==============================
 tau     tau[s] \ <q> | 0.052 
-----------------------------
   1         8.088406 | 3.558 
   2        16.176812 | 3.151 
   3        24.265218 | 3.447 
   4        32.353624 | 3.356 
   5        40.442030 | 3.311 
   6        48.530436 | 3.413 
   7        56.618842 | 3.155 
   8        64.707248 | 3.355 
   9        72.795654 | 3.291 
  10        80.884060 | 3.160 
  12        97.060872 | 3.252 
  14       113.237684 | 3.275 
  16       129.414496 | 3.320 
  20       161.768120 | 3.473

2013-10-08 Comparison of results for xcsi0112, run15 (dark20)

Conditions

  1. dark run: /reg/d/ana12/xcs/xcsi0112/xtc/e167-r0020-s00-c00.xtc use all 75 events
  2. data run: /reg/d/ana12/xcs/xcsi0112/xtc/e167-r0015-s00-c00.xtc use all 500 events
  3. do not use any intensity monitor selection or correction
  4. do not use any mask including hot pixel, saturation, blemish, ROI, and restriction on the image size
  5. use LLD as a constant ADU threshold = 20
  6. use a single q-phi static bin
  7. use a single q-phi dynamic bin
  8. q value is not an issue for current comparison, so geometry does not matter

Dark image

Marcin's dark file:
/reg/neh/home1/sikorski/xcs_pyana_current/e167-r0020-s00-c00/2013-04-03-09-43-06-939033/e167-r0020-s00-c00_dark_img.txt:

# Job name: e167-r0020-s00-c00
# Array shape: 1300 x 1340
278.826667      298.640000      304.880000      298.200000      300.106667      298.453333 ...

Has precision of 6 digits after decimal dot.

My dark file, evaluated in Pedestals averaging

278.827 298.64 304.88 298.2 300.107 298.453 ...

is adjusted to the same precision:
/reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-xcsi0112-r0020-peds-ave.txt

278.826667 298.64 304.88 298.2 300.106667 298.453333 ...

Exactly coincides after adjustment.

Mask of satturated pixels

Marcin's mask, evaluated in import_data,
/reg/neh/home1/sikorski/xcs_pyana_current/xcs_timepix_pkg/src/import_data.py:
/reg/neh/home1/sikorski/xcs_pyana_current/e167-r0015-s00-c00/2013-08-27-14-28-40-303177/e167-r0015-s00-c00_avg_img.txt
My mask, evaluated in Data averaging: /reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-xcsi0112-r0015-satpix-mask-level-65000ADU.txt
For run 15 both masks are ones for entire image.

Averaged data image before splitting

Marcin's averaged data image, evaluated in import_data, /reg/neh/home1/sikorski/xcs_pyana_current/xcs_timepix_pkg/src/import_data.py:
/reg/neh/home1/sikorski/xcs_pyana_current/e167-r0015-s00-c00/2013-08-27-14-28-40-303177/e167-r0015-s00-c00_avg_img.txt

0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        2.098667        0.561573        0.000000        0.000000        0.000000        0.000000        3.539360        2.335520 

My averaged data image, evaluated in Splitting:
/reg/neh/home1/dubrovin/LCLS/PSANA-V01/work/t1-xcsi0112-r0015-data-ave.txt

  • DO NOT COINCIDE YET!
  • This file is obtained at data averaging, where pedestals are not subtracted.
  • For direct comparison averaging need to be done at splitting stage.

 

 

2013-12-02 my new results for run 15 (dark 20) of xcsi0112

Direct evaluation of averaged image with subtracted pedestals is done in the psana script for image splitting.

1e-09 1e-09 1e-09 1e-09 1e-09 1e-09 1e-09 1e-09 1e-09 1e-09 1e-09 1e-09 1e-09 2.09866669 0.561573365 1e-09 1e-09 1e-09 1e-09 3.53936005 2.33552002

 

Results for g2

<g2> for dynamic bins vs tau
==============================
 tau     tau[s] \ <q> | 0.052 
-----------------------------
   1         8.088413 | 3.380 
   2        16.176826 | 3.645 
   3        24.265239 | 3.287 
   4        32.353652 | 3.426 
   5        40.442065 | 3.483 
   6        48.530478 | 3.460 
   7        56.618891 | 3.772 
   8        64.707304 | 3.436 
   9        72.795717 | 3.398 
  10        80.884130 | 3.388 
  12        97.060956 | 3.473 
  14       113.237782 | 3.352 
  16       129.414608 | 3.418 
  20       161.768260 | 3.353 

 

2013-12-06 Mtg with Marcin

2014-01-20 Runs with CSPAD data

Run 196(dark) and run 185(data) from xcs84213.
Marcin

References

  1. Data Processing for Time Correlation - project description and status
  2. Algorithms for Time Correlation Experiments - algorithms used in this project
  3. Note on XCS code from Marcin - notes about Marcin's code and algorithms