Setup
LCLS provides several frameworks for data analysis, and also provides methods for translating collected data to HDF5, a general and portable container format for storage of large amounts of numerical data. cctbx.xfel extends the LCLS analysis packages with a set of analysis modules. In particular, the cctbx.xfel analysis modules are run through pyana, the Python-implementation of LCLS's analysis framework. Since analysis proceeds directly from the raw data, no intermediate conversion is necessary, and it can be done while an experiment is running.
cctbx.xfel is installed at SLAC for general use. Before it can be used, the following setup commands need to be run to configure the environment.
One-time setup
These steps need only be performed once before using cctbx.xfel.
LCLS release setup
A test release, which refers to a particular release of the LCLS packages, is represented by a directory in the file system, often called analysis-rel
or myrelease
. An analysis package within the test release in turn refers to the files implementing the analysis modules of cctbx.xfel. Installation of a "test release" and analysis packages is covered in Analysis Workbook. Quick Tour. Linking the cctbx.xfel analysis modules to the analysis package is described in Linking cctbx.xfel to pyana.
cctbx.xfel setup
To start using an installation of cctbx.xfel, the environment has to be configured. The details depend on the user's shell.
-
For a bash(1) shell,
setpaths.sh
should be sourced from the shell configuration files. To do that, addtest -r "/reg/d/ffb/cxi/temp/cctbx/build/setpaths.sh" && \ . "/reg/d/ffb/cxi/temp/cctbx/build/setpaths.sh"
to
~/.bashrc
. This ensures the environment is properly prepared for non-interactive shells, e.g. the shells that are used to run jobs on the cluster. To also be able to use cctbx.xfel from interactive shells, e.g. the shell started after logging in to a host, it is recommended to puttest -r "${HOME}/.bashrc" && . "${HOME}/.bashrc"
near the top of
~/.bash_profile
. These changes will not take effect until a new shell is started. To start using the cctbx.xfel environment from the running shell, sourcesetpaths.sh
on the command line,. /reg/d/ffb/cxi/temp/cctbx/build/setpaths.sh
-
csh(1)-users should instead source
setpaths.csh
. Addtest -r "/reg/d/ffb/cxi/temp/cctbx/build/setpaths.csh" && \ source "/reg/d/ffb/cxi/temp/cctbx/build/setpaths.csh"
to
~/.cshrc
. There is no need to edit any additional files for interactive shells. To set up the environment for the running shell, executesource /reg/d/ffb/cxi/temp/cctbx/build/setpaths.csh
on the command line.
Linking cctbx.xfel to pyana
Run these commands to associate pyana and cctbx.xfel:
$ cd ~/myrelease/my_ana_pkg $ ln -s /reg/d/ffb/cxi/temp/cctbx/cctbx_xfel/sources/cctbx_project/xfel/cxi/cspad_ana src $ cd .. $ scons
The last step compiles the analysis modules just linked in.
Run each time on logging on to SLAC
Whenever you log on to a fresh shell at SLAC, before you can use any portion of cctbx.xfel that uses pyana, you must run these commands:
$ cd ~/myrelease $ sit_setup
Test the installation
At SLAC, test that it is working by e.g.
$ cd ~/myrelease $ cxi.pyana -c /reg/d/ffb/cxi/temp/cctbx/tutorials/setup/test.cfg /reg/d/ffb/cxi/temp/Feb2013calib/e290-r0069-s00-c00.xtc
This should start a viewer, displaying dark-subtracted averages from an XTC stream.