Difference between revisions of "Setup"

From cctbx_xfel
Jump to: navigation, search
(Reorganizend per-shell configuration into lists.)
Line 12: Line 12:
  
 
=== ''cctbx.xfel'' setup ===
 
=== ''cctbx.xfel'' setup ===
==== bash(1) ====
+
To start using an installation of ''cctbx.xfel'', the environment has to be configured.  The details depend on the user's shell.
To set up the ''cctbx.xfel''-environment for a bash(1) shell, <code>setpaths.sh</code> has to be sourced,
+
  
  . /reg/d/ffb/cxi/temp/cctbx/cctbx_xfel/build/setpaths.sh
+
<ul>
 +
<li>
 +
For a bash(1) shell, <code>setpaths.sh</code> should be sourced from the shell configuration files. To do that, add
 +
<pre>test -r "/reg/d/ffb/cxi/temp/cctbx/build/setpaths.sh" && \
 +
  . "/reg/d/ffb/cxi/temp/cctbx/build/setpaths.sh"</pre>
 +
to <code>~/.bashrc</code>.  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 put
 +
<pre>test -r "${HOME}/.bashrc" && . "${HOME}/.bashrc"</pre>
 +
near the top of <code>~/.bash_profile</code>.  These changes will not take effect until a new shell is started.  To start using the ''cctbx.xfel'' environment from the running shell, source <code>setpaths.sh</code> on the command line,
 +
<pre>. /reg/d/ffb/cxi/temp/cctbx/build/setpaths.sh</pre>
 +
</li>
  
To avoid having to perform this step on each login, the lines below should be added to <code>~/.bashrc</code> file
+
<li>
 
+
csh(1)-users should instead source <code>setpaths.csh</code>. Add
  test -r "/reg/d/ffb/cxi/temp/cctbx/cctbx_xfel/build/setpaths.sh" && \
+
<pre>test -r "/reg/d/ffb/cxi/temp/cctbx/build/setpaths.csh" && \
   . "/reg/d/ffb/cxi/temp/cctbx/cctbx_xfel/build/setpaths.sh"
+
   source "/reg/d/ffb/cxi/temp/cctbx/build/setpaths.csh"</pre>
 
+
to <code>~/.cshrc</code>. There is no need to edit any additional files for interactive shells. To set up the environment for the running shell, execute
This ensures the environment is properly prepared for non-interactive shells, which are used to launch jobs on the cluster.  To prepare the environment for interactive bash(1) shells it is recommended to put the lines below near the top of <code>~/.bash_profile</code>:
+
<pre>source /reg/d/ffb/cxi/temp/cctbx/build/setpaths.csh</pre>
 
+
on the command line.
test -r "${HOME}/.bashrc" && . "${HOME}/.bashrc"
+
</li>
 
+
</ul>
==== csh(1) ====
+
csh(1)-users should instead source <code>setpaths.csh</code>,
+
 
+
source /reg/d/ffb/cxi/temp/cctbx/cctbx_xfel/build/setpaths.csh
+
 
+
and add the lines below to <code>~/.cshrc</code>
+
 
+
test -r "/reg/d/ffb/cxi/temp/cctbx/cctbx_xfel/build/setpaths.csh" && \
+
  source "/reg/d/ffb/cxi/temp/cctbx/cctbx_xfel/build/setpaths.csh"
+
 
+
For csh(1) there is no need to edit any additional files for interactive shells.
+
  
 
=== Linking ''cctbx.xfel'' to ''pyana'' ===
 
=== Linking ''cctbx.xfel'' to ''pyana'' ===

Revision as of 17:07, 27 September 2013

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, add
    test -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 put

    test -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, source setpaths.sh on the command line,

    . /reg/d/ffb/cxi/temp/cctbx/build/setpaths.sh
  • csh(1)-users should instead source setpaths.csh. Add
    test -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, execute

    source /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.