Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Set up your release work directory:
    You should always run this code from your own release working directory.
    See the Account Setup section to set up the analysis environment. Set up your release working directory from pslogin:
    Code Block
    none
    none
    [user@pslogin ~] newrel ana-current myrelease
    [user@pslogin ~] cd myrelease
    [user@pslogin myrelease] sit_setup
    

  2. Add the package:
    This step is optional. Since release ana-0.3.7, xtcexplorer has been built into the release so you can skip to (3).
    Checking out a local copy is beneficial, though! That will enable you to edit the source files and customise the analysis.

    You need an afs token to check out the package, so if you didn't already you need to run 'kinit' first:
    Code Block
    none
    none
    [user@pslogin myrelease] kinit
    Password for user@SLAC.STANFORD.EDU:
    
    Now you're ready to check out the package and "compile" (to avoid a bug in the current release, use V00-01-14):
    Code Block
    none
    none
    [user@pslogin myrelease] addpkg XtcExplorer V00-01-14
    [user@pslogin myrelease] scons
    
    Note! You can also do 'addpkg XtcExplorer VXX-XX-XX' to get a specific version of the package, or to get the most recent one, do 'addpkg XtcExplorer HEAD', but be aware that it may look different from described here, and might have fresh bugs as well as new features.

  3. Run the program:
    Launch the GUI with the command 'xtcexplorer' and optionally give the input xtc files that you want to read
    as arguments. You can also browse to find files after launching the browser.

    To have access to the xtc files, you need to login to psana for this:
    Code Block
    [user@psanaXXX myrelease] sit_setup
    [user@psanaXXX myrelease] xtcexplorer /reg/d/psdm/CXI/cxi22010/xtc/e60-r0465-s0*
    
Info
  • If you encounter any problems, ask for help! Don't be stuck. This is supposed to be easy. If it's not, I did something wrong, so let me know! (smile) Send me an email (ofte at slac.stanford.edu)

  • xtcexplorer writes out pyana configuration files, based on selections made in the GUI. Look out for files with names xb_pyana_XXXX.cfg, where XXXX is a random four-digit number. You can use them to run pyana directly from the command line. But they accumulate, so you might want to remove these regularly...

  • LCLS data is very diverse, and not all features for all detectors are implemented (yet). Feel free to contact me if you have requests and suggestions.

Description of the GUIs

The following documentation describes version 0.1.15 (or "tag" V00-01-15"). For earlier versions, see earlier versions of this confluence page (go to "Tools" -> "Page history").

LCLS Xtc Explorer

xtcexplorer will launch the main GUI. At startup, it has two sections:

...

Code Block
none
none
XtcExplorer/src/pyana_bld.py          # display of Beam-line data
XtcExplorer/src/pyana_epics.py        # display of Epics PV data
XtcExplorer/src/pyana_scan.py         # display of motor scan data
XtcExplorer/src/pyana_encoder.py      # display of encoder data
XtcExplorer/src/pyana_ipimb.py        # display of diode data from IPIMB and PIM
XtcExplorer/src/pyana_waveform.py     # display of waveform data
XtcExplorer/src/pyana_cspadimage.py        # display of CsPadcamera image data
XtcExplorer/src/pyana_imageplotter.py      # a plotter #module displayto ofcontrol camerathe imageevent data
XtcExplorer/src/pyana_plotter.py      # a plotter module to control the event display
display

Additional helper classes and functions are defined in

...

Code Block
none
none
 do_ebeam           = False       #  Plot data from EBeam object
 do_gasdetector     = False       #  Plot data from GasDetector
 do_phasecavity     = False       #  Plot data from PhaseCavity
 do_ipimb           = False       #  Plot data from SharedIpimb  (No longer used, see pyana_ipimb)

Example of how to run this pyana module by itself, i.e. no GUI, processing 300 shots and using an xtcexplorer-generated config file:

...

Code Block
none
none
  sources           =             # string, space-separated list of addresses (Detector-Id|Device-ID)

Image Removed

  quantities        =             # string containing quantities to plot. "average stack single"

Image Added

Example how to run this pyana Example how to run this pyana module by itself, i.e. no GUI, processing 300 events and using an xtcexplorer-generated config file:

...

pyana -n 300 -c xb_pyana_5299.cfg -m XtcExplorer.pyana_waveform <xtc files>

pyana_

...

image

This module will take care of displaying all camera images, including CsPad images.
Additionally, it can

  • filter images above a threshold value
  • filter images with ROI above a threshold value
  • apply algorithms to an image (e.g. rotation, shift, etc)
  • Sum&average images above threshold, and images below threshold
  • Load dark image from a file for background subtraction
  • Save the average image(s) or selected single-shot images (up to a maximum) to file (numpy binary file)

CsPad data is reconstructed in pyana_cspad.py.

  • If a threshold is provided, shots above threshold will be displayed / stored, and shots below
    threshold will be added to sum of darks for averaging.
  • If a dark file is provided, background subtraction is done before filtering. If not, the below-threshold
    average can be used for background subtraction
  • The plot configuration depends on whether threshold and dark subtraction is used. Intensity projections
    are also added to the plot, can be turned off (in the code).
  • In Interactive mode (see pyana_plotter), you can click on the image to some interaction with the plot is possible:
    • change intensity range (color range)
    : Left
    • by left-
    click
    • clicking to set low limit, right-
    click
    • clicking to set high limit, middle-click to reset to full scale.
    • change threshold value and region of interest if a ROI was defined: Click on the rectangle, enter new values when prompted in terminal window
    • switch to SlideShow mode when you are content with the display: Middle-click on the canvas and enter new display mode value
    .You can save the average image(s) or the selected single-shot images to file (numpy binary file)
    • (2 for SlideShow).

Options must be specified in a configuration file. Only the img_ sources parameter is required.

Code Block
none
none
  img_sources       =             # string, Address of Detector-Id|Device-ID
  dark_img_file inputdark    =             # filename of a binary numpy (.npy) with dark image for subtraction
  out_avg_file  threshold    =        # Threshold information, format: 'value # name (base) of output file for average image (numpy array)
  out_shot_file     (xmin:xmax,ymin:xmax) type'     
  algorithms   =        # algorithms to be applied #to name (base) of numpy array file for selected single-shot eventsthe image, e.g.: 'rotate:30' to rotate 30 degrees
  plot_vrange       =             # range (format vmin:vmax) of values for plotting (pixel intensity)
  thresholdshow_projections =    # bool, include projections =onto x,y axes, or not.   
  outputfile   =        # thresholdbase intensityname andfor thresholdoutput area. Format: value (xlow:xhigh,ylow:yhigh)
file. 
  n_hdf5       =        # temporarily unsupported. 
  max_save     = 0      # if larger than zero, will save event images in separate files, up to maximum. 

Image Added

CsPad image where the region of interest (a red rectangle in the

Image Removed

CsPad image where the region of interest (a red rectangle in the left figure) has intensity above a given threshold. The right image shows the region of interest.

CsPad image where region of interest (red rectangle) has intensity above a given threshold. Additionally, a dark-subtracted image is shown (bottom left), where the dark average is based on below-threshold shots from the same run (shown bottom right.

This image is similar to the one above. The intensity limits have been adjusted interactively.

Image Removed

At the end of the job, the average of good images (left) and rejected / dark images (right) is shown.

Example of how to run this pyana module by itself, i.e. no GUI, processing 10 events and using an xtcexplorer-generated config file:

pyana -n 10 -c xb_pyana_5299.cfg -m XtcExplorer.pyana_cspad -m XtcExplorer.pyana_plotter <xtc files>

pyana_image.py

This module processes generic camera frames, e.g from Pulnix TM6740 device. It allows any number of images, given as a space-separated list of addresses in the configuration file.

...

limits have been adjusted interactively.

Image Added

At the end of the job, the average of good images (left) and rejected / dark images (right) is shown.

Image Modified

Image from two Pulinx cameras, no filtering or background subtraction. Projections in x and y are shown.

Image Modified

Displays of three different Pulnix TM6740 images of YAG screens, after rotation/translation. Also shown, differences between images and FFT of differences.

Image Modified

Display of images from Princeton camera. Plotted at end of job of average images above threshold, and average images below threshold (dark). A red rectangle shows the region of interest that was used to evaluate intensity w.r.t. threshold. Configuration: 'threshold = 350 (700:800,1100:1200)'

Example of how to run this pyana module by itself, i.e. no GUI, processing 10 events and using an xtcexplorer-generated config file:

...

Code Block
none
none
sources     # list of IPIMB addresses
variables quantities  # keywords defining what to plot. The following keywords are defined:
            #   fex:pos        plot position based on sum and difference of the 4 diodes
            #   fex:sum        plot sum of signal from all 4 diodes
            #   fex:channels   plot all 4 channels (fex value)
            #   fex:chX        plot fex value from channel X, X=0,1,2,3
            #   raw:chX        plot raw value from channel X, X=0,1,2,3
            #   raw:chXvolt    plot raw voltage from channel X, X=0,1,2,3

...