You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Introduction

XTC Explorer is a GUI-based tool to explore interactively the XTC data files.
Data is extracted using the LCLS framework pyana or psana.
This application is implemented as a Python GUI which generates configuration file for pyana or psana and then allows to launch it.
GUI is implemented on PyQt,
visualization of data uses matplotlib, data processing algorithms are accelerated by NumPy and SciPy libraries.

Based on selections made in the GUI, xtcexplorer writes out pyana configuration 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...

Naming conventions:

  • project name: XTC Explorer
  • package name in the offline software releases: XtcExplorer
  • executable name: xtcexplorer

Manual: XTC Explorer

Authors:

  • Ingrid Ofter - implemented everything for pyana
  • Joseph Barrera - add option to run python modules on psana
  • Andy Salnikov - latest maintenance

Latest tags:
2012-Aug-20 ofte V00-01-37
...
2013-Mar-14 salnikov V00-03-00

This tutorial shows how to set up environment, start xtcexplorer, explore content of the xtc file,
interactively create/edit configuration file for pyana/psana, run it interactively and in the command line, etc.

Set up environment

  • See for details Analysis Workbook. Account Setup
  • Log onto any machine of the interactive pools psananeh or psanafeh:
    ssh -Y pslogin
    ssh psananeh
    or
    ssh psanafeh
    
  • Once per session execute one of the following scripts
    • for bash shell:
      . /reg/g/psdm/etc/sit_env.sh
      
    • or for csh shell:
      source /reg/g/psdm/etc/sit_env.csh
      
  • You should always run this application from your own release working directory:
        newrel ana-current my_tutorial_release;
        cd my_tutorial_release;
        sit_setup; 
    
    At this point you are ready to go.

Optional: if something need to be changed in code, check out the latest version of package and "compile":

    addpkg XtcExplorer HEAD
    scons

Exercise 1: Start xtcexplorer and select the XTC file

Application GUI can be started by the command

    xtcexplorer

To proceed the xtc file name should be pointed using one of four methods:

  1. use command line parameter
        xtcexplorer /reg/d/psdm/XPP/xpptut13/xtc/e308-r0008-*.xtc
    or
        xtcexplorer /reg/d/psdm/SXR/sxrtut13/xtc/e306-r0366-*.xtc
    
  2. use Instrument-Experiment-Run number-Load buttons in GUI
  3. use file browser
  4. type-in the file name
    Once a file or more has been connected, another GUI will pop up (possibly after a short delay while the file(s) content is being investigated). This GUI displays information about the file content and help with further processing of the data in pyana.

Exercise 2: Explore XTC file content and make configuration file

In the Psana Control Center window

  • set desired parameters in section General Settings
  • in the left panel check detectors which you want to monitor, for example
    (tick) EBeam
    (tick) FEEGasDetEnergy
    (tick) XppGon-0|Cspad2x2-1

    In case of selection
    (tick) Epics Process Variables
    separate window Available Epics PVs will pop up. Desired PVs need to be checked.

Click on Write configuration to file button.
After that the configuration file with name xb_pyana_XXXX.cfg is ready and can be edited clicking on Edit configuration to file or executed

  • click on button Run pyana or Run psana and confirm in the pop-up box that you want to run command line like
    pyana -c xb_pyana_XXXX.cfg
    
    (tick) Ok
    and enjoy observing your data in plots

Exercise 3: Run pyana with existing configuration file from command line

Use ls command, select one of existing configuration files created by the xtcexplorer in current directory and run psana/pyana by the command line:

pyana -c xb_pyana_XXXX.cfg

observe the same results as in Exercise 2.

Currently implemented pyana/psana modules

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_image.py        # display of camera image data
XtcExplorer/src/pyana_plotter.py      # a plotter module to control the event display

These modules can be included in the configuration file using editor with parameters explained in XTC Explorer

What to use pyana or psana?

Now you are familiar with general concept of how to launch pyana or psana in the xtcexplorer or command line for existing modules. But you need in more data processing and would like to get data in your code in the framework module. What framework should you prefer pyana or psana?
We strongly encourage people to use psana, which covers everything what is available in pyana and has more features, which are not available in pyana.

Framework interfaces in pyana and psana modules are slightly different, that is explained in
Migration from pyana to psana

References

XTC Explorer
HDF5 Explorer
Pyana User Manual
Migration from pyana to psana

Python
PyQt
matplotlib
NumPy
SciPy

  • No labels