Page History
Table of Contents | ||
---|---|---|
|
...
XtcExplorer (GUI interface to pyana)
Note! This package is a new version of the "XtcEventBrowser" which is the old name of the package.
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).
Xtc files contain the raw data (datagrams) streamed from the DAQ online system. The datagrams occur in the order they were flushed from the DAQ system, and thus do not necessarily appear in chronological order. The datagrams are not indexed, so the file must be read sequentially. The pyana and psana frameworks are designed to process these datagrams and present them to you shot by shot (or event by event, in pyana/psana terminology).
The XtcExplorer
, therefore they are not indexed and the events don't always line up in the "right" order. Therefore it's not straight-forward to browse (back and fourth) through an xtc file. This tool (XtcEventBrowser) is also not a real browser, but allows a simple-to-run interface to the xtc files. The package name is XtcEventBrowserXtcExplorer, the executables (xtcbrowser xtcexplorer and xtcscanner) are found in the app subdirectory of this package, and all other code is in the src subdirectory.
xtcbrowser
The xtcbrowser is the command to launch the Event Display for xtc files. The package name is XtcEventBrowser. 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.
Note! This tool is under development... features are being added and new versions available often. This documentation might be slightly outdated, but if you use the tagged version (VXX-XX-XX) mentioned here it should work as advertised.
How to get started
source code is in the src subdirectory.
How to get started
You should always run this code from your own release working directory. It might work from other directories, but be aware that configuration files will be written to your current directory. 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...
This tool is not in a release yet, so to run, you need to set up an offline release in your directory (See the Account Setup section to set up the analysis environment). Do the setup . Set up your release from pslogin
:
Code Block |
---|
[user@pslogin ~] newrel ana-current myrelease [user@pslogin ~] cd myrelease [user@pslogin myrelease] sit_setup |
Optional: Add the xtc browser XtcExplorer package to your analysis release and "compile":
Code Block |
---|
[user@pslogin myrelease] addpkg XtcEventBrowserXtcExplorer V00-0001-18 [user@pslogin myrelease] scons 01 [user@pslogin myrelease] scons |
Note! If you don't check out this local copy, you will run whichever version is in the release. You will not be able to edit any of the source files to tweak your analysis.
Note! You can omit the "tag" (VXX-XX-XX) to get the latest and greatest version in the svn repository, but this may look different from described here.
Run the program with the command 'xtcbrowserxtcexplorer' 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.
...
Code Block |
---|
[user@psanaXXX myrelease] sit_setup [user@psanaXXX myrelease] xtcbrowserxtcexplorer /reg/d/psdm/cxi/cxi80410/xtc/e55-r0581* |
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! Send me an email (ofte at slac.stanford.edu)
Description of the GUIs
LCLS Xtc
...
Explorer
xtcexplorer will launch the main GUI. It currently has two sections: xtcbrowser will launch a GUI, the main browser. It allows you to browse for files, and to run a scan to see what's in the file. (Perhaps "scan" is not a good choice of word... it parses the xtc file and investigate what kind of data is there.)
- File section: Shows a list of currently selected file(s). As you may have guessed, "File Browser" opens a file browser and "Clear File List" clears the current list of files. This section also allows you to add a file name by hand (or paste).
- Scan section: The two buttons to the left allows you to scan the xtc file to get a summary of what datagrams are stored in it. Note, for most purposes, a "Quick Scan" is sufficient. If you need to scan the whole file, e.g. if you want to know the total number of events, number of calibration cycles, etc, you can enable the "Scan File(s)" button. If the files are big, this will take a lot of time...
...
The GUI as described above prepares a configuration file for you to run pyana. You can either run it from the GUI or you can run it from the command line. The configfile sets input parameters for the pyana modules in this package. Feel free to use one or more of these modules as a starting point for your more elaborate pyana analysis!
Code Block |
---|
XtcEventBrowserXtcExplorer/src/pyana_bld.py # display of Beam-line data XtcEventBrowserXtcExplorer/src/pyana_cspad.py # display of CsPad image data XtcEventBrowserXtcExplorer/src/pyana_image.py # display of camera image data XtcEventBrowserXtcExplorer/src/pyana_ipimb.py # display of diode data from IPIMB and PIM XtcEventBrowserXtcExplorer/src/pyana_waveform.py # display of waveform data (not fully functional yet) XtcEventBrowser XtcExplorer/src/pyana_epics.py # display of Epics PV data (not fully functional yet) XtcEventBrowser XtcExplorer/src/pyana_scan.py # display of motor scan data XtcEventBrowserXtcExplorer/src/pyana_plotter.py # a plotter module to control the event display |
...
- pyana_cspad: CsPad data is reconstructed in pyana_cspad.py. The image plot value limits are adjusted automatically, but if
you want to change them, click on the color bar (left-click for low limit, right-click for high limit).
The successive events will be plotted with the new limits. Revert to the original by middle-clicking.
To run this module by itself with pyana:
Options must be specified in a configuration file, or the default values will be used, e.g.:Code Block pyana -m XtcEventBrowserXtcExplorer/src/pyana_cspad.py <xtc files>
Code Block image_source # string, Address of Detector-Id|Device-ID dark_img_file # filename, Dark image file to be loaded, if any output_file # filename (If collecting: write to this file) plot_vrange # range=vmin-vmax of values for plotting (pixel intensity) threshold # lower threshold for image intensity in threshold area of the plot thr_area # range=xmin,xmax,ymin,ymax defining threshold area
Image display of the CSPad detector, background subtracted. This is currently the only display that has interactive features. A filter allows you to select events within requested intensity range.
...
MatLab | MatPlotLib | Comments | |||||
---|---|---|---|---|---|---|---|
Loglog plot of one array vs. another
| Loglog plot of one array vs. another
| channels is a 4xN array of floats, where N is the number of events. Each column corresponds to one out of four Ipimb channels. | ]]></ac:plain-text-body></ac:structured-macro> | ||||
test | test | Test | |||||
array of limits from graphical input | array of limits from graphical input |
| |||||
|
| In MatLab, | |||||
|
|
| |||||
filter | filter |
| |||||
|
| Comment | |||||
|
|
|