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

Include Page
PSDM:PageMenuBegin
PSDM:PageMenuBegin
Table of Contents
Include Page
PSDM:PageMenuEnd
PSDM:PageMenuEnd

Motivation

Development of this application was stimulated by the discussion with Marcin Sikorski (meeting on 2012-08-30), doing xcs experiments.
Users need in real-time algorithm for calculation of image vs time auto-correlation function

Code Block

g2(tau) = <I(t)*I(t+tau)> / (<I(t)> * <I(t+tau)>),

...

In first approximation this problem was solved, as it is described in the Command Line Interface For Time Correlation Analysis. However, in order to be useful, the command line algorithm needs to be integrated in the global analysis system, which de bene esse called as Integrated Analysis Environment for Time Correlation Experiments and is discussed below.in IDPE for TCE in XCS - Problems and tentative solutions

...

Based on 2012-10-03 meeting:

In order to be useful this application should do correct math, accounts for image mask, discards bad events (noisy and "bright" pixels), apply normalization etc., and have a convenient GUI. Below is a list of requirements, marked as (question), with suggested solutions, marked as (tick) if exists or as (plus) if needs to be implemented.

Pedestals

(question) "dark" run number should be provided by user and the imaging camera pedestals should be evaluated and applied for all runs until the "dark" run number has not changed.
(tick) For pedestals evaluation: use available ImgAlgos::ImgAverage psana module for "dark" run, which produces file with averaged over events pedestals and the file with their rms values.
(tick) For pedestals subtraction: use ImgAlgos::ImgCalib psana module in the same job which evaluates correlators; the pedestals will be subtracted and corrected image will be retained in the event and used for correlator calculations.

Low level threshold

(question) Image pixel intensity physically can't be negative. Low amplitude noise should be suppressed by the threshold. The threshold amplitude should be provided by user (along with substituting amplitude).
(tick) Is implemented in the ImgAlgos::ImgCalib psana module, right after pedestal subtractuion.

Image filtering

(question) Usually users use different type of intensity monitor signals in order to retain/discard image for/from further processing. Discarded images should not contribute into the correlation analysis. The spectra of intensity monitors should be available for browsing. User should be able to select the intensity monitor(s) from the list and set low and high thresholds.
(plus) The filtering module may be implemented in psana. Based on selected intensity monitor(s) and thresholds it will decide to retain or discard event and accumulate spectral histograms. The histograms will be saved in file at the end of run.
(plus) Control GUI should be able to browse the intensity monitor histograms and set the thresholds.

Selection of intensity monitors

(question) It would be nice to have an algorithm like in XTC explorer
(plus) Possible options:

  • run application as a plug-in for XTC Explorer,
  • pyana module performing similar to XTC Explorer algorithm,
  • stand-alone C++ module reading XTC datagrams,
  • hardwired list of intensity monitors.
  • psana module, which needs to be developed

Dynamic mask

(question) Imaging camera may have permanently hot pixels or some pixels may be saturated during the run. User need to set a thresholds on hot pixels and high intensity.
If the pixel amplitude crosses the high intensity threshold at least once during the run, then this pixel should be excluded from further analysis. The same is valid for hot pixels, which shows above threshold intensity in large fraction of events.
(tick) This is implemented in the psana module ImgAlgos::ImgMaskEvaluation, which works before event selection algorithm. Two files of image size may be produced 1) for saturated and 2) for hot pixels.

Static mask

(question) The beam-stopper region and some areas with fringes should be masked. It could be useful to have a graphical editor for mask.
(plus) See section for GUI.

Graphical editor for selected regions

(question) Sometimes it is useful to select good region of the image. It could be convenient to use a graphical editor, as for mask.
(plus) See section for GUI.

Center of the image

(question) User should have an option to set a center of the rings for histograms.
(plus) See section for GUI.

Correct normalization of g2

(question) Evaluation of g2 for image regions is not that simple as presented by the formula for a single pixel:

Code Block

g2(tau) = <I(t)*I(t+tau)> / (<I(t)> * <I(t+tau)>),

In order to get physically meaningful results for g2, the correlators <I(t)> and <I(t+tau)> should be averaged in the fine rings around center with number of bins N2, which is order of 100, with dR down to 1-2 pixels.
Then the <I(t)*I(t+tau)> (question) correlator should be averaged over bold rings intended for G2 evaluation. The number of these rings N1 should be order of 10.
The N2 and N1 should be defined by user.
It might be useful to define the histogram region by the sector in the user-defined angular range.
(plus) In order to have required normalization of correlators, it is not enough to save the g2 value only. So, the format of the resulting file has changed. Now for each value of tau the output file contains the <I(t)>, <I(t+tau)>, and <I(t)*I(t+tau)>, each for entire image written in binary for float format. Not all masks, selection regions, normalization etc. are available during correlators calculation, so correlators are evaluated for all pixels. Which pixels should be included in the G2 for each region can be decided at the final stage of processing. This approach allows to perform the most time consuming procedure - the correlators calculation once and do the analysis after that.

(plus) See section for GUI.

GUI

(question) In order to get an easy interface to all sub-processes, it seems to be useful to have a GUI with configuration of everything through the GUI.
(warning) Well, presumably users will want different specific features in their analyses which can not be foreseen in implementation of GUI. It is pretty unlikely that everything in analysis can be done clicking on buttons in GUI. Then, it could be nice if user understand what he is doing step by step and have a monitoring at the end of each stage. We are doing science, not a standard pre-defined things... Most generic way to process data is to have a separate procedures with command line interface.
(plus) Anyway, the browser/presenter of data stored in the files after pre-processing could be provided for a set of common plots.
All features listed in previous sections, such as static and dynamic mask, restriction of the region(s) of interest, selection of the image center, the binning scheme etc., can be done in the browser at the final stage of the analysis.
(plus) Generic GUI as a shell for entire analysis can be implemented as an interface to the command line procedures:

  • Each command line procedure may have a dedicated GUI for procedure configuration and monitoring.
  • All procedures may be listed in the main GUI with a status sign.
  • The main issue of this approach is a cross-configuration between separate procedures. This can be achieved if all procedures will have a common list of configuration parameters.

Wiki Markup
{htmlcomment:hidden}
Here is my comment
{htmlcomment}

GUI Implementation

Updated on 2012-12-02

There are three layouts implemented for this application:

GUIMain

Layout 1:

  • Many separate windows
  • Plots are isolated

Image RemovedImage RemovedImage RemovedImage Removed

Image RemovedImage RemovedImage RemovedImage Removed

Image RemovedImage RemovedImage RemovedImage Removed

Image RemovedImage Removed

GUIMainTB

Layout 2:

  • All input windows are integrated in one with tool bar
  • Logger and File browser windows are isolated
  • Plots are isolated

Image RemovedImage RemovedImage RemovedImage Removed
Image RemovedImage Removed

Image RemovedImage Removed

GUIMainSplit

Layout 3:

  • All input windows are integrated in one with tool bar
  • Logger window takes residual part in the bottom
  • File browser window is isolated
  • Plots are isolated

Image RemovedImage RemovedImage RemovedImage Removed

Code location

Everything will reside in CorAna package.

Modules

Updated on 2012-12-10

All module names beginning with letters GUI implements different Graphical User Interfaces.

Module

Description

AppDataPath.py

Local version with added path to data from src directory.

BatchJobData.py

 

BatchJobPedestals.py

Class contains methods for batch job submission and monitoring for pedestals.

BatchLogParser.py

 

ConfigFileGenerator.py

Class has methods to generate psana configuration and other scripts from stubs located in CorAna/data/scripts/.

ConfigParameters.py

Base class for configuration parameters.

ConfigParametersCorAna.py

Sub-class for CorAna specific configuration parameters.

CorAnaUtils.py

Junk for eamples.

FileNameManager.py

Class dynamically generates all file names for current configuration parameters.

GUIAnaPartitions.py

 

GUIAnaSettings.py

 

GUIAnaSettingsLeft.py

 

GUIAnaSettingsOptions.py

 

GUIAnaSettingsRight.py

 

GUIBeamZeroPars.py

 

GUIBlamish.py

Sub-GUI of GUIFiles.py

GUICCDSettings.py

 

GUIConfigParameters.py

GUI for the configuration parameters file management.

GUIDark.py

Sub-GUI of GUIFiles.py - manipulations with dark runs

GUIData.py

 

GUIFileBrowser.py

Text file browser for this project

GUIFiles.py

Central GUI for file settings contains tab-bar for other widget selection

GUIFlatField.py

Sub-GUI of GUIFiles.py

GUIHelp.py

WIdget for messages, i.e. help

GUIImgSizePosition.py

 

GUIInstrExpRun.py

depricated GUI

GUIIntensityMonitors.py

Control GUI for intensity monitors

GUIKineticMode.py

 

GUILoadResults.py

 

GUILogger.py

GUI for logger

GUIMain.py

The first GUI at start of this application

GUIMainSplit.py

The same as GUIMainTB.py with integrated GUILogger.py

GUIMainTB.py

The first GUI at start of this application with tab bar

GUINonKineticMode.py

 

GUIRun.py

 

GUISetupEnergyAngle.py

 

GUISetupInfo.py

 

GUISetupInfoLeft.py

 

GUISetupInfoRight.py

 

GUISetupPars.py

 

GUISpecularPars.py

 

GUISystemSettings.py

 

GUISystemSettingsLeft.py

 

GUISystemSettingsRight.py

 

GUITransmissionPars.py

 

GUIViewResults.py

 

GUIWorkResDirs.py

 

GlobalUtils.py

Module contains all possible global methods.

ImgSpeNavToolBar.py

Re-implemented standard tool-bar (depricated)

Logger.py

Core class for logger

Overlay.py

Demonstration of how to draw something on the top of GUI

PlotArray.py

Main class for array presentation plot

PlotArrayButtons.py

Widget for custom button-bar

PlotArrayWidget.py

Widget for graphical window

PlotImgSpe.py

Main class for interactive plot with custom button bar

PlotImgSpeButtons.py

Widget for custom button-bar

PlotImgSpeWidget.py

Graphical image for image and spectral histogram

PlotTime.py

Main class for time record presentation plot

PlotTimeWidget.py

Widget for graphical window

Status of the project

Status of the project on 2012-11-07

(tick)(plus) The system of GUIs, consisting of dozens of CorAna.GUI... modules is implemented in the draft approximation. Roughly it reproduces all features of the old program.
(tick)(plus) Infrastructural modules ConfigParameters.py, ConfigParametersCorAna.py, and GUIConfigParameters.py provides convenient approach for maintenance of all configuration parameters.
(tick) Infrastructural modules Logger.py and GUILogger.py provides a generic approach to logging system.
(tick)(plus) Module ConfigFileGenerator.py use current settings of configuration parameters and stub-file scripts from CorAna/data/scripts/ and generates the psana configuration files.
(tick)(plus) Module FileNameManager.py is a single place which provides a dynamic file names for current version of the configuration parameters.
(tick)(plus) Module BatchJobPedestals.py is intended to prepare, submit, and monitor the butch job for pedestals evaluation.
(minus) BatchJobDataPreliminary.py - get the list of PV variables, available intensity moniotors, photon beam intensity etc.
(minus) BatchJobFlatField.py - to get the flat field averaged image if relevant run is available.
(minus) BatchJobCorAna.py - the batch job for main calculation algorithm.
(minus) Graphical presentation for masks, pedestals, averaged image, partitions etc.
(minus) Graphical editor for the regions of interest,
(minus) Graphical presentation and GUI for final results.

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:

  • In src/ImgSpeWithGUI.py the src/ImgSpeNavToolBar.py - is depricated
  • src/ImgSpeButtons.py - re-organized: add save, reset, and menu buttons, log check-box.
  • In src/ImgSpeWidget.py - the log functionality needs to be implemented...

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

Suggestions from Marcin:

  • Time(sec) - should be the averaged time between frame time-stamps.
  • Spectral plot: log-scale for X-axis only.
  • Flat field and Blamish files will be provided from external apps. No need to evaluate them now. Needs to be selected by the path.
  • Substitute the start and end events after the scan.

Progress:

  • Restracturization: tahometer replaced by peds_scan.
  • update the start and end fields after scan.
  • remove psana log files before job submission in batch.
  • the start and end fields are set from cofig.pars, if the scan log-file is availabe, they are updated from this file.
  • reset fields to default if the input xtc file is changed.
  • A src/GUIFlatField.py - file selection, plot, browse file
  • A src/GUIBlamish.py
  • A src/GUIMainTB.py - try different view for composite window
  • A src/GUIMainSplit.py - try different view for composite window
  • Add psana module: ImgAlgos::ImgTimeStampList - creates the time-stamp list and evaluates the mean time between frames and its RMS.
  • in GUIDark.py use variables produced by the ImgAlgos::ImgTimeStampList.

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

Suggestions from Marcin:

  • Marcin prefers layout with separated GUILogger window, like in GUIMainTB.py
  • Need in a tool reporting problems in time-stamp sequence.
  • In GUIDark.py - untill the total number of events is unknown, use end "-1" and generate a warning if it is submitted in batch for pedestals.
  • Add check-box showing if the Blamish and Flat-field files will be applied
  • Marcin returned the paper-copy of GUIs with comments about titles and parameters.
  • The list of variables for intensity monitor:
    • Wiki Markup
      IPM2 \[CH0,...,CH3\]
    • Wiki Markup
      IPMMON0 \[...\]
    • Wiki Markup
      IPM4 \[...\]
    • Wiki Markup
      IPM5 \[...\]
    • Wiki Markup
      GASDET \[...\]
  • Needs in separate GUI for intensity monitors for normalization and veto.

Progress:

  • In GUIBlamish.py and src/GUIFlatField.py add check-boxes.
  • Apply Marcin's comments to GUIs with System, Setup etc. parameters, GUICCDCorrectionSettings.py is removed..
  • In src/GUIMainTB.py optimized the GUI sizes.
  • Changed names from GUIBatch... to GUISystem...
  • New psana module Psana Module Catalog, which gets data for equivalent HDF5 variables:
    Code Block
    
    /Configure:0000/Run:0000/CalibCycle:0000/Bld::BldDataFEEGasDetEnergy/FEEGasDetEnergy
    /Configure:0000/Run:0000/CalibCycle:0000/Bld::BldDataIpimbV1/XCS-IPM-02
    /Configure:0000/Run:0000/CalibCycle:0000/Bld::BldDataIpimbV1/XCS-IPM-mono
    /Configure:0000/Run:0000/CalibCycle:0000/Ipimb::DataV2/XcsBeamline.1:Ipimb.4
    /Configure:0000/Run:0000/CalibCycle:0000/Ipimb::DataV2/XcsBeamline.1:Ipimb.5
    
    in psana they can be accessed as:
    Code Block
    
      m_srcFEEGasDetE = configStr("feeSource", "BldInfo(FEEGasDetEnergy)");
      m_srcIPM2       = configStr("ipm2",      "BldInfo(XCS-IPM-02)");
      m_srcIPMMono    = configStr("ipmmono",   "BldInfo(XCS-IPM-mono)");
      m_srcIPM4       = configStr("ipm4",      "DetInfo(XcsBeamline.1:Ipimb.4)");
      m_srcIPM5       = configStr("ipm5",      "DetInfo(XcsBeamline.1:Ipimb.5)");
    
    and share pointers:
    Code Block
    
      shared_ptr<Psana::Bld::BldDataFEEGasDetEnergy> fee = evt.get(m_srcFEEGasDetE);
      shared_ptr<Psana::Ipimb::DataV2> data2 = evt.get(m_src); // for m_srcIPM4 and m_srcIPM5
      shared_ptr<Psana::Bld::BldDataIpimbV1> ipimb1 = evt.get(m_src_ipimb); // for m_srcIPM2 and m_srcIPMMono
    
  • In GUISystemPars: add total number of events and dt+-rms to GUISystemPars.
  • In GUIDark: add check-box and file-browser button with complete functionality.
  • In GUIDark: add protection for pedestal job submission in batch with default number of events.
  • In BatchJobPedestals: add protection against duplicated job submission in batch using timeout (now 100 sec) or until the previous job is DONE.
  • In ImgSpeWidget: implemented the log-scale plot with full functionality and protections...

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

No meeting this week due to experiments in xcs hatch.

Progress:

  • In GUIFileBrowser: add one more parameters after the list of files, the file to start browser
  • GUIData is implemented with full functionality including
    • check box to activate/protect buttons
    • "File" button and info field - selects the xtc file
    • "Scan" button - submits scanner job in batch which
      1. counts events,
      2. saves in file the time records ind evaluate an average interval between frames
      3. saves in file the intensity monitor data
    • "Average" button - submits job in batch for averaging image for the specified range of events
    • "Check status" button - checks the status of both batch jobs, check if the file with averaged image is available, update the info fields for number of events and averaged time between frames
    • "Check files" button - prints the list of work files for data and check their availability
    • "Browse" button - open the file browser with a list of work files for data
    • "img-Plot" button - plots the averaged image from file
    • "t-Plot" button - shows the plot for time records saved in file
    • "Remove" button - removes all work files from the work directory
  • GUIIntensityMonitors: GUI for Intensity monitors
  • PlotArray.py, PlotArrayButtons.py, PlotArrayWidget.py - plot for array presentation
  • PlotTime.py, PlotTimeWidget.py - plot for time records presentation

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

Q&A Marcin:

  • Q: XcsBeamline.2 - is it used simultaneously with XcsBeamline.1 ?
    • A: XcsBeamline.1
  • Q: What control parameters should be added for intensity monitors?
    • A: should be added:
      1. radio button for normalization or no-normalization
      2. filter data check box
      3. low-upper amplitude range
  • Q: Layout of GUIMainTB.py with variable height, is it ok?
    • A: Looks fine.
  • Q: Layout variation for check-box - disappearance of buttons, is it ok?
    • A: Change color of button-titles.
  • Q: What image buttons are used as a mask editor etc.
    • A: GUIAnalysisSettings:
      • "MaskPolygon" button - for polygon editor on data image
      • "Show Mask & Partitions" button - shows the mask and partitions on data image

Suggestions from Marcin:

  • Add button to all plots and gui to submit them in ELog.
  • (tick) Change log presentation for image histogram - log for vertical scale only.

Other things to do

  • Use intensity monitor names in generation of the psana.cfg file
  • Check move window coordinates for plots... Some of them opens in unexpected places.
  • (tick) GUIDark and GUIData - inappropriate change of style for "end" field

Progress

...

.

Wiki Markup
{htmlcomment:hidden}
Here is my comment
{htmlcomment}

GUI Implementation

Updated on 2013-04-01

As an example of GUI style Marcin suggested to use XPCSGUI - earlier implementation of similar application.

Three versions of GUI were implemented for this application. It was decided to use the GUIMainTB
layout, where:

  • All input windows are integrated in one with tab-bar for switching and custom tool bar on the top
  • Logger and File Browser windows are isolated
  • All plots are isolated, although similar plots appear in the same windows.

Image AddedImage AddedImage AddedImage AddedImage AddedImage Added
Image AddedImage AddedImage Added

Image AddedImage Added

Image AddedImage AddedImage AddedImage Added

Image Added

Image Added

Image AddedImage AddedImage AddedImage AddedImage Added

Image Added
Image AddedImage AddedImage Added
Image AddedImage Added
Image Added
Image AddedImage AddedImage Added
Image AddedImage AddedImage Added

Image AddedImage AddedImage Added

Image AddedImage AddedImage Added
Image Added

h3 Plots for intensity in q-static bins

Image AddedImage AddedImage AddedImage Added

Intensity monitors

FEEGasDetEnergy, XCS-IPM-02, XCS-IPM-mono, XcsBeamline.1:Ipimb.4, and XcsBeamline.1:Ipimb.5
Image AddedImage AddedImage AddedImage AddedImage Added

Reflective scattering geometry

Image AddedImage AddedImage AddedImage Added
Source code from Marcin: q_functions.txt

Code location

Everything resides in CorAna package, which is included in LCLS offline releases beginning from ana-0.7.16.
References to the specific algorithms can be found in Algorithms for Time Correlation Experiments.
Original data processing code from Marcin is described in Note on XCS code from Marcin.

Modules

In tables below we list modules from packages CorAna and ImgAlgos, which were developed for this project.
Notations:
(tick) - is done (at least it is assumed for now...)
(plus) - needs more work
(info) - test or deprecated modules

Package CorAna

Updated on 2013-10-14

All module names beginning with letters GUI implements different Graphical User Interfaces.

List of modules in alphabetic order:

Module

Description

(tick) AppDataPath.py

Local version with added path to data from src directory.

(tick) BatchJob.py

Suprclass for other BatchJob*.py modules

(tick) BatchJobCorAna.py

 

(tick) BatchJobData.py

 

(tick) BatchJobPedestals.py

Class contains methods for batch job submission and monitoring for pedestals.

(tick) BatchLogParser.py

 

(tick) ConfigFileGenerator.py

Class has methods to generate psana configuration and other scripts from stubs located in CorAna/data/scripts/.

(tick) ConfigParameters.py

Base class for configuration parameters.

(tick) ConfigParametersCorAna.py

Sub-class for CorAna specific configuration parameters.

(tick) CorAnaUtils.py

Junk for eamples.

(tick) Drag.py

 

(tick) DragCenter.py

 

(tick) DragCircle.py

 

(tick) DragLine.py

 

(tick) DragObjectSet.py

 

(tick) DragPolygon.py

 

(tick) DragRectangle.py

 

(tick) DragWedge.py

 

(tick) EventTimeRecords.py

 

(tick) FileNameManager.py

Class dynamically generates all file names for current configuration parameters.

(tick) GUIAnaPartitions.py

 

(tick) GUIAnaSettings.py

 

(tick) GUIAnaSettingsLeft.py

 

(tick) GUIAnaSettingsOptions.py

 

(tick) GUIAnaSettingsRight.py

 

(tick) GUIBlamish.py

Sub-GUI of GUIFiles.py

(tick) GUICCDSettings.py

 

(tick) GUIConfigParameters.py

GUI for the configuration parameters file management.

(tick) GUIDark.py

Sub-GUI of GUIFiles.py - manipulations with dark runs

(tick) GUIData.py

 

(tick) GUIELogPostingDialog.py

Dialog window for submission of messages with attachments to ELog using response ID and Igor's new interface: Python module for posting message into ELog

(tick) GUIELogPostingFields

Widget with necessary fields for GUIELogPostingDialog

(tick) GUIFileBrowser.py

Text file browser for this project

(tick) GUIFiles.py

Central GUI for file settings contains tab-bar for other widget selection

(tick) GUIFlatField.py

Sub-GUI of GUIFiles.py

(tick) GUIHelp.py

WIdget for messages, i.e. help

(tick) GUIImgSizePosition.py

 

(tick) GUIInstrExpRun.py

depricated GUI

(tick) GUIIntensityMonitors.py

Control GUI for intensity monitors

(tick) GUIKineticMode.py

 

(tick) GUIListOfTau.py

GUI manipulation with list of tau indexes

(tick) GUILogger.py

GUI for logger

(tick) GUIMain.py

The first GUI at start of this application

(tick) GUIMainSplit.py

The same as GUIMainTB.py with integrated GUILogger.py

(tick) GUIMainTB.py

The first GUI at start of this application with tab bar

(tick) GUINonKineticMode.py

 

(tick) GUIRun.py

 

(tick) GUIRunAuto.py

 

(tick) GUIRunInput.py

 

(tick) GUIRunMerge.py

 

(tick) GUIRunProc.py

 

(tick) GUIRunSplit.py

 

(tick) GUISetupBeamZero.py

 

(tick) GUISetupData.py

 

(tick) GUISetupEnergyAngle.py

 

(tick) GUISetupInfo.py

 

(tick) GUISetupInfoLeft.py

 

(tick) GUISetupInfoRight.py

 

(tick) GUISetupPars.py

 

(tick) GUISetupSpecular.py

 

(tick) GUISystemSettings.py

 

(tick) GUISystemSettingsLeft.py

 

(tick) GUISystemSettingsRight.py

 

(tick) GUIViewControl.py

 

(tick) GUIViewResults.py

 

(tick) GUIWorkResDirs.py

 

(tick) GlobalExternal.py

 

(tick) GlobalUtils.py

Module contains all possible global methods.

(info) ImgSpeNavToolBar.py

Re-implemented standard tool-bar (depricated)

(tick) Logger.py

Core class for logger

(tick) MaskEditor.py

 

(tick) MaskEditorButtons.py

 

(info) Overlay.py

Demonstration of how to draw something on the top of GUI

(tick) PlotArray.py

Main class for array presentation plot

(tick) PlotArrayButtons.py

Widget for custom button-bar

(tick) PlotArrayWidget.py

Widget for graphical window

(tick) PlotG2.py

 

(tick) PlotG2Buttons.py

 

(tick) PlotG2Widget.py

 

(tick) PlotGraph.py

 

(tick) PlotGraphWidget.py

 

(tick) PlotImgSpe.py

Main class for interactive plot with custom button bar

(tick) PlotImgSpeButtons.py

Widget for custom button-bar

(tick) PlotImgSpeWidget.py

Graphical image for image and spectral histogram

(tick) PlotTime.py

Main class for time record presentation plot

(tick) PlotTimeWidget.py

Widget for graphical window

(tick) RecordsFromFiles.py

 

(tick) ThreadWorker.py

 

(tick) ViewResults.py

 

(tick) data/scripts/psana-*.cfg

Stub-scripts for ConfigFileGenerator.py

Modules used from package ImgAlgos

Updated on 2013-10-14

List of modules in alphabetic order:

Module

Description

(tick) CorAna

Superclass for all CorAna* modules

(tick) CorAnaData

Processing of split images, evaluation of correlators

(tick) CorAnaInputParameters

Input parameters parser

(tick) CorAnaMergeFiles

Merges split files with correlatros in a single file

(tick) CorAnaPars.py

Holds common parameters

(tick) CorAnaProcResults

Example of stand-alone processing of the file with correlators

(tick) CorAnaSubmit.py

Command-line submission procedure for processing

(tick) GlobalMethods

Common global methods for ImgAlgos package

(tick) ImgAverage

Generic psana module for image average

(tick) ImgCalib

Generic psana module for image calibration

(tick) ImgIntForBins

Generic psana module for intensity(averaged over bin pixels) in bins per event, bin numbers are defined by the map

(tick) ImgIntMonCorr

Generic psana module for image normalization on intensity monitors' data

(tick) ImgMaskEvaluation

Generic psana module for saturation and noisy pixel mask evaluation from data

(tick) ImgTimeStampList

Generic psana module produces the file with inage time stamps and indexes

(tick) ImgVsTimeSplitInFiles

Generic psana module accumulates split image for all events in files

(tick) IntensityMonitorsData

Generic psana module produces the file with intensity monitor data for all events

(tick) PrincetonImageProducer

Generic psana module gets the Princeton camera image and save it as a ndarray<uint16_t,2> image in the event

(tick) Tahometer

Generic psana module for performance report

Functional description

Updated on 2013-10-14
In this section modules are listed in functional order.

PSANA modules

Dark run pre-processing

Scaner
Runs in batch for the dark file to get preliminary information.
(tick) ImgAlgos.ImgTimeStampList

  • counts number of events in the file
  • makes file with time stamps
  • evaluate time intervals between frames (for dark run)

Pedestals
Runs in batch for the dark file to get averaged pedestals.
(tick) ImgAlgos.PrincetonImageProducer gets image from event as an ndarray object
(tick) ImgAlgos.Tahometer evaluates performance of the batch job
(tick) ImgAlgos.ImgAverage produces files with averaged, rms-spread, and hot-pixel mask for images in a given range of events.

Data pre-processing

Scaner
Runs in batch for the data file to get preliminary information.
(tick) ImgAlgos.Tahometer evaluates performance of the batch job, counts number of events in the data file
(tick) ImgAlgos.ImgTimeStampList makes file with time stamps and time record counters for tau
(tick) ImgAlgos.IntensityMonitorsData makes file with intensity monitor records

Average
Runs in batch for the data file to get averaged image
(tick) ImgAlgos.Tahometer evaluates performance of the batch job
(tick) ImgAlgos.PrincetonImageProducer gets image from event as an ndarray object
(tick) ImgAlgos.ImgAverage produces file with averaged and rms-spread for raw images in a given range of events
(tick) ImgAlgos::ImgMaskEvaluation - module is configured to evaluate masks:

  • saturated mask - pixel is considered as saturated if its amplitude exceeds the threshold at least once per run
  • noise mask - pixel is considered as noisy if its amplitude exceeds the MEAN+5*RMS in 5% of events. The "noise" MEAN and RMS are evaluated for 8 (or less on the boarder) surrounding pixels. This mask is not used in current analysis.

Data processing

Split
(tick) ImgAlgos.Tahometer for performance evaluation.
(tick) ImgAlgos.PrincetonImageProducer
(tick) ImgAlgos::ImgCalib module is configured to:

  • subtract pedestals obtained for dark run
  • account for threshold (LLD) constant or in number of RMS

(tick) ImgAlgos.ImgIntMonCorr image normalization on intensity monitors data
(tick) ImgAlgos.ImgVsTimeSplitInFiles split image and save blocks for all events in separate files.
(tick) ImgAlgos.ImgIntForBins evaluate intensity (averaged over bin pixels) in bins per event, bin numbers are defined by the map, results are saved in the file.
(tick) ImgAlgos.ImgAverage produces file with averaged and rms-spread for images with subtracted pedestals and allied LLD in a given range of events

Process
Data processing is implemented in stand alone (non-psana) modules
(tick) ImgAlgos.CorAna.cpp
(tick) ImgAlgos.CorAnaInputParameters.cpp
(tick) ImgAlgos.CorAnaData.cpp

Merge
(tick) ImgAlgos.CorAna.cpp
(tick) ImgAlgos.CorAnaInputParameters.cpp
(tick) CorAnaMergeFiles.cpp - saves binary file for float(32) with shape (Ntau,3,rows,cols), where 3 stands for <Ip>, <If>, and <Ip*If>
Can be acessed in python as

Code Block
    sp.cor_arr = np.fromfile(sp.fname, dtype=np.float32)
    <image-size> = rows * cols
    nptau = <file-size>/<image-size>/3
    sp.cor_arr.shape = (nptau, 3, rows, cols)

GUI

The system of GUIs, consisting of dozens of CorAna.GUI... modules is implemented in the draft approximation. Roughly it reproduces all features of the old program.

Input parameters GUIs

(tick)(plus) CorAna.GUI... most of them are available. Will be added or extended if necessary.
(tick) Files - define input files and do pre-processing
(tick) Setup Info
(tick) Analysis Info
(tick) System
(tick) Intensity Monitor

Run GUI

(tick) Input - short summary of input info for data processing
(tick) Split - control and monitoring for the 1st stage of processing
(tick) Process - ... 2nd stage ...
(tick) Merge - ... 3d stage ...
(tick) Auto - ... for all 3 stages ...

View Results GUI

Contains a set of control fields for presentation of results
(tick) Direct and reflected beam geometry is implemented in ViewResults.py. Currently the switch between the direct and reflected beam geometry is used from tab status variable: cp.exp_setup_geom.value().
(plus) If the PV variable will be used, then the switch should be changed in ViewResults.get_q_map(sp) module.

Graphics

(tick) PlotArray*.py - for intensity monitors
(tick) PlotImgSpe*.py - for images, partition maps, masks etc.
(tick) PlotTime*.py - for time stamp monitoring
(tick) PlotG2*.py - G2 plot
(tick) PlotGraph*.py - I(q) and I(q,t) plot
(tick) MaskEditor*.py, Drag*.py - Mask Editor for

  • region of interest (ROI-mask)
  • blemish mask
    (tick) ViewResults.pyQ - all evaluations for resulting array of correlators
  • maps for pixel x,y coordinates, r, phi
  • q maps for transmission and reflective geometry
  • etc.

Infrastructural modules

Infrastructural modules provide basic infrastructure of the project.
(tick) ConfigParameters.py, ConfigParametersCorAna.py, and GUIConfigParameters.py provides convenient approach for maintenance of all configuration parameters.
(tick) Infrastructural modules Logger.py and GUILogger.py provides a generic approach to logging system.
(tick) Module ConfigFileGenerator.py use current settings of configuration parameters and stub-file scripts from CorAna/data/scripts/ and generates the psana configuration files.
(tick)(plus) Module FileNameManager.py is a single place which provides a dynamic file names for current version of the configuration parameters.
(tick) GlobalUtils.py - global utilities for common operations.
(tick) BatchJob.py - superclass for batch job submission.
(tick) BatchJobPedestals.py - pre-processing for dark run files.
(tick) BatchJobData.py - re-processing for data files.
(tick) BatchJobCorAna.py - main data processing - calculation algorithm.
(tick) RecordsFromFiles.py - class helps to access data in files.

Status of the project

  • This project is in the stage of comparison of results between old Marcin's scripts and this application.

Comparison of results

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.

Compare g2 at 14 tau values with indexes:

Code Block
1 2 3 4 5 6 7 8 9 10 12 14 16 20

See Progress section for more details on comparison.

Progress

Weekly progress of the IDPE project for TCE

To-do list

Processing (at psana Split level)
(minus) Get cp.photon_energy, cp.nominal_angle and other PV variables from data scan and setup confiruration

Comparison of results

  • Search for the reason of difference in results for single-q-bin g2.

View Results
more plots for results
(tick)(plus) g2(tau) for q-dynamic
(tick)(plus) Average intensity and Intensity(q-static)
(tick)(plus) Intensity(q-static, t)
(tick)(plus) Histogram for intensity monitor
(minus) Fit results for function g2(tau|pars) = C*exp[-(2t/tau0)**beta] + B

  • plot for all fits with beta=1 and float,
  • tau0 vs q-dynamic
  • C vs q-dynamic
  • B vs q-dynamic
  • beta vs q-dynamic

References

Photon Correlation Spectroscopy, article in wikipedia
Algorithms for Time Correlation Experiments
Note on XCS code from Marcin

...