Setup: Difference between revisions

From cctbx_xfel
Jump to navigation Jump to search
Line 66: Line 66:
  $ scons
  $ scons
The last step compiles the analysis modules just linked in.
The last step compiles the analysis modules just linked in.
=== Setup your scratch area ===
Create a scratch folder and populate it with some directories that will be used during this tutorial, changing <username> to your SLAC account name:
$ cd /reg/g/cctbx/tutorials/scratch/
$ mkdir <username>
$ cd <username>
$ mkdir darks
$ mkdir averages
$ mkdir results


== Run each time on logging on to SLAC ==
== Run each time on logging on to SLAC ==

Revision as of 09:57, 26 January 2014

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 quick start

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 the package. Details about installing of a test release and analysis packages are covered in Analysis Workbook. Quick Tour. Assuming the LCLS software is installed at /reg/d/psdm, the LCLS environment is prepared in a bash(1) shell using

$ . /reg/g/psdm/etc/ana_env.sh

or

% source /reg/g/psdm/etc/ana_env.csh

for a csh(1). These settings may be made persistent by adding

test -r /reg/g/psdm/etc/ana_env.sh && . /reg/g/psdm/etc/ana_env.sh

to ~/.bashrc, or

test -r /reg/g/psdm/etc/ana_env.csh && . /reg/g/psdm/etc/ana_env.csh

to ~/.cshrc as appropriate. A test released based on the most current LCLS software is then set up using

$ newrel ana-current myrelease
$ cd myrelease
$ newpkg my_ana_pkg

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/g/cctbx/build/setpaths.sh" && \
      . "/reg/g/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/g/cctbx/build/setpaths.sh
  • csh(1)-users should instead source setpaths.csh. Add
    test -r "/reg/g/cctbx/build/setpaths.csh" && \
     source "/reg/g/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/g/cctbx/build/setpaths.csh

    on the command line.

Linking cctbx.xfel to pyana

Run these commands to associate pyana and cctbx.xfel:

$ cd ~/myrelease
$ sit_setup
$ cd ~/myrelease/my_ana_pkg
$ ln -s /reg/g/cctbx/sources/cctbx_project/xfel/cxi/cspad_ana src
$ cd ..
$ ln -s /reg/g/cctbx/sources/cctbx_project/xfel/cxi/lsf.sh .
$ scons

The last step compiles the analysis modules just linked in.

Setup your scratch area

Create a scratch folder and populate it with some directories that will be used during this tutorial, changing <username> to your SLAC account name:

$ cd /reg/g/cctbx/tutorials/scratch/
$ mkdir <username>
$ cd <username>
$ mkdir darks
$ mkdir averages
$ mkdir results

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/g/cctbx/tutorials/setup/test.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0004-s00-c00.xtc

This should start a viewer, displaying dark-subtracted averages from an XTC stream. Press the green run button to see the images. This particular stream has a series of misses at its beginning; hits will appear presently.

More specifically, this command starts pyana with a configuration file (-c) and an XTC file. For more information, see the Overview and other tutorial pages.