Versions Compared

Key

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

...

XtcExplorer (GUI interface to pyana)

...

Info

The latest version of XtcExplorer is V00-01-20.
This latest version involves major changes to how pyana handles plotting for images and diodes, as well as improvements to the GUI functionality and pyana modules. It is a bit transitional, not all aspect are tested, so please report any bugs that you see, or if you miss any features that disappeared in the development process.
If you encounter problems, please let me know, and use V00-01-19 instead while you wait for a bugfix.

This is a description and documentation of a GUI tool to explore the xtc data. It is written in python, relying on PyQt4 for graphical user interface. The data processing is done via the pyana framework and visualization provided by matplotlib. It can be run on any xtc file, including the file being written during data aquisition (DAQ).

...

  1. Set up your release work directory:
    You should always run this code from your own release working directory.
    See the Account Setup section for more details on how 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
    
    Add
  2. Check out 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 XtcExplorer package from the SVN software repository:
    This step is optional. But without it, you will not be able to edit/customize any source files.
    You need an afs token to check out the package, so , which on pslogin is automatic (I think), but if you didn't already you need to run 'kinit' 're on psananeh/psanafeh, issue a kinit command 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":
    Code Block
    none
    none
    [user@pslogin myrelease] addpkg XtcExplorer
    [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 featuresthe package, or 'addpkg XtcExplorer HEAD' to get the very latest version.

  3. Run the program:
    Launch the GUI with the command 'xtcexplorer' and optionally optionaly 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*
    

...

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

pyana_image

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

  • Load dark image from a file for background subtraction
  • Filter events: the 'threshold' parameter holds settings for filtering events based on image values. Specify keywords=value separated by whitespaces, e.g.
    • 'lower=400.0 upper=1600.0 type=maximum roi=(200:300,100:400)' which will filter out events that have the maximum pixel in the region of interest below 400 or above 1600.
    • 'lower=500 type=average' will filter out events that have average pixel value in the whole image below 500.
  • Apply
  • 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 subtractionDisplay and/or save the image, a background subtacted image, an average image, an image with algorithms applied... etc.
  • Save the average image(s) or selected single-shot images (up to a maximum) to file (numpy binary file)
  • In Interactive mode (see pyana_plotter), some interaction with the plot is possible:
    • change intensity range (color range) by left-clicking to set low limit, right-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 (2 for SlideShow).

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

Code Block
none
none
  sources      =        # string, Address  sources  of Detector-Id|Device-ID
  inputdark    =        # filename of a binary numpy (.npy) with dark image for subtraction
  threshold    =        # Threshold stringinformation, Addressspecify of Detector-Id|Device-ID
  inputdark    =        # filename of a binary numpy (.npy) with dark image for subtraction
  threshold    =        # Threshold information, format: 'value (xmin:xmax,ymin:xmax) type'     
  algorithmsthe keywords that apply: lower=value, upper=value, type=maximum (default) or average, roi=(xmin:xmax,ymin:ymax)'
  algorithms   =        # algorithms to be applied to the image, e.g.: 'rotate:30' to rotate 30 degrees, or shift:(300,200) to shift by (nrows,ncols). 
  quantities   =        # algorithmsquantities to beplot applied to the imageor save, e.g.: 'rotate:30' to rotate 30 degreesimage dark average maximum'
  plot_vrange  =        # range (format vmin:vmax) of values for plotting (pixel intensity)
  show_projections =    # bool, include projections onto x,y axes, or not.   
  outputfile   =        # base name for output file. 
  n_hdf5       =        # temporarily unsupported. 
  max_save     = 0      # if larger than zero, will save event images in separate files, up to maximum. 
  calib_path   = None   # path to calib directory (Currently only needed for CSPad)

...