<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://viper.lbl.gov:8080/cctbx.xfel/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hattne</id>
	<title>cctbx_xfel - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://viper.lbl.gov:8080/cctbx.xfel/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hattne"/>
	<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php/Special:Contributions/Hattne"/>
	<updated>2026-06-13T17:42:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=105</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=105"/>
		<updated>2014-04-23T18:40:12Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Added instructions for obtaining CBFlib and DIALS sources.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/current/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://adder.lbl.gov/cctbx.xfel/downloads/labelit_bundle_current.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_current.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.&lt;br /&gt;
}}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Note to editors: nightly bundles are stored in /net/cci/auto_build/cctbx/results.  The nightly LABELIT bundles are generated by a cron job on adder and stored at /net/adder/raid1/hattne/work/downloads.  The script to generate the LABELIT bundles is at /net/adder/raid1/hattne/work/make_labelit_source_bundle.sh. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
Developers may also want to check out the bleeding edge [http://www.bernstein-plus-sons.com/software/CBF CBFlib] sources, as well as sources and auxiliary data for the [http://dials.sourceforge.net DIALS] project.&lt;br /&gt;
  $ svn checkout &amp;quot;http://svn.code.sf.net/p/cbflib/code-0/trunk/CBFlib_bleeding_edge&amp;quot; cbflib&lt;br /&gt;
  $ svn checkout &amp;quot;http://svn.code.sf.net/p/dials/code/trunk&amp;quot; dials&lt;br /&gt;
  $ svn checkout &amp;quot;svn+ssh://user@cci.lbl.gov/dials_regression/trunk&amp;quot; dials_regression&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make&lt;br /&gt;
Please be sure to run make twice, as shown. On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Long-standing gremlin: it appears that for initial installs, it is necessary to run make twice!  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=104</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=104"/>
		<updated>2014-04-15T15:12:31Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Added note for developers regarding dials and dials_regression.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/current/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://adder.lbl.gov/cctbx.xfel/downloads/labelit_bundle_current.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_current.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.&lt;br /&gt;
}}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Note to editors: nightly bundles are stored in /net/cci/auto_build/cctbx/results.  The nightly LABELIT bundles are generated by a cron job on adder and stored at /net/adder/raid1/hattne/work/downloads.  The script to generate the LABELIT bundles is at /net/adder/raid1/hattne/work/make_labelit_source_bundle.sh. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Developers may need/want to check out dials and dials_regression separately, e.g.&lt;br /&gt;
  svn co &amp;quot;svn+ssh://hattne@svn.code.sf.net/p/dials/code/trunk&amp;quot; dials&lt;br /&gt;
  svn co &amp;quot;svn+ssh://user@cci.lbl.gov/dials_regression/trunk&amp;quot; dials_regression&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make&lt;br /&gt;
Please be sure to run make twice, as shown. On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Long-standing gremlin: it appears that for initial installs, it is necessary to run make twice!  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Preparatory_steps_pyana_version&amp;diff=163</id>
		<title>Preparatory steps pyana version</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Preparatory_steps_pyana_version&amp;diff=163"/>
		<updated>2014-03-14T20:05:02Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Updated and reorganized averaging to cover cxi.lsf&amp;#039;s -s option&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial covers averaging dark and light runs, and creating mask images.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your scratch area ==&lt;br /&gt;
&lt;br /&gt;
Create a scratch folder and populate it with some directories that will be used during this tutorial, changing &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; to your SLAC account name:&lt;br /&gt;
&lt;br /&gt;
 $ cd /reg/g/cctbx/tutorials/scratch/&lt;br /&gt;
 $ mkdir &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ mkdir darks&lt;br /&gt;
 $ mkdir averages&lt;br /&gt;
 $ mkdir results&lt;br /&gt;
&lt;br /&gt;
Or you may use a directory in your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a dark average ==&lt;br /&gt;
&lt;br /&gt;
The CSPAD detector at LCLS is sensitive to temperature distortions and, unlike images collected at a synchrotron source, its output is not automatically dark-subtracted.  Because of this it is necessary to periodically record a dark run with the shutters closed during an LCLS experiment.  The dark run should contain on the order of at least 1000 images.  Before an experimental run can be processed, this dark run must be averaged so that subsequent experimental data can have the dark subtracted from each image.  Furthermore, events during collection can necessitate a new dark, such as ice in the beam over-saturating creating dead pixels or a change in temperature.&lt;br /&gt;
&lt;br /&gt;
To create the average, start by copying the &amp;lt;code&amp;gt;dark.cfg&amp;lt;/code&amp;gt; file to your pyana directory:&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cp /reg/g/cctbx/tutorials/preprocessing/dark.cfg .&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;dark.cfg&amp;lt;/code&amp;gt;.  It will look something like this:&lt;br /&gt;
 [pyana]&lt;br /&gt;
 modules = my_ana_pkg.mod_average&lt;br /&gt;
 num-cpu = 8&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_average]&lt;br /&gt;
 calib_dir       = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
 avg_dirname     = /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/darks&lt;br /&gt;
 stddev_dirname  = /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/darks&lt;br /&gt;
 max_dirname     = /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/darks&lt;br /&gt;
 detz_offset     = 581&lt;br /&gt;
 address         = CxiDs1-0|Cspad-0&lt;br /&gt;
 avg_basename    = Ds1-r0002-avg&lt;br /&gt;
 stddev_basename = Ds1-r0002-stddev&lt;br /&gt;
 max_basename    = Ds1-r0002-max&lt;br /&gt;
&lt;br /&gt;
The configuration file is broken into two sections, the [[#&#039;&#039;pyana&#039;&#039; section | &#039;&#039;pyana&#039;&#039; section]] and the [[#Modules section | modules section]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;pyana&#039;&#039; section ===&lt;br /&gt;
The &#039;&#039;pyana&#039;&#039; section specifies which modules to run.  In this case we are running &#039;&#039;cctbx.xfel&#039;&#039;&#039;s &amp;lt;code&amp;gt;mod_average&amp;lt;/code&amp;gt; module.  If we were running multiple modules, we could chain them together here, and each module would be executed in sequence using the parameters specified in the corresponding module section.  We also request a number of processes to parallelize the job with.  Even though averaging must be done on a single host, on that host the processing can be split up among multiple cores.  Note, other aspects of &#039;&#039;cctbx.xfel&#039;&#039;, such as indexing and integration, do not have this restriction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Module section ===&lt;br /&gt;
The module section specifies parameters specific to averaging:&lt;br /&gt;
;calib_dir&lt;br /&gt;
: this directory is provided by LCLS and includes the layout information of the 64 tiles of the CSPAD detector&lt;br /&gt;
;avg_dirname&lt;br /&gt;
: directory to place the average image&lt;br /&gt;
;stddev_dirname&lt;br /&gt;
: directory to place the standard deviation image&lt;br /&gt;
;max_dirname&lt;br /&gt;
: directory to place the maximum projection image&lt;br /&gt;
;detz_offset&lt;br /&gt;
: experiment-specific number used to calculate the detector distance.  This is the distance in millimeters between the sample interaction region and the far end of the detector stage.  The XTC stream contains the distance from the detector stage to the detector.  These two numbers are subtracted to calculate the distance between sample interaction region and the detector.  We determine this number experimentally using a grid search, testing a range of potential detz_offsets and choosing the one that shows the greatest success at indexing images&lt;br /&gt;
;address&lt;br /&gt;
: the name of the detector in the XTC stream&lt;br /&gt;
;avg_basename&lt;br /&gt;
: this name is prepended to a date stamp to name the average image&lt;br /&gt;
;stddev_basename&lt;br /&gt;
: this name is prepended to a date stamp to name the standard deviation image&lt;br /&gt;
;max_basename&lt;br /&gt;
: this name is prepended to a date stamp to name the maximum projection image image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Running and testing the command ===&lt;br /&gt;
&lt;br /&gt;
Before starting the averaging job the command, replace &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; in the configuration file with your user name.  To average run 2 using the modified configuration file, execute&lt;br /&gt;
 $ cxi.lsf -c ~/myrelease/dark.cfg -i /reg/d/ana11/cxi/data/Mar2013calib/xtc \&lt;br /&gt;
     -o /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; -p 6 -q psanacsq -r 2 -s&lt;br /&gt;
This will request 6 processors, overriding the &amp;lt;code&amp;gt;num-cpu&amp;lt;/code&amp;gt; parameter set in the configuration file.  The directory specified in the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option will be searched for XTC streams, and output will be arranged in the directory defined by the value of the &amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; option.  The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option tells &#039;&#039;cxi.lsf&#039;&#039; to process all the streams on the same host—this is a requirement for averaging.  The job will be scheduled in the queue called &amp;lt;code&amp;gt;psanacsq&amp;lt;/code&amp;gt;, which is one of several available queues.  Note that the job must be submitted from the &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Type &amp;lt;code&amp;gt;bjobs&amp;lt;/code&amp;gt; to see if the job is running.  When it is, follow the output thusly:&lt;br /&gt;
 $ tail -f /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/r0002/000/stdout/sNN.out&lt;br /&gt;
Note the presence of the &amp;lt;code&amp;gt;000&amp;lt;/code&amp;gt; directory.  &#039;&#039;cxi.lsf&#039;&#039; places the output of each job in a separate &amp;lt;i&amp;gt;trial&amp;lt;/i&amp;gt; directory, and prints this directory just before exiting.  By default, trial numbers start at zero and increase by one with each subsequent analysis of the same run.  To use any other, previously unused, trial number,  use &#039;&#039;cxi.lsf&#039;&#039;&#039;s &amp;lt;code&amp;gt;-t&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
When the average has been completed, the output can be inspected using the &#039;&#039;cctbx&#039;&#039; image viewer:&lt;br /&gt;
 $ cctbx.image_viewer /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/r0002/000/out/Ds1-r0002-*.pickle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Averaging an experimental light run ==&lt;br /&gt;
&lt;br /&gt;
Once the dark average is completed, experimental, lighted, runs can be averaged to see the extent of diffraction and potential pathologies in the run.  Copy the &amp;lt;code&amp;gt;average.cfg&amp;lt;/code&amp;gt; file from the tutorials directory to your pyana directory:&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ cp /reg/g/cctbx/tutorials/preprocessing/average.cfg .&lt;br /&gt;
&lt;br /&gt;
The configuration file will look like this:&lt;br /&gt;
 [pyana]&lt;br /&gt;
 modules = my_ana_pkg.mod_average&lt;br /&gt;
 num-cpu = 8&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_average]&lt;br /&gt;
 calib_dir      = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
 dark_path      = /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/r0002/000/out/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;name of dark average&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;.pickle&lt;br /&gt;
 dark_stddev    = /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/r0002/000/out/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;name of dark stddev&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;.pickle&lt;br /&gt;
 avg_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/averages&lt;br /&gt;
 stddev_dirname = /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/averages&lt;br /&gt;
 max_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/averages&lt;br /&gt;
 detz_offset    = 581&lt;br /&gt;
 address         = CxiDs1-0|Cspad-0&lt;br /&gt;
 avg_basename    = Ds1-r0003-avg&lt;br /&gt;
 stddev_basename = Ds1-r0003-stddev&lt;br /&gt;
 max_basename    = Ds1-r0003-max&lt;br /&gt;
The only difference is the addition of two parameters:&lt;br /&gt;
;dark_path&lt;br /&gt;
: path to the average dark image created before&lt;br /&gt;
;dark_stddev&lt;br /&gt;
: path to the standard deviation dark image created before&lt;br /&gt;
&lt;br /&gt;
The job is ran as before using &#039;&#039;cxi.lsf&#039;&#039;, again remembering to change all instances of &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; to your own SLAC user name.  Here you must also change &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;name of dark average&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;name of dark stddev&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; to the names of the average and standard deviation images created in the previous step.  The result of the run will be three new images that can be viewed with &#039;&#039;cctbx.image_viewer&#039;&#039; in the same manner as the darks were.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Information contained in the light average ==&lt;br /&gt;
&lt;br /&gt;
Firstly, the light and dark images can be used to mask of any bad pixels.  Inactive and non-bonded pixels, as well as hypersensitive pixels and any beam stop (if used) should be masked out.  The light images (maximum in particular) also serve as a virtual, dark-subtracted, powder pattern that can used to inspect the data for diffraction.  The light maximum should also flag up obvious errors in metrology, because rings will be non-continuous if the quadrants are misaligned. Intensity values from the corners of the light average or maximum are also useful to estimate background when taking first guesses at thresholds for hit-finding and integration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a mask image ==&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; uses three images to create a mask.  Those images, and the purposes of them are listed below:&lt;br /&gt;
* Average image from a dark run: pixels ≤ 0 are considered dead, pixels &amp;gt; 2000 are too sensitive&lt;br /&gt;
* Standard deviation from a dark run: pixels ≤ 0 are considered dead, pixels ≥ 10 are too uncertain&lt;br /&gt;
* Maximum projection from a lighted run (&#039;&#039;i.e.&#039;&#039; an experimental run): pixels &amp;lt; 300 are considered non-bonded or in a shadow.  [N.B.–this assumes a lot–300 may be appropriate for XPP data collected at atmosphere; not CXI data &amp;lt;i&amp;gt;in vacuo&amp;lt;/i&amp;gt;–NKS.] The presence of diffracting data is not needed, but also will not interfere.&lt;br /&gt;
&lt;br /&gt;
To create the mask, execute these commands:&lt;br /&gt;
 $ cd /reg/g/cctbx/tutorials/scratch/&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;username&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/&lt;br /&gt;
 $ mkdir masks&lt;br /&gt;
 $ cd masks&lt;br /&gt;
 $ cxi.make_mask -m 10 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;name of dark average&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;.pickle &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;name of dark standard deviation&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;.pickle \&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;name of light maximum projection&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;.pickle&lt;br /&gt;
&lt;br /&gt;
A new image is created where each pixel has one of two values: -2 (masked out pixels), and 0 (good pixels).  Note, the maximum projection minimum pixel value is overridden here to a value that is more sensible for the tutorial&#039;s lysozyme data.  You will likely need to adjust this parameter based on your data (see below for details and for further overrides).  &lt;br /&gt;
&lt;br /&gt;
Use the resultant mask image during processing with &#039;&#039;cctbx.xfel&#039;&#039; by adding this flag to your pyana config file:&lt;br /&gt;
 mask_path = &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;path to mask file&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition, a polygon and a circle can be specified using the &amp;lt;code&amp;gt;--poly_mask&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--circle_mask&amp;lt;/code&amp;gt; parameters:&lt;br /&gt;
 $ cxi.make_mask --poly_mask=17,854,76,967,760,982,762,879 --circle_mask=855,939,103 Cspad-avg.pickle Cspad-stddev.pickle Cspad-max.pickle&lt;br /&gt;
This example creates a mask image with a polygon [with vertices (17,854), (76,967), (760,982), and (762,879)] masked out, and a circle with center (855,939) and radius 103 masked out. Only one polygon and circle can be specified at the moment.&lt;br /&gt;
&lt;br /&gt;
The mask can be examined with &#039;&#039;cctbx.image_viewer&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
Some additional options are available for specifying the details of the masking operation:&lt;br /&gt;
;-a,  --avg_max (default 2000)&lt;br /&gt;
: specifies the maximum value in ADU a pixel in the average image can have before it&#039;s masked out.  The minimum is always zero.&lt;br /&gt;
;-s, --stddev_max (default 10)&lt;br /&gt;
: specifies the maximum value in ADU a pixel in the standard deviation image can have before it&#039;s masked out.  The minimum is always zero.&lt;br /&gt;
;-m, --maxproj_min (default 300)&lt;br /&gt;
: specifies the minimum value in ADU a pixel in the maximum projection image can have before it&#039;s masked out.  Of the three parameters for controlling cutoffs in &#039;&#039;cxi.make_mask&#039;&#039;, the -m option is unique from the -a and -s options in that it will likely vary the according to your sample&#039;s background.  Carefully examine the corners of your lighted maximum projection and choose a value lower than the ADU values displayed.  Also note that there is no cutoff on the high end of the maximum projection image specified in the mask, as that is defined as the saturation value for the detector.&lt;br /&gt;
;-x, --mask_pix_val (default -2)&lt;br /&gt;
: specifies the value to use when masking out a pixel. In other words, bad pixels in images in the XTC stream will be replaced with this value.&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Preparatory_steps_pyana_version&amp;diff=162</id>
		<title>Preparatory steps pyana version</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Preparatory_steps_pyana_version&amp;diff=162"/>
		<updated>2014-03-14T18:11:33Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Changed CS-PAD to CSPAD for consistency.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The CSPAD detector at LCLS is sensitive to temperature distortions and is not automatically dark-subtracted, unlike images from a synchrotron source.  Because of this it is necessary to periodically collect a dark run with the shutters closed during an LCLS experiment.  The dark run should contain on the order of at least 1000 images.  Before an experimental run can be processed, this dark run must be averaged so that subsequent experimental data can have the dark subtracted from each image.  Further, events during collection can necessitate a new dark, such as ice in the beam oversaturating creating dead pixels or a change in temperature.&lt;br /&gt;
&lt;br /&gt;
In addition, averaging a lighted run in general is a useful tool for examining diffraction throughout a data collection run.&lt;br /&gt;
&lt;br /&gt;
Finally, inactive and non-bonded pixels, as well as hypersensitive pixels and any beam stop (if used) should be masked out.  This tutorial covers averaging dark and light runs, and creating mask images.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your scratch area ==&lt;br /&gt;
&lt;br /&gt;
Create a scratch folder and populate it with some directories that will be used during this tutorial, changing &amp;lt;username&amp;gt; to your SLAC account name:&lt;br /&gt;
&lt;br /&gt;
 $ cd /reg/g/cctbx/tutorials/scratch/&lt;br /&gt;
 $ mkdir &amp;lt;username&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;username&amp;gt;&lt;br /&gt;
 $ mkdir darks&lt;br /&gt;
 $ mkdir averages&lt;br /&gt;
 $ mkdir results&lt;br /&gt;
&lt;br /&gt;
Or you may use a directory in your home folder.&lt;br /&gt;
&lt;br /&gt;
== Create a dark average ==&lt;br /&gt;
&lt;br /&gt;
To create the average, start by copying the dark.cfg file to your pyana directory:&lt;br /&gt;
&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cp /reg/g/cctbx/tutorials/preprocessing/dark.cfg .&lt;br /&gt;
 &lt;br /&gt;
Open dark.cfg.  It will look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is not true: can submit averaging job using cxi.lsf&#039;s -s option.  Maybe fix that once there&#039;s a separate page documenting cxi.lsf. --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# -*- Mode: Conf -*-&lt;br /&gt;
#&lt;br /&gt;
# Since mod_average must be run on a single host, it cannot be&lt;br /&gt;
# submitted using cxi.lsf.&lt;br /&gt;
#&lt;br /&gt;
# bsub -n 6 -J r0002 -o /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/dark_r0002.out -q psanacsq -R &amp;quot;span[hosts=1]&amp;quot; \&lt;br /&gt;
#   &amp;quot;cxi.pyana -c ~/myrelease/dark.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0002-s0*.xtc&amp;quot;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
[pyana]&lt;br /&gt;
modules = my_ana_pkg.mod_average&lt;br /&gt;
num-cpu = 8&lt;br /&gt;
&lt;br /&gt;
[my_ana_pkg.mod_average]&lt;br /&gt;
calib_dir      = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
avg_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks&lt;br /&gt;
stddev_dirname = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks&lt;br /&gt;
max_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks&lt;br /&gt;
detz_offset    = 581&lt;br /&gt;
address         = CxiDs1-0|Cspad-0&lt;br /&gt;
avg_basename    = Ds1-r0002-avg&lt;br /&gt;
stddev_basename = Ds1-r0002-stddev&lt;br /&gt;
max_basename    = Ds1-r0002-max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The config file is broken into three sections, the header, the pyana section and the modules section.&lt;br /&gt;
&lt;br /&gt;
=== Header Section ===&lt;br /&gt;
The comments at the top of the file include a bsub command.  This is the command to be entered from the ~/myrelease directory to queue the job for processing.  Bsub will submit the job, asking for 6 CPUs (-n), naming the job r0002 (-J), placing a log file in the -o location, and so forth.  There are several queues available for use, the psanacsq is just one of them.  The -R option restricts the job to running on a single host, which is required for averaging.  Finally, the cxi.pyana command in quotes is the command that will actually be executed on the host computer, and specifies the config file and the streams to use.  Note the asterisk, which allows averaging all the streams from a single run at one time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Before executing the command, replace &amp;lt;username&amp;gt; in the command and in the config file with your user name.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Pyana Section ===&lt;br /&gt;
Pyana operates by having a root section in the config file which specifies which modules to run.  In this case we are running &#039;&#039;cctbx.xfel&#039;s&#039;&#039; mod_average module.  If we were running multiple modules, we could chain them together here, and each module would be executed in sequence using the parameters specified below.  We also request a number of cpus to parallelize the job with.  Even though averaging must be done on a single host, on that host the processing can be split up among multiple cores.  Note, other aspects of &#039;&#039;cctbx.xfel&#039;&#039;, such as indexing and integration, do not have this restriction.&lt;br /&gt;
&lt;br /&gt;
=== Module Section ===&lt;br /&gt;
The final section specifies parameters specific to averaging:&lt;br /&gt;
* calib_dir: this directory is provided by LCLS and includes the layout information of the 64 tiles of the CSPAD detector&lt;br /&gt;
* avg_dirname: directory to place the average image&lt;br /&gt;
* stddev_dirname: directory to place the standard deviation image&lt;br /&gt;
* max_dirname: directory to place the maximum projection image&lt;br /&gt;
* detz_offset: experiment-specific number used to calculate the detector distance.  This is the distance in millimeters between the sample interaction region and the far end of the detector stage.  The XTC stream contains the distance from the detector stage to the detector.  These two numbers are subtracted to calculate the distance between sample interaction region and the detector.  We determine this number experimentally using a grid search, testing a range of potential detz_offsets and choosing the one that shows the greatest success at indexing images&lt;br /&gt;
* address: the name of the detector in the XTC stream&lt;br /&gt;
* avg_basename: this name is prepended to a datestamp to name the average image&lt;br /&gt;
* stddev_basename: this name is prepended to a datestamp to name the standard deviation image&lt;br /&gt;
* max_basename: this name is prepended to a datestamp to name the maximum projection image image&lt;br /&gt;
&lt;br /&gt;
=== Running and testing the command ===&lt;br /&gt;
Submit the job as specified above, using the bsub command in the header:&lt;br /&gt;
 $ bsub -n 6 -J r0002 -o /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/dark_r0002.out -q psanacsq -R &amp;quot;span[hosts=1]&amp;quot;&lt;br /&gt;
      &amp;quot;cxi.pyana -c ~/myrelease/dark.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0002-s0*.xtc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Type bjobs to see if the job is running.  When it is, follow the output thusly:&lt;br /&gt;
 $ tail -f /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/dark_r0002.out&lt;br /&gt;
&lt;br /&gt;
When the average has been completed, the output can be inspected using the &amp;quot;cctbx&amp;quot; image viewer:&lt;br /&gt;
 $ cctbx.image_viewer /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks/Ds1-r0002-*.pickle&lt;br /&gt;
&lt;br /&gt;
== Averaging an experimental light run ==&lt;br /&gt;
&lt;br /&gt;
Once the dark run is made, experimental runs can be averaged to see the extent of diffraction and potential pathologies in the run. Copy the average.cfg file from the tutorials directory to your pyana directory:&lt;br /&gt;
&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ cp /reg/g/cctbx/tutorials/preprocessing/average.cfg .&lt;br /&gt;
&lt;br /&gt;
The cfg will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# -*- Mode: Conf -*-&lt;br /&gt;
#&lt;br /&gt;
# Since mod_average must be run on a single host, it cannot be&lt;br /&gt;
# submitted using cxi.lsf.&lt;br /&gt;
#&lt;br /&gt;
# bsub -n 6 -J r0003 -o /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/average_r0003.out -q psanacsq -R &amp;quot;span[hosts=1]&amp;quot; \&lt;br /&gt;
#   &amp;quot;cxi.pyana -c average.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0003-s0*.xtc&amp;quot;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
[pyana]&lt;br /&gt;
modules = my_ana_pkg.mod_average&lt;br /&gt;
num-cpu = 8&lt;br /&gt;
&lt;br /&gt;
[my_ana_pkg.mod_average]&lt;br /&gt;
calib_dir      = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
dark_path      = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks/&amp;lt;name of dark average&amp;gt;.pickle&lt;br /&gt;
dark_stddev    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks/&amp;lt;name of dark stddev&amp;gt;.pickle&lt;br /&gt;
avg_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/averages&lt;br /&gt;
stddev_dirname = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/averages&lt;br /&gt;
max_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/averages&lt;br /&gt;
detz_offset    = 581&lt;br /&gt;
address         = CxiDs1-0|Cspad-0&lt;br /&gt;
avg_basename    = Ds1-r0003-avg&lt;br /&gt;
stddev_basename = Ds1-r0003-stddev&lt;br /&gt;
max_basename    = Ds1-r0003-max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only difference is the addition of two parameters:&lt;br /&gt;
* dark_path: path to the average dark image created before&lt;br /&gt;
* dark_stddev: path to the standard deviation dark image created before&lt;br /&gt;
&lt;br /&gt;
The job is ran as before using the bsub command in the header, again remembering to change all instances of &amp;lt;username&amp;gt; to your own SLAC user name.  Here you must also change &amp;lt;name of dark average&amp;gt; and &amp;lt;name of dark stddev&amp;gt; to the names of the average and standard deviation images created in the previous step.  The result of the run will be three new images that can be viewed with cctbx.image_viewer in the same manner as the darks were.&lt;br /&gt;
&lt;br /&gt;
== Information contained in the light average ==&lt;br /&gt;
&lt;br /&gt;
Firstly, the light and dark images can be used to mask of any bad pixels, as detailed below. The light images (maximum in particular) also serve as a virtual, dark-subtracted, powder pattern that can used to inspect the data for diffraction. The light maximum should also flag up obvious errors in metrology, because rings will be non-continuous if the quadrants are misaligned. Intensity values from the corners of the light average or maximum are also useful to estimate background when taking first guesses at thresholds for hit-finding and integration.&lt;br /&gt;
&lt;br /&gt;
== Creating a mask image ==&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; uses three images to create a mask.  Those images, and the purposes of them are listed below:&lt;br /&gt;
* Average image from a dark run: pixels ≤ 0 are considered dead, pixels &amp;gt; 2000 are too sensitive&lt;br /&gt;
* Standard deviation from a dark run: pixels ≤ 0 are considered dead, pixels ≥ 10 are too uncertain&lt;br /&gt;
* Maximum projection from a lighted run (&#039;&#039;i.e.&#039;&#039; an experimental run): pixels &amp;lt; 300 are considered non-bonded or in a shadow.  [N.B.--this assumes a lot--300 may be appropriate for XPP data collected at atmosphere; not CXI data in vacuo--NKS.] The presence of diffracting data is not needed, but also will not interfere.&lt;br /&gt;
&lt;br /&gt;
To create the mask, execute these commands:&lt;br /&gt;
 $ cd /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/&lt;br /&gt;
 $ mkdir masks&lt;br /&gt;
 $ cd masks&lt;br /&gt;
 $ cxi.make_mask -m 10 ../darks/&amp;lt;name of dark average&amp;gt;.pickle ../darks/&amp;lt;name of dark standard deviation&amp;gt;.pickle&lt;br /&gt;
     ../averages/&amp;lt;name of light maximum projection&amp;gt;.pickle&lt;br /&gt;
&lt;br /&gt;
A new image is created where each pixel has one of two values: -2 (masked out pixels), and 0 (good pixels).  Note, the maximum projection minimum pixel value is overridden here to a value that is more sensible for the tutorial&#039;s lysozyme data.  You will likely need to adjust this parameter based on your data (see below for details and for further overrides).  &lt;br /&gt;
&lt;br /&gt;
Use the resultant mask image during processing with &#039;&#039;cctbx.xfel&#039;&#039; by adding this flag to your pyana config file:&lt;br /&gt;
&lt;br /&gt;
 mask_path   = &amp;lt;path to mask file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, a polygon and a circle can be specified using the --poly_mask and --circle_mask parameters:&lt;br /&gt;
&lt;br /&gt;
 $ cxi.make_mask --poly_mask=17,854,76,967,760,982,762,879 --circle_mask=855,939,103 Cspad-avg.pickle Cspad-stddev.pickle Cspad-max.pickle&lt;br /&gt;
&lt;br /&gt;
This example creates a mask image with a polygon [with vertices (17,854), (76,967), (760,982), and (762,879)] masked out, and a circle with center (855,939) and radius 103 masked out. Only one polygon and circle can be specified at the moment.&lt;br /&gt;
&lt;br /&gt;
The mask can be examined with cctbx.image_viewer.&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
Some additional options are available for specifying the details of the masking operation:&lt;br /&gt;
;-a,  --avg_max (default 2000)&lt;br /&gt;
: specifies the maximum value in ADU a pixel in the average image can have before it&#039;s masked out.  The minimum is always zero.&lt;br /&gt;
;-s, --stddev_max (default 10)&lt;br /&gt;
: specifies the maximum value in ADU a pixel in the standard deviation image can have before it&#039;s masked out.  The minimum is always zero.&lt;br /&gt;
;-m, --maxproj_min (default 300)&lt;br /&gt;
: specifies the minimum value in ADU a pixel in the maximum projection image can have before it&#039;s masked out.  Of the three parameters for controlling cutoffs in &#039;&#039;cxi.make_mask&#039;&#039;, the -m option is unique from the -a and -s options in that it will likely vary the according to your sample&#039;s background.  Carefully examine the corners of your lighted maximum projection and choose a value lower than the ADU values displayed.  Also note that there is no cutoff on the high end of the maximum projection image specified in the mask, as that is defined as the saturation value for the detector.&lt;br /&gt;
;-x, --mask_pix_val (default -2)&lt;br /&gt;
: specifies the value to use when masking out a pixel. In other words, bad pixels in images in the XTC stream will be replaced with this value.&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Metrology_refinement&amp;diff=268</id>
		<title>Metrology refinement</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Metrology_refinement&amp;diff=268"/>
		<updated>2014-03-14T18:10:58Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Changed CS-PAD to CSPAD for consistency.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Indexing requires highly precise knowledge of pixel positions in laboratory space.  Due to the physics of the CSPAD detector and the brevity of the incident XFEL pulses, a parallelized integrating detector was necessary to build to be able to operate at the framing rates available at the LCLS.  64 asics are arranged in a tetragonal pattern, 2 asics per sensor, 8 sensors per quadrant and 4 quadrants per detector.  The placement of these tiles in physical space is measured by the beamline operators optically using electron microscopy.  The four quadrants are movable at CXI, necessitating pixel-level adjustments to individual quadrants.  &#039;&#039;cctbx.xfel&#039;&#039; then refines tile positions to whole pixel, and then sub-pixel precision by calculating spot positions on a highly diffracting dataset and refining tile locations versus actual spot positions for each tile.  This creates four levels of metrology information and corrections.  These levels and the method of measuring and refining them are detailed below.&lt;br /&gt;
&lt;br /&gt;
Of the operations of &#039;&#039;cctbx.xfel&#039;&#039;, calculating and refining metrology is the operation most suited to beam line staff and the authors of the software.  Please don&#039;t hesitate to ask for assistance regarding any aspect of this procedure.&lt;br /&gt;
&lt;br /&gt;
=== Optical Metrology ===&lt;br /&gt;
&lt;br /&gt;
LCLS provides initial tile placements.  Periodically the detector is disassembled and re-built, necessitating new calibration information.  The optical measurements are included in the &#039;&#039;cctbx.xfel&#039;&#039; in the source code and are reference by your &#039;&#039;pyana&#039;&#039; config file.  See [preparatory steps] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Quadrant positioning ===&lt;br /&gt;
&lt;br /&gt;
The CXI CSPAD detectors have quadrants on rails to allow re-sizing of the central hole.  The second-level of metrology corrections consists of unit pixel corrections to entire quadrants using the cxi.view quadrant calibration tool.  First, create a virtual powder pattern using averaging (see [preparatory steps]).  Usually the standard deviation or maximum projection will show virtual powder ring.  An image with strong rings to moderate resolution is desired.  Once obtained, start the calibration tool with this command:&lt;br /&gt;
&lt;br /&gt;
 cxi.view &amp;lt;virtual powder pattern image path&amp;gt; viewer.calibrate_silver=true distl.detector_format_version=&amp;quot;CXI 7.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note, the flag distl.detector_format_version is a legacy requirement that will be phased out.&lt;br /&gt;
&lt;br /&gt;
Once loaded, you will see your image and many red rings, incidentally corresponding to the diffraction pattern of silver behenate.  Additionally, a separate settings panel will be present with 8 input boxes corresponding to the x and y offsets of each of the four quadrants, UL, UR, LL, and LR (upper and lower, left and right).  Manually adjust the offsets until the powder rings are circular through the whole image, using the red rings as guides.  These corrections will but put into your phil parameters file in the distl quad_translations entry in this form:&lt;br /&gt;
&lt;br /&gt;
 distl {&lt;br /&gt;
   quad_translations =  2 -6  3 -6 -7  0 -1 -4&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Where the numbers are listed in this order: ULX ULY, URX URY, LLX LLY, LRX, LRY&lt;br /&gt;
&lt;br /&gt;
=== Unit pixel metrology corrections ===&lt;br /&gt;
&lt;br /&gt;
=== Sub-pixel metrology corrections ===&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Processing_L498_thermolysin&amp;diff=425</id>
		<title>Processing L498 thermolysin</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Processing_L498_thermolysin&amp;diff=425"/>
		<updated>2014-03-14T18:09:00Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Cleanups, spell checks, etc.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains instructions for reproducing the results reported in the 2014 &#039;&#039;cctbx.xfel&#039;&#039; paper&amp;lt;ref name=&amp;quot;Hattne:2014&amp;quot;&amp;gt;[http://dx.doi.org/10.1038/nmeth.2887 Hattne, J &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt; Accurate macromolecular structures using minimal measurements from X-ray free-electron lasers. &amp;lt;i&amp;gt;Nat. Methods&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;In press&amp;lt;/b&amp;gt; (2014).]&amp;lt;/ref&amp;gt;.  The data are available from the [http://cxidb.org Coherent X-ray Imaging Data Bank] ([http://cxidb.org/id-23 CXIDB ID 23]; [http://cxidb.org/id-23-raw.html raw XTC files], 4.0 TiB), and must be downloaded to a local disk prior to starting the analysis.  Furthermore, the [https://confluence.slac.stanford.edu/display/PSDM/Software+Distribution PSDM Software Distribution] must be [[Set up PSDM software | set up]], along with a test release and an empty analysis package.  A [http://www.mysql.com MySQL] database is required to merge the integrated diffraction intensities.  In the interest of keeping this guide as general as possible, no particular queuing system is assumed to be available. Processing time depends strongly on the computational resources available; using 48 processors on a 64-core 1.4 GHz Opteron-based computer, the analysis takes around 24 hours.  The instructions assume some familiarity with &#039;&#039;cctbx.xfel&#039;&#039; and its installation and configuration procedure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing a &#039;&#039;cctbx.xfel&#039;&#039; snapshot from March 28, 2013 ==&lt;br /&gt;
&lt;br /&gt;
The thermolysin data for the &#039;&#039;cctbx.xfel&#039;&#039; paper was processed around March 28, 2013.  Unfortunately,  regular nightly releases are not available for that time, but a custom source-code bundle has been prepared.  This bundle differs from the regular &#039;&#039;cctbx&#039;&#039; bundles in that [http://adder.lbl.gov/labelit &#039;&#039;LABELIT&#039;&#039;] is included, and that the directory layout is identical to that of a developer installation.  To download and unpack the bundle in the current directory:&lt;br /&gt;
 $ wget http://adder.lbl.gov/cctbx.xfel/downloads/cctbx.xfel-20130328.tar.gz&lt;br /&gt;
 $ tar -xpvzf cctbx.xfel-20130328.tar.gz&lt;br /&gt;
Next, create a build directory (called &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;phenix-build-20130328&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; below, but that is an arbitrary choice), in which the sources are configured and compiled.  The Python interpreter required to complete this step &amp;lt;em&amp;gt;must&amp;lt;/em&amp;gt; be the one supplied by the PSDM Software Distribution.  Once the PSDM software has been [[Set up PSDM software | set up]], this interpreter can be located using&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot;&lt;br /&gt;
To prepare the build directory using this interpreter&lt;br /&gt;
 $ mkdir &amp;lt;i&amp;gt;phenix-build-20130328&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;phenix-build-20130328&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; ../phenix-src-20130328/cctbx_project/libtbx/configure.py cxi_xdr_xes xfel&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; is the path to the Python interpreter located using the previous find-command.  Note that csh-users should run &amp;lt;code&amp;gt;source setpaths.csh&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;. setpaths.sh&amp;lt;/code&amp;gt;.  Then compile the sources:&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command may need to be run twice in order to complete the build.  Once &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; does not produce any output from the compiler, the build is complete.&lt;br /&gt;
&lt;br /&gt;
To make the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules available to PSDM&#039;s &#039;&#039;pyana&#039;&#039;,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ ln -fns &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/phenix-src-20130328/cctbx_project/xfel/cxi/cspad_ana src&lt;br /&gt;
 $ cd ..&lt;br /&gt;
 $ scons&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; are the path to the test release and the name of the analysis package chosen while [[Set up PSDM software | setting up the PSDM software distribution]], respectively.  &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; denotes the path to the directory containing the unpacked &#039;&#039;cctbx.xfel&#039;&#039; sources.  The last step compiles the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a dark image ==&lt;br /&gt;
&lt;br /&gt;
To meaningfully process the thermolysin diffraction data, an average of all the images in a &amp;lt;i&amp;gt;dark run&amp;lt;/i&amp;gt;—a run without any X-rays impinging on the detector—must be subtracted from the individual diffraction images.  The configuration file below can be used to produce such an average, as well as an image of the standard deviation of all the pixels over the course of the run. &lt;br /&gt;
 [pyana]&lt;br /&gt;
 modules = my_ana_pkg.mod_average&lt;br /&gt;
 num-cpu = &amp;lt;i&amp;gt;4&amp;lt;/i&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_average]&lt;br /&gt;
 address         = CxiDs1-0|Cspad-0&lt;br /&gt;
 calib_dir       = &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/phenix-src-20130328/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
 avg_basename    = &amp;lt;i&amp;gt;Ds1-avg&amp;lt;/i&amp;gt;&lt;br /&gt;
 avg_dirname     = &amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&lt;br /&gt;
 stddev_basename = &amp;lt;i&amp;gt;Ds1-stddev&amp;lt;/i&amp;gt;&lt;br /&gt;
 stddev_dirname  = &amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; refers to the directory containing the unpacked &#039;&#039;cctbx.xfel&#039;&#039; sources.  All other options with values set in italics can be modified without adversely affecting averaging.  The above file will use four simultaneous processes, and write the average and standard deviation images to files whose names start with &amp;lt;code&amp;gt;Ds1-avg&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Ds1-stddev&amp;lt;/code&amp;gt;, respectively, both in a directory called  &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The data deposited at the [http://cxidb.org/id-23 CXIDB] contains a dark run, &amp;lt;code&amp;gt;r0031&amp;lt;/code&amp;gt;.  To average the images in that run, save the above configuration file to disk, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;L498-dark.cfg&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;, apply modifications as necessary, and execute&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-dark.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0031-*.xtc&lt;br /&gt;
where &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; is the path to the directory containing the raw XTC files downloaded from [http://cxidb.org/id-23 CXIDB].  The files written to the &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; directory will have a current date stamp appended, which can safely be removed to simplify subsequent configuration files.&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ mv &amp;lt;i&amp;gt;Ds1-avg20140308104336073.pickle&amp;lt;/i&amp;gt; Ds1-avg.pickle&lt;br /&gt;
 $ mv &amp;lt;i&amp;gt;Ds1-stddev20140308104336371.pickle&amp;lt;/i&amp;gt; Ds1-stddev.pickle&lt;br /&gt;
 $ cd ..&lt;br /&gt;
Note that the date stamp on the generated files above depends on the time of their creation.  Further details are available on the [[Preparatory steps#Create a dark average|Create a dark image]] page of the [[Tutorials|tutorials]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Indexing the thermolysin data ==&lt;br /&gt;
&lt;br /&gt;
A configuration file for processing the primary lattices in the thermolysin data is shown below.&lt;br /&gt;
 [pyana]&lt;br /&gt;
 modules = my_ana_pkg.mod_hitfind:threshold \&lt;br /&gt;
           my_ana_pkg.mod_hitfind:index&lt;br /&gt;
 num-cpu = &amp;lt;i&amp;gt;48&amp;lt;/i&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_hitfind]&lt;br /&gt;
 address     = CxiDs1-0|Cspad-0&lt;br /&gt;
 calib_dir   = &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/phenix-src-20130328/cxi_xdr_xes/cftbx/metrology/CSPad/run4/CxiDs1.0:Cspad.0&lt;br /&gt;
 dark_path   = &amp;lt;i&amp;gt;r0031/Ds1-avg.pickle&amp;lt;/i&amp;gt;&lt;br /&gt;
 dark_stddev = &amp;lt;i&amp;gt;r0031/Ds1-stddev.pickle&amp;lt;/i&amp;gt;&lt;br /&gt;
 db_logging  = False&lt;br /&gt;
 detz_offset = 575&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_hitfind:threshold]&lt;br /&gt;
 dispatch        = nop&lt;br /&gt;
 distl_flags     = permissive&lt;br /&gt;
 distl_min_peaks = 16&lt;br /&gt;
 threshold       = 450&lt;br /&gt;
 xtal_target     = hitfind&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_hitfind:index]&lt;br /&gt;
 dispatch             = index&lt;br /&gt;
 integration_dirname  = &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt;&lt;br /&gt;
 integration_basename = int-&lt;br /&gt;
 xtal_target          = thermolysin27&lt;br /&gt;
The configuration file above instructs &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt; to use 48 processes.  It disables all image output, which reduces the amount of disk space required to perform the analysis to about 3.4 GiB.  &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; again refers to the directory containing the unpacked &#039;&#039;cctbx.xfel&#039;&#039; sources, and &amp;lt;code&amp;gt;dark_path&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;dark_stddev&amp;lt;/code&amp;gt; may have to be changed to reflect the location of the previously generated dark images.  Integration results will be written to the directory &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Due to particularities of the thermolysin measurement, processing needs to proceed in two batches.  To analyze the first batch, runs 16 through 27, save the above configuration file to disk, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;, apply modifications as necessary, and execute&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0016-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0017-*.xtc&lt;br /&gt;
 $ …&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0027-*.xtc&lt;br /&gt;
where &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; is the path to the directory containing the raw XTC files.  The second batch, runs 71 through 73, was recorded using a different distance between the interaction region and the detector.  Whilst the changes to the detector position are automatically handled by &#039;&#039;cctbx.xfel&#039;&#039;, the resulting difference in shadowing is not.  Different areas of the detector should be ignored at the different distances, and this is accounted for by the value of the &amp;lt;code&amp;gt;xtal_target&amp;lt;/code&amp;gt; option in the configuration file.  To analyze this set of runs, edit &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;, change &amp;lt;code&amp;gt;thermolysin27&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;thermolysin73&amp;lt;/code&amp;gt;, and&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0071-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0072-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0073-*.xtc&lt;br /&gt;
On successful completion, the number of files in the &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt; directory corresponds to the number of successfully integrated images.  Owing to variations in hardware and compiler internals, it may deviate slightly from 11,583, the number reported in the &#039;&#039;cctbx.xfel&#039;&#039; paper&amp;lt;ref name=&amp;quot;Hattne:2014&amp;quot;/&amp;gt;.  Further details are available on the [[Indexing and integration|indexing and integration]] page of the [[Tutorials|tutorials]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Indexing the secondary lattice ===&lt;br /&gt;
&lt;br /&gt;
Indexing the secondary lattice is very similar to indexing the primary lattice, but requires a change to the source code.  Edit &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/phenix-src-20130328/labelit_regression/xfel/xfel_targets.py&amp;lt;/code&amp;gt;, and uncomment (&amp;lt;i&amp;gt;i.e.&amp;lt;/i&amp;gt; remove the leading &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; character) &amp;lt;code&amp;gt;&amp;quot;outlier_detection_switch=True&amp;quot;&amp;lt;/code&amp;gt; on line 25.  Then edit the configuration file, &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; above, and change &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt; to &amp;lt;i&amp;gt;integration-second-lattice&amp;lt;/i&amp;gt; in order not to overwrite the results of the previous analysis of the primary lattice.  Before reanalyzing the first batch, ensure that &amp;lt;code&amp;gt;xtal_target&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;thermolysin27&amp;lt;/code&amp;gt;.&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0016-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0017-*.xtc&lt;br /&gt;
 $ …&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0027-*.xtc&lt;br /&gt;
Then set &amp;lt;code&amp;gt;xtal_target&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;thermolysin73&amp;lt;/code&amp;gt; in the configuration file, and process the second batch.&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0071-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0072-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0073-*.xtc&lt;br /&gt;
The number of integrated secondary lattices should be close to 2,021, the number reported in the &#039;&#039;cctbx.xfel&#039;&#039; paper&amp;lt;ref name=&amp;quot;Hattne:2014&amp;quot;/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Merging all integrated images ==&lt;br /&gt;
&lt;br /&gt;
The phil-file below defines values suitable for merging the primary and secondary lattices previously integrated.&lt;br /&gt;
 data                         = &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt;&lt;br /&gt;
 data                         = &amp;lt;i&amp;gt;integration-second-lattice&amp;lt;/i&amp;gt;&lt;br /&gt;
 d_min                        = 2.10&lt;br /&gt;
 merge_anomalous              = True&lt;br /&gt;
 min_corr                     = -1&lt;br /&gt;
 model                        = &amp;lt;i&amp;gt;2tli.pdb&amp;lt;/i&amp;gt;&lt;br /&gt;
 nproc                        = &amp;lt;i&amp;gt;16&amp;lt;/i&amp;gt;&lt;br /&gt;
 plot_single_index_histograms = False&lt;br /&gt;
 raw_data.sdfac_auto          = True&lt;br /&gt;
 rescale_with_average_cell    = True&lt;br /&gt;
 significance_filter.apply    = True&lt;br /&gt;
 set_average_unit_cell        = True&lt;br /&gt;
 mysql {&lt;br /&gt;
     database = &amp;lt;i&amp;gt;db_name&amp;lt;/i&amp;gt;&lt;br /&gt;
     passwd   = &amp;lt;i&amp;gt;db_passwd&amp;lt;/i&amp;gt;&lt;br /&gt;
     runtag   = &amp;lt;i&amp;gt;L498_thermolysin&amp;lt;/i&amp;gt;&lt;br /&gt;
     user     = &amp;lt;i&amp;gt;db_user&amp;lt;/i&amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
 output {&lt;br /&gt;
     n_bins = &amp;lt;i&amp;gt;10&amp;lt;/i&amp;gt;&lt;br /&gt;
     prefix = &amp;lt;i&amp;gt;L498_thermolysin&amp;lt;/i&amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
 scaling {&lt;br /&gt;
     algorithm  = mark0&lt;br /&gt;
     mtz_file   = &amp;lt;i&amp;gt;2tli.mtz&amp;lt;/i&amp;gt;&lt;br /&gt;
     show_plots = False&lt;br /&gt;
     log_cutoff = 0.0&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;integration-second-lattice&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; may need to be adjusted to point to the directories where the [[#Indexing and integration | indexing and integration step]] left its results.  &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;db_name&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;, &amp;lt;i&amp;gt;db_user&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;db_passwd&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; must be substituted with the database name and access credentials to a [http://www.mysql.com MySQL] database.  Databases on hosts other than the one used to merge the thermolysin data can be accessed by additionally specifying the &amp;lt;code&amp;gt;mysql.host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;mysql.port&amp;lt;/code&amp;gt; options.  The model and structure factors for the scaling reference, &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;scaling.mtz_file&amp;lt;/code&amp;gt; above, are both available for download from the [http://www.rcsb.org RCSB Protein Data Bank] ([http://www.rcsb.org/pdb/explore/explore.do?structureId=2tli PDB ID 2tli]).  If the [http://www.phenix-online.org &#039;&#039;PHENIX&#039;&#039;] suite is installed, these are conveniently obtained at the command line using&lt;br /&gt;
 $ phenix.fetch_pdb --mtz 2tli&lt;br /&gt;
&lt;br /&gt;
To merge the thermolysin data, save the suitably modified configuration file to &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; &amp;lt;code&amp;gt;L498-merge.phil&amp;lt;/code&amp;gt;, and run&lt;br /&gt;
 $ cxi.merge L498-merge.phil&lt;br /&gt;
 $ cxi.xmerge L498-merge.phil&lt;br /&gt;
Merging statistics are printed on standard output.  The merged MTZ-file is written to a file whose name is determined by the value of &amp;lt;code&amp;gt;output.prefix&amp;lt;/code&amp;gt; in the configuration file (with the values shown above, the output file would be &amp;lt;code&amp;gt;L498_thermolysin.mtz&amp;lt;/code&amp;gt;).  Note that the version of merging programs from 28 March, 2013 do &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; not report the &amp;lt;i&amp;gt;R&amp;lt;/i&amp;gt;&amp;lt;sub&amp;gt;split&amp;lt;/sub&amp;gt; statistic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Processing_L498_thermolysin&amp;diff=424</id>
		<title>Processing L498 thermolysin</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Processing_L498_thermolysin&amp;diff=424"/>
		<updated>2014-03-10T10:54:28Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Created instructions to reproduce L498 thermolysin processing results.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains instructions for reproducing the results reported in the 2014 &#039;&#039;cctbx.xfel&#039;&#039; paper&amp;lt;ref&amp;gt;[http://dx.doi.org/10.1038/nmeth.2887 Hattne, J &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt; Accurate macromolecular structures using minimal measurements from X-ray free-electron lasers. &amp;lt;i&amp;gt;Nat. Methods&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;In press&amp;lt;/b&amp;gt; (2014).]&amp;lt;/ref&amp;gt;.  The data are available from the [http://cxidb.org/id-23 Coherent X-ray Imaging Data Bank (CXIDB)] (raw XTC files, 4.0 TiB), and must be downloaded to a local disk prior to starting the analysis.  Furthermore, the PSDM Software Distribution must be [[Set up PSDM software | set up]], along with a test release and an empty analysis package.  A [http://www.mysql.com MySQL] database is required to merge the integrated diffraction images. Processing time depends strongly on the computational resources available; using 48 processors on a 64-core 1.4 GHz Opteron-based computer, the analysis takes around 24 hours.  The instructions assume some familiarity with &#039;&#039;cctbx.xfel&#039;&#039; and its installation and configuration procedure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing a &#039;&#039;cctbx.xfel&#039;&#039; snapshot from March 28, 2013 ==&lt;br /&gt;
&lt;br /&gt;
The thermolysin data for the &#039;&#039;cctbx.xfel&#039;&#039; paper was processed around March 28, 2013.  Unfortunately,  regular nightly releases are not available for that time, but a specially prepared source-code bundle has been made available.  This bundle differs from the regular &#039;&#039;cctbx&#039;&#039; bundles in that &#039;&#039;LABELIT&#039;&#039; is included, and that the directory layout is identical to that of a developer installation.  To download and unpack the bundle in the current directory:&lt;br /&gt;
 $ wget http://adder.lbl.gov/cctbx.xfel/downloads/cctbx.xfel-20130328.tar.gz&lt;br /&gt;
 $ tar -xpvzf cctbx.xfel-20130328.tar.gz&lt;br /&gt;
Next, create a build directory (called &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;phenix-build-20130328&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; below, but that is an arbitrary choice), in which the sources are configured and compiled.  The Python interpreter required to complete this step, &amp;lt;em&amp;gt;must&amp;lt;/em&amp;gt; be the one supplied by the PSDM Software Distribution.  Once the PSDM software has been [[Set up PSDM software | set up], this interpreter can be located using&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot;&lt;br /&gt;
To prepare the build directory using this interpreter&lt;br /&gt;
 $ mkdir &amp;lt;i&amp;gt;phenix-build-20130328&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;phenix-build-20130328&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; ../phenix-src-20130328/cctbx_project/libtbx/configure.py cxi_xdr_xes xfel&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; is the path to the Python interpreter located using the previous find-command.  Note that csh-users should run &amp;lt;code&amp;gt;source setpaths.csh&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;. setpaths.sh&amp;lt;/code&amp;gt;.  Then compile the sources&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command may need to be run twice in order to complete the build.  Once &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; does not produce any output from the compiler, the build is complete.&lt;br /&gt;
&lt;br /&gt;
To make the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules available to PSDM&#039;s &#039;&#039;pyana&#039;&#039;,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ ln -fns &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/phenix-src-20130328/cctbx_project/xfel/cxi/cspad_ana src&lt;br /&gt;
 $ cd ..&lt;br /&gt;
 $ scons&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; are the path to the test release and the name of the analysis package chosen while [[Set up PSDM software | setting up the PSDM software distribution]].  &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; denotes the path to the directory containing the unpacked &#039;&#039;cctbx.xfel&#039;&#039; sources.  The last step compiles the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a dark image ==&lt;br /&gt;
&lt;br /&gt;
To meaningfully process the thermolysin diffraction data, an average of all the images in a &amp;lt;i&amp;gt;dark run&amp;lt;/i&amp;gt;—a run without any X-rays impinging on the detector—must be subtracted from the individual diffraction images.  The configuration file below can be used to produce such an average, as well as an image of the standard deviation of all the pixels over the course of the run. &lt;br /&gt;
 # -*- mode: conf -*-&lt;br /&gt;
 &lt;br /&gt;
 [pyana]&lt;br /&gt;
 modules = my_ana_pkg.mod_average&lt;br /&gt;
 num-cpu = &amp;lt;i&amp;gt;4&amp;lt;/i&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_average]&lt;br /&gt;
 address         = CxiDs1-0|Cspad-0&lt;br /&gt;
 calib_dir       = &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/phenix-src-20130328/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
 avg_basename    = &amp;lt;i&amp;gt;Ds1-avg&amp;lt;/i&amp;gt;&lt;br /&gt;
 avg_dirname     = &amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&lt;br /&gt;
 stddev_basename = &amp;lt;i&amp;gt;Ds1-stddev&amp;lt;/i&amp;gt;&lt;br /&gt;
 stddev_dirname  = &amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; refers to the directory containing the unpacked &#039;&#039;cctbx.xfel&#039;&#039; sources.  All other options with values set in italics can be modified without adversely affecting averaging.  The above file will use four simultaneous processes, and write the average and standard deviation images to files whose names start with &amp;lt;code&amp;gt;Ds1-avg&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Ds1-stddev&amp;lt;/code&amp;gt;, respectively, both in a directory called  &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The data deposited at the CXIDB contains a dark run, &amp;lt;code&amp;gt;r0031&amp;lt;/code&amp;gt;.  To average the images in that run, save the above configuration file to disk, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;L498-dark.cfg&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;, apply modifications as necessary, and execute&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-dark.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0031-*.xtc&lt;br /&gt;
where &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; is the path to the directory containing the raw XTC files dowloaded from [http://cxidb.org/id-23 CXIDB].  The files written to the &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; directory will have a current datestamp appended, which can safely be removed to simplify subsequent configuration files.&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;r0031&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ mv Ds1-avg20140308104336073.pickle Ds1-avg.pickle&lt;br /&gt;
 $ mv Ds1-stddev20140308104336371.pickle Ds1-stddev.pickle&lt;br /&gt;
 $ cd ..&lt;br /&gt;
Further details are available on the [[Preparatory steps#Create a dark average|Create a dark image]] page of the [[Tutorials|tutorials]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Index the thermolysin data ==&lt;br /&gt;
&lt;br /&gt;
A configuration file for processing the primary lattices in the thermolysin data is shown below.&lt;br /&gt;
 # -*- mode: conf -*-&lt;br /&gt;
 &lt;br /&gt;
 [pyana]&lt;br /&gt;
 modules = my_ana_pkg.mod_hitfind:threshold \&lt;br /&gt;
           my_ana_pkg.mod_hitfind:index&lt;br /&gt;
 num-cpu = &amp;lt;i&amp;gt;48&amp;lt;/i&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_hitfind]&lt;br /&gt;
 address     = CxiDs1-0|Cspad-0&lt;br /&gt;
 calib_dir   = &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/phenix-src-20130328/cxi_xdr_xes/cftbx/metrology/CSPad/run4/CxiDs1.0:Cspad.0&lt;br /&gt;
 dark_path   = &amp;lt;i&amp;gt;r0031/Ds1-avg.pickle&amp;lt;/i&amp;gt;&lt;br /&gt;
 dark_stddev = &amp;lt;i&amp;gt;r0031/Ds1-stddev.pickle&amp;lt;/i&amp;gt;&lt;br /&gt;
 db_logging  = False&lt;br /&gt;
 detz_offset = 575&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_hitfind:threshold]&lt;br /&gt;
 dispatch        = nop&lt;br /&gt;
 distl_flags     = permissive&lt;br /&gt;
 distl_min_peaks = 16&lt;br /&gt;
 threshold       = 450&lt;br /&gt;
 xtal_target     = hitfind&lt;br /&gt;
 &lt;br /&gt;
 [my_ana_pkg.mod_hitfind:index]&lt;br /&gt;
 dispatch             = index&lt;br /&gt;
 integration_dirname  = &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt;&lt;br /&gt;
 integration_basename = int-&lt;br /&gt;
 xtal_target          = thermolysin27&lt;br /&gt;
The configuration file above instructs &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt; to use 48 processes.  It disables all image output, which reduces the amout of disk space required to perform the analysis to about 3.4 GiB.  &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; again refers to the directory containing the unpacked &#039;&#039;cctbx.xfel&#039;&#039; sources, and &amp;lt;code&amp;gt;dark_path&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;dark_stddev&amp;lt;/code&amp;gt; may have to be changed to reflect the location of the previously generated dark images.  Integration results will be written to the directory &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Due to particularities of the thermolysin measurement, processing proceeds in two batches.  To analyse the first batch, runs 16 through 27, save the above configuration file to disk, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;, apply modifications as necessary, and execute&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0016-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0017-*.xtc&lt;br /&gt;
 $ …&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0027-*.xtc&lt;br /&gt;
where &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; is the path to the directory containing the raw XTC files.  The second batch, runs 71 through 73, was recorded using a different distance between the interaction region and the detector.  This necessitates different areas of the detector to be ignored due to different shadowing, and this is accounted for by a different value of the &amp;lt;code&amp;gt;xtal_target&amp;lt;/code&amp;gt; option in the configuration file.  To analyse this set of runs, edit &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;, change &amp;lt;code&amp;gt;thermolysin27&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;thermolysin73&amp;lt;/code&amp;gt;, and&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0071-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0072-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0073-*.xtc&lt;br /&gt;
On successful completion, the number of files in the &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt; directory corresponds to the number of successfully integrated images.  Owing to variations in hardware and compiler internals, it may deviate slightly from 11,583, the number reported in the &#039;&#039;cctbx.xfel&#039;&#039; paper. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Index the secondary lattice ===&lt;br /&gt;
&lt;br /&gt;
Indexing the secondary lattice is very similar to indexing the primary lattice, but requires a change to the source code.  Edit &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/phenix-src-20130328/labelit_regression/xfel/xfel_targets.py&amp;lt;/code&amp;gt;, and uncomment (&amp;lt;i&amp;gt;i.e.&amp;lt;/i&amp;gt; remove the leading &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; character) &amp;lt;code&amp;gt;&amp;quot;outlier_detection_switch=True&amp;quot;&amp;lt;/code&amp;gt; on line 25.  Then edit the configuration file, &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; above, and change &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt; to &amp;lt;i&amp;gt;integration-second-lattice&amp;lt;/i&amp;gt; in order not to overwrite the results of the previous analysis of the primary lattice.  Before re-analysing the first batch, ensure that &amp;lt;code&amp;gt;xtal_target&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;thermolysin27&amp;lt;/code&amp;gt;.&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0016-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0017-*.xtc&lt;br /&gt;
 $ …&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0027-*.xtc&lt;br /&gt;
Then set &amp;lt;code&amp;gt;xtal_target&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;thermolysin73&amp;lt;/code&amp;gt; in the configuration file, and process the second batch.&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0071-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0072-*.xtc&lt;br /&gt;
 $ cxi.pyana -c &amp;lt;i&amp;gt;L498-indexigrate.cfg&amp;lt;/i&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/xtc/files&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/e157-r0073-*.xtc&lt;br /&gt;
The number of integrated secondary lattices should be close to 2,021, the number reported in the &#039;&#039;cctbx.xfel&#039;&#039; paper.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Merge all integrated images ==&lt;br /&gt;
&lt;br /&gt;
The phil-file below defines values suitable for merging the primary and secondary lattices previously integrated.&lt;br /&gt;
 data                         = &amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt;&lt;br /&gt;
 data                         = &amp;lt;i&amp;gt;integration-second-lattice&amp;lt;/i&amp;gt;&lt;br /&gt;
 d_min                        = 2.10&lt;br /&gt;
 merge_anomalous              = True&lt;br /&gt;
 min_corr                     = -1&lt;br /&gt;
 model                        = &amp;lt;i&amp;gt;2tli.pdb&amp;lt;/i&amp;gt;&lt;br /&gt;
 nproc                        = &amp;lt;i&amp;gt;16&amp;lt;/i&amp;gt;&lt;br /&gt;
 plot_single_index_histograms = False&lt;br /&gt;
 raw_data.sdfac_auto          = True&lt;br /&gt;
 rescale_with_average_cell    = True&lt;br /&gt;
 significance_filter.apply    = True&lt;br /&gt;
 set_average_unit_cell        = True&lt;br /&gt;
 mysql {&lt;br /&gt;
     database = &amp;lt;i&amp;gt;db_name&amp;lt;/i&amp;gt;&lt;br /&gt;
     passwd   = &amp;lt;i&amp;gt;db_passwd&amp;lt;/i&amp;gt;&lt;br /&gt;
     runtag   = &amp;lt;i&amp;gt;L498_thermolysin&amp;lt;/i&amp;gt;&lt;br /&gt;
     user     = &amp;lt;i&amp;gt;db_user&amp;lt;/i&amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
 output {&lt;br /&gt;
     n_bins = &amp;lt;i&amp;gt;10&amp;lt;/i&amp;gt;&lt;br /&gt;
     prefix = &amp;lt;i&amp;gt;L498_thermolysin&amp;lt;/i&amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
 scaling {&lt;br /&gt;
     algorithm  = mark0&lt;br /&gt;
     mtz_file   = &amp;lt;i&amp;gt;2tli.mtz&amp;lt;/i&amp;gt;&lt;br /&gt;
     show_plots = False&lt;br /&gt;
     log_cutoff = 0.0&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;i&amp;gt;integration-first-lattice&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;integration-second-lattice&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; may need to be adjusted to point to the directories where &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt; left the integration results.  &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;db_name&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;, &amp;lt;i&amp;gt;db_user&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;lt;i&amp;gt;db_passwd&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt; must be substituted with the database name and access credentials to a MySQL database.  Databases on hosts other than the one used to merge the thermolysin data can be accessed by additionally specifing the &amp;lt;code&amp;gt;mysql.host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;mysql.port&amp;lt;/code&amp;gt; options.  The model and structure factors for the scaling reference, &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;scaling.mtz_file&amp;lt;/code&amp;gt; above, are both available for download from the [http://www.rcsb.org RCSB Protein Data Bank (PDB)].  If the [http://www.phenix-online.org &#039;&#039;PHENIX&#039;&#039;] suite is installed, this is conveniently achieved from the command line using&lt;br /&gt;
 $ phenix.fetch_pdb --mtz 2tli&lt;br /&gt;
&lt;br /&gt;
To merge the thermolysin data, save the suitably modified configuration to &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; &amp;lt;code&amp;gt;L498-merge.phil&amp;lt;/code&amp;gt;, and run&lt;br /&gt;
 $ cxi.merge L498-merge.phil&lt;br /&gt;
 $ cxi.xmerge L498-merge.phil&lt;br /&gt;
Merging statistics are printed on standard output.  The merged MTZ-file is written to a file whose name is determined by the value of &amp;lt;code&amp;gt;output.prefix&amp;lt;/code&amp;gt; in the configuration file (&amp;lt;code&amp;gt;L498_thermolysin.mtz&amp;lt;/code&amp;gt; with the values shown above).  Note that the version of merging programs from 28 March, 2013 do &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; not report the &amp;lt;i&amp;gt;R&amp;lt;/i&amp;gt;&amp;lt;sub&amp;gt;split&amp;lt;/sub&amp;gt; statistic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_Tutorials&amp;diff=43</id>
		<title>Ha14 Tutorials</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_Tutorials&amp;diff=43"/>
		<updated>2014-03-10T06:44:51Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Added link to L498 thermolysin reprocessing page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These tutorials assumes the steps outlined in [[setup]] have been followed first.  Processing xfel data at LCLS consists of four steps: &lt;br /&gt;
&lt;br /&gt;
* [[Preparatory steps]]&lt;br /&gt;
* [[Metrology refinement]]&lt;br /&gt;
* [[Indexing and integration]].  Optional steps:&lt;br /&gt;
** Real-time [[progress monitoring]].&lt;br /&gt;
** Configuring specific spotfinder, indexing and integration parameters using &#039;&#039;[[phil]]&#039;&#039;.&lt;br /&gt;
* [[Merging]]&lt;br /&gt;
* [[Advanced Merging]]: Use cases for isomorphous replacement and &amp;lt;em&amp;gt;de novo&amp;lt;/em&amp;gt; structure&lt;br /&gt;
* [[Resolving an Indexing Ambiguity]]&lt;br /&gt;
&lt;br /&gt;
Additionally, &#039;&#039;cctbx.xfel&#039;&#039; utilizes &#039;&#039;[[phil]]&#039;&#039; files to manage its configuration settings.&lt;br /&gt;
&lt;br /&gt;
[[Processing L498 thermolysin]] details instructions to reproduce the results published in the forthcoming &#039;&#039;cctbx.xfel&#039;&#039; paper.&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Setup&amp;diff=137</id>
		<title>Setup</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Setup&amp;diff=137"/>
		<updated>2014-03-03T21:10:03Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Add NERSC to the table.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- XXX Should probably rename this page to &amp;quot;Set up &#039;&#039;cctbx.xfel&#039;&#039;&amp;quot; or some such --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisities ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; must be [[Installation | installed]] before it can be used.  The installation root directories affect the absolute paths used in the following instructions and differ from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Installation build directory&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Installation source directory&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys_test/cctbx/cctbx_build&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys_test/cctbx&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| No central, shared installation available&lt;br /&gt;
|-&lt;br /&gt;
| NERSC&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| No central, shared installation available&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/cctbx/build&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/cctbx/sources&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; can be installed anywhere on the filesystem where write access is granted.  Developers will generally have &#039;&#039;cctbx.xfel&#039;&#039; installed in their home directory.  Even if &#039;&#039;cctbx.xfel&#039;&#039; is already installed, the environment must first be [[Set up PSDM software | prepared for the PSDM software distribution]].&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;cctbx.xfel&#039;&#039; setup ==&lt;br /&gt;
&lt;br /&gt;
To start using &#039;&#039;cctbx.xfel&#039;&#039;, the environment has to be configured.  The details depend on the &#039;&#039;cctbx.xfel&#039;&#039; installation root directories and the user&#039;s shell.&lt;br /&gt;
In what follows &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with the actual build  and source directories of the &#039;&#039;cctbx.xfel&#039;&#039; installation.  bash-users can prepare the environment for &#039;&#039;cctbx.xfel&#039;&#039; using&lt;br /&gt;
 $ . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh&lt;br /&gt;
From a csh, the corresponding command is&lt;br /&gt;
 % source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;setpaths&amp;lt;/code&amp;gt; only modifies the environment of the &amp;lt;em&amp;gt;current shell&amp;lt;/em&amp;gt;, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh &amp;amp;&amp;amp; \&lt;br /&gt;
   . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh &amp;amp;&amp;amp; \&lt;br /&gt;
   source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.&lt;br /&gt;
&lt;br /&gt;
To make the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules available to PSDM&#039;s &#039;&#039;pyana&#039;&#039;,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ ln -fns &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/xfel/cxi/cspad_ana src&lt;br /&gt;
 $ cd ..&lt;br /&gt;
 $ scons&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; are the path to the test release and the name of the analysis package chosen while [[Set up PSDM software | setting up the PSDM software distribution]].  The last step compiles the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules.  These steps need only be performed once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
At SLAC, test that it is working by &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cxi.pyana -c /reg/g/cctbx/tutorials/setup/test.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0004-s00-c00.xtc&lt;br /&gt;
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 &#039;&#039;pyana&#039;&#039; with a configuration file (&amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt;) and an XTC file.  For more information, see the [[Overview]] and other tutorial pages.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=347</id>
		<title>Set up PSDM software</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=347"/>
		<updated>2014-03-03T21:09:03Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Add NERSC to the table.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ mbox&lt;br /&gt;
| type = notice&lt;br /&gt;
| text = Note that throughout the instructions &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the commands typed to the shell.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The [https://confluence.slac.stanford.edu/display/PCDS/Data+Management Photon Science Data Management (PSDM)] software distribution must be installed.  The PSDM software distribution provides &#039;&#039;pyana&#039;&#039;, which is a critical dependency of &#039;&#039;cctbx.xfel&#039;&#039;.  Its installation root directory affects the absolute paths used in the following instructions and differs from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Installation root directory&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/net/viper/raid1/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
| Only available on viper.lbl.gov&lt;br /&gt;
|-&lt;br /&gt;
| NERSC&lt;br /&gt;
| &amp;lt;code&amp;gt;/global/project/projectdirs/lcls/psdm-carver&amp;lt;/code&amp;gt;&lt;br /&gt;
| Only to be used on the carver system&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
The PSDM software distribution is supported on the most popular flavors of Linux and is installed at several sites worldwide.  Separate installation and maintenance instructions are provided by the PSDM project at [https://confluence.slac.stanford.edu/display/PSDM/Software+Distribution PSDM software distribution].  The package can be installed anywhere on the filesystem, and it is generally possible to install it without superuser privileges.&lt;br /&gt;
&lt;br /&gt;
== Create a test release and an analysis package ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;i&amp;gt;test release&amp;lt;/i&amp;gt;, which refers to a particular release of the PSDM distribution, is represented by a directory in the file system, often called &amp;lt;code&amp;gt;analysis-rel&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;myrelease&amp;lt;/code&amp;gt;. An analysis package within the test release in turn refers to the files implementing the analysis modules of the package. Details about test releases and analysis packages are covered in [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  To prepare the environment for using the PSDM software distribution, bash-users should source &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt;,&lt;br /&gt;
 $ . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with the path to the installation root directory.  csh-users should source &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; instead,&lt;br /&gt;
 % source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; only modifies the environment of the &amp;lt;em&amp;gt;current shell&amp;lt;/em&amp;gt;, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh &amp;amp;&amp;amp; . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh &amp;amp;&amp;amp; source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.  This ensures the environment is properly prepared for non-interactive shells, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; the shells that are used to run jobs submitted to the cluster.  To also be able to use the PSDM software from interactive shells, it is recommended that bash-users put&lt;br /&gt;
 test -r ~/.bashrc &amp;amp;&amp;amp; . ~/.bashrc&lt;br /&gt;
near the top of &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt;.  There is no need to edit any additional files for csh-users, because csh always reads &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A test released based on the most current PSDM distribution is then set up in the current working directory using&lt;br /&gt;
 $ newrel ana-current &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ newpkg &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&lt;br /&gt;
Note that the names for the test release and the analysis package, &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt; above, are common, but nevertheless arbitrary, choices.&lt;br /&gt;
&lt;br /&gt;
These steps only need to be performed once.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Pyana+User+Manual Pyana User Manual]&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Packages+and+Releases Analysis Workbook. Packages and Releases]&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Maintaining_an_installation&amp;diff=422</id>
		<title>Maintaining an installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Maintaining_an_installation&amp;diff=422"/>
		<updated>2014-02-28T23:45:37Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Updated link to PSDM installation instructions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Keeping up to date with PSDM releases==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Separate installation and maintenance instructions are provided by the PSDM project at [https://confluence.slac.stanford.edu/display/PSDM/Software+Distribution PSDM software distribution].  XXX Also missing bit on how to update cctbx for non-developers.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the &#039;&#039;cctbx.xfel&#039;&#039; modules do not critically depend on any particular version of &#039;&#039;pyana&#039;&#039;, it is generally safe to closely track the latest version of the PSDM software distribution.  To upgrade to the current PSDM release,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ relupgrade ana-current&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; must be substituted for path of the test release.  The &#039;&#039;cctbx.xfel&#039;&#039; modules should then be rebuilt using&lt;br /&gt;
 $ scons -c&lt;br /&gt;
 $ scons&lt;br /&gt;
It is possible to manually edit &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/.sit_release&amp;lt;/code&amp;gt; to contain &amp;lt;code&amp;gt;ana-current&amp;lt;/code&amp;gt; instead of a particular version number.  This ensures that the latest version of the PSDM software distribution is used during each session.&lt;br /&gt;
&lt;br /&gt;
== Keeping a developer installation up to date ==&lt;br /&gt;
&lt;br /&gt;
Given the rapid development of the &#039;&#039;PHENIX&#039;&#039; suite, it is recommended to update the sources and rebuild often. Certain changes may require the configure command (or &amp;lt;code&amp;gt;libtbx.refresh&amp;lt;/code&amp;gt;) to be rerun.&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ ./allsvn update&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
&amp;lt;!-- XXX How often should one do something about the hot tarballs (i.e. annlib_hot.tar.gz, boost_hot.tar.gz, and scons_hot.tar.gz)? XXX See also Nick’s note at the end of document about the New framework for specifying crystal targets. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=346</id>
		<title>Set up PSDM software</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=346"/>
		<updated>2014-02-28T23:44:01Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Updated link to PSDM installation instructions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ mbox&lt;br /&gt;
| type = notice&lt;br /&gt;
| text = Note that throughout the instructions &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the commands typed to the shell.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The [https://confluence.slac.stanford.edu/display/PCDS/Data+Management Photon Science Data Management (PSDM)] software distribution must be installed.  The PSDM software distribution provides &#039;&#039;pyana&#039;&#039;, which is a critical dependency of &#039;&#039;cctbx.xfel&#039;&#039;.  Its installation root directory affects the absolute paths used in the following instructions and differs from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Installation root directory&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/net/viper/raid1/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
| Only available on viper.lbl.gov&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
The PSDM software distribution is supported on the most popular flavors of Linux and is installed at several sites worldwide.  Separate installation and maintenance instructions are provided by the PSDM project at [https://confluence.slac.stanford.edu/display/PSDM/Software+Distribution PSDM software distribution].  The package can be installed anywhere on the filesystem, and it is generally possible to install it without superuser privileges.&lt;br /&gt;
&lt;br /&gt;
== Create a test release and an analysis package ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;i&amp;gt;test release&amp;lt;/i&amp;gt;, which refers to a particular release of the PSDM distribution, is represented by a directory in the file system, often called &amp;lt;code&amp;gt;analysis-rel&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;myrelease&amp;lt;/code&amp;gt;. An analysis package within the test release in turn refers to the files implementing the analysis modules of the package. Details about test releases and analysis packages are covered in [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  To prepare the environment for using the PSDM software distribution, bash-users should source &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt;,&lt;br /&gt;
 $ . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with the path to the installation root directory.  csh-users should source &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; instead,&lt;br /&gt;
 % source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; only modifies the environment of the &amp;lt;em&amp;gt;current shell&amp;lt;/em&amp;gt;, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh &amp;amp;&amp;amp; . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh &amp;amp;&amp;amp; source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.  This ensures the environment is properly prepared for non-interactive shells, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; the shells that are used to run jobs submitted to the cluster.  To also be able to use the PSDM software from interactive shells, it is recommended that bash-users put&lt;br /&gt;
 test -r ~/.bashrc &amp;amp;&amp;amp; . ~/.bashrc&lt;br /&gt;
near the top of &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt;.  There is no need to edit any additional files for csh-users, because csh always reads &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A test released based on the most current PSDM distribution is then set up in the current working directory using&lt;br /&gt;
 $ newrel ana-current &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ newpkg &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&lt;br /&gt;
Note that the names for the test release and the analysis package, &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt; above, are common, but nevertheless arbitrary, choices.&lt;br /&gt;
&lt;br /&gt;
These steps only need to be performed once.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Pyana+User+Manual Pyana User Manual]&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Packages+and+Releases Analysis Workbook. Packages and Releases]&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=103</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=103"/>
		<updated>2014-02-25T11:49:22Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Always use current bundles.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/current/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://adder.lbl.gov/cctbx.xfel/downloads/labelit_bundle_current.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_current.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.&lt;br /&gt;
}}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Note to editors: nightly bundles are stored in /net/cci/auto_build/cctbx/results.  The nightly LABELIT bundles are generated by a cron job on adder and stored at /net/adder/raid1/hattne/work/downloads.  The script to generate the LABELIT bundles is at /net/adder/raid1/hattne/work/make_labelit_source_bundle.sh. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Long-standing gremlin: it appears that for initial installs, it is necessary to run make twice!  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=102</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=102"/>
		<updated>2014-02-20T00:07:11Z</updated>

		<summary type="html">&lt;p&gt;Hattne: LABELIT bundle is now publicly available.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://adder.lbl.gov/cctbx.xfel/downloads/labelit_bundle_20140106.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Nightly bundles are stored in /net/cci/auto_build/cctbx/results.  The nightly LABELIT bundles are generated by a cron job on adder and stored at /net/adder/raid1/hattne/work/downloads.  The script to generate the labelit bundles is at ~/projects/doc/make_labelit_source_bundle.sh. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Long-standing gremlin: it appears that for initial installs, it is necessary to run make twice!  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=101</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=101"/>
		<updated>2014-02-19T22:56:56Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Updated download link for LABELIT bundle&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://adder.lbl.gov/cctbx.xfel/downloads/labelit_bundle_20140106.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Nightly bundles are stored in /net/cci/auto_build/cctbx/results.  The nightly LABELIT bundles are generated by a cron job on adder and stored at /net/adder/raid1/hattne/work/downloads.  The script to generate the labelit bundles is at ~/projects/doc/make_labelit_source_bundle.sh. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Long-standing gremlin: it appears that for initial installs, it is necessary to run make twice!  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Cctbx_logo_small.png&amp;diff=423</id>
		<title>File:Cctbx logo small.png</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Cctbx_logo_small.png&amp;diff=423"/>
		<updated>2014-02-19T22:15:53Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Initial attempt at replacing the default logo.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Initial attempt at replacing the default logo.&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Maintaining_an_installation&amp;diff=421</id>
		<title>Maintaining an installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Maintaining_an_installation&amp;diff=421"/>
		<updated>2014-02-14T00:47:41Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Noted missing bits.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Keeping up to date with PSDM releases==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Separate installation and maintenance instructions are provided by the PSDM project at [https://confluence.slac.stanford.edu/display/PCDS/PSDM+software+distribution PSDM software distribution].  XXX Also missing bit on how to update cctbx for non-developers.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the &#039;&#039;cctbx.xfel&#039;&#039; modules do not critically depend on any particular version of &#039;&#039;pyana&#039;&#039;, it is generally safe to closely track the latest version of the PSDM software distribution.  To upgrade to the current PSDM release,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ relupgrade ana-current&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; must be substituted for path of the test release.  The &#039;&#039;cctbx.xfel&#039;&#039; modules should then be rebuilt using&lt;br /&gt;
 $ scons -c&lt;br /&gt;
 $ scons&lt;br /&gt;
It is possible to manually edit &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/.sit_release&amp;lt;/code&amp;gt; to contain &amp;lt;code&amp;gt;ana-current&amp;lt;/code&amp;gt; instead of a particular version number.  This ensures that the latest version of the PSDM software distribution is used during each session.&lt;br /&gt;
&lt;br /&gt;
== Keeping a developer installation up to date ==&lt;br /&gt;
&lt;br /&gt;
Given the rapid development of the &#039;&#039;PHENIX&#039;&#039; suite, it is recommended to update the sources and rebuild often. Certain changes may require the configure command (or &amp;lt;code&amp;gt;libtbx.refresh&amp;lt;/code&amp;gt;) to be rerun.&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ ./allsvn update&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
&amp;lt;!-- XXX How often should one do something about the hot tarballs (i.e. annlib_hot.tar.gz, boost_hot.tar.gz, and scons_hot.tar.gz)? XXX See also Nick’s note at the end of document about the New framework for specifying crystal targets. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Setup&amp;diff=136</id>
		<title>Setup</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Setup&amp;diff=136"/>
		<updated>2014-02-11T00:37:01Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Removed creating of ./lsf.sh symbolic link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- XXX Should probably rename this page to &amp;quot;Set up &#039;&#039;cctbx.xfel&#039;&#039;&amp;quot; or some such --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisities ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; must be [[Installation | installed]] before it can be used.  The installation root directories affect the absolute paths used in the following instructions and differ from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Installation build directory&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Installation source directory&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys_test/cctbx/cctbx_build&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys_test/cctbx&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| No central, shared installation available&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/cctbx/build&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/cctbx/sources&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; can be installed anywhere on the filesystem where write access is granted.  Developers will generally have &#039;&#039;cctbx.xfel&#039;&#039; installed in their home directory.  Even if &#039;&#039;cctbx.xfel&#039;&#039; is already installed, the environment must first be [[Set up PSDM software | prepared for the PSDM software distribution]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;cctbx.xfel&#039;&#039; setup ==&lt;br /&gt;
&lt;br /&gt;
To start using &#039;&#039;cctbx.xfel&#039;&#039;, the environment has to be configured.  The details depend on the &#039;&#039;cctbx.xfel&#039;&#039; installation root directories and the user&#039;s shell.&lt;br /&gt;
In what follows &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with the actual build  and source directories of the &#039;&#039;cctbx.xfel&#039;&#039; installation.  bash-users can prepare the environment for &#039;&#039;cctbx.xfel&#039;&#039; using&lt;br /&gt;
 $ . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh&lt;br /&gt;
From a csh, the corresponding command is&lt;br /&gt;
 % source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;setpaths&amp;lt;/code&amp;gt; only modifies the environment of the &amp;lt;em&amp;gt;current shell&amp;lt;/em&amp;gt;, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh &amp;amp;&amp;amp; \&lt;br /&gt;
   . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh &amp;amp;&amp;amp; \&lt;br /&gt;
   source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.&lt;br /&gt;
&lt;br /&gt;
To make the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules available to PSDM&#039;s &#039;&#039;pyana&#039;&#039;,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ ln -fns &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/xfel/cxi/cspad_ana src&lt;br /&gt;
 $ cd ..&lt;br /&gt;
 $ scons&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; are the path to the test release and the name of the analysis package chosen while [[Set up PSDM software | setting up the PSDM software distribution]].  The last step compiles the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules.  These steps need only be performed once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
At SLAC, test that it is working by &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cxi.pyana -c /reg/g/cctbx/tutorials/setup/test.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0004-s00-c00.xtc&lt;br /&gt;
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 &#039;&#039;pyana&#039;&#039; with a configuration file (&amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt;) and an XTC file.  For more information, see the [[Overview]] and other tutorial pages.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Preparatory_steps_pyana_version&amp;diff=161</id>
		<title>Preparatory steps pyana version</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Preparatory_steps_pyana_version&amp;diff=161"/>
		<updated>2014-02-11T00:36:10Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Replaced ./lsf.sh with cxi.lsf.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The CS-PAD detector at LCLS is sensitive to temperature distortions and is not automatically dark-subtracted, unlike images from a synchrotron source.  Because of this it is necessary to periodically collect a dark run with the shutters closed during an LCLS experiment.  The dark run should contain on the order of at least 1000 images.  Before an experimental run can be processed, this dark run must be averaged so that subsequent experimental data can have the dark subtracted from each image.  Further, events during collection can necessitate a new dark, such as ice in the beam oversaturating creating dead pixels or a change in temperature.&lt;br /&gt;
&lt;br /&gt;
In addition, averaging a lighted run in general is a useful tool for examining diffraction throughout a data collection run.&lt;br /&gt;
&lt;br /&gt;
Finally, inactive and non-bonded pixels, as well as hypersensitive pixels and any beam stop (if used) should be masked out.  This tutorial covers averaging dark and light runs, and creating mask images.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your scratch area ==&lt;br /&gt;
&lt;br /&gt;
Create a scratch folder and populate it with some directories that will be used during this tutorial, changing &amp;lt;username&amp;gt; to your SLAC account name:&lt;br /&gt;
&lt;br /&gt;
 $ cd /reg/g/cctbx/tutorials/scratch/&lt;br /&gt;
 $ mkdir &amp;lt;username&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;username&amp;gt;&lt;br /&gt;
 $ mkdir darks&lt;br /&gt;
 $ mkdir averages&lt;br /&gt;
 $ mkdir results&lt;br /&gt;
&lt;br /&gt;
Or you may use a directory in your home folder.&lt;br /&gt;
&lt;br /&gt;
== Create a dark average ==&lt;br /&gt;
&lt;br /&gt;
To create the average, start by copying the dark.cfg file to your pyana directory:&lt;br /&gt;
&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cp /reg/g/cctbx/tutorials/preprocessing/dark.cfg .&lt;br /&gt;
 &lt;br /&gt;
Open dark.cfg.  It will look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is not true: can submit averaging job using cxi.lsf&#039;s -s option.  Maybe fix that once there&#039;s a separate page documenting cxi.lsf. --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# -*- Mode: Conf -*-&lt;br /&gt;
#&lt;br /&gt;
# Since mod_average must be run on a single host, it cannot be&lt;br /&gt;
# submitted using cxi.lsf.&lt;br /&gt;
#&lt;br /&gt;
# bsub -n 6 -J r0002 -o /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/dark_r0002.out -q psanacsq -R &amp;quot;span[hosts=1]&amp;quot; \&lt;br /&gt;
#   &amp;quot;cxi.pyana -c ~/myrelease/dark.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0002-s0*.xtc&amp;quot;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
[pyana]&lt;br /&gt;
modules = my_ana_pkg.mod_average&lt;br /&gt;
num-cpu = 8&lt;br /&gt;
&lt;br /&gt;
[my_ana_pkg.mod_average]&lt;br /&gt;
calib_dir      = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
avg_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks&lt;br /&gt;
stddev_dirname = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks&lt;br /&gt;
max_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks&lt;br /&gt;
detz_offset    = 581&lt;br /&gt;
address         = CxiDs1-0|Cspad-0&lt;br /&gt;
avg_basename    = Ds1-r0002-avg&lt;br /&gt;
stddev_basename = Ds1-r0002-stddev&lt;br /&gt;
max_basename    = Ds1-r0002-max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The config file is broken into three sections, the header, the pyana section and the modules section.&lt;br /&gt;
&lt;br /&gt;
=== Header Section ===&lt;br /&gt;
The comments at the top of the file include a bsub command.  This is the command to be entered from the ~/myrelease directory to queue the job for processing.  Bsub will submit the job, asking for 6 CPUs (-n), naming the job r0002 (-J), placing a log file in the -o location, and so forth.  There are several queues available for use, the psanacsq is just one of them.  The -R option restricts the job to running on a single host, which is required for averaging.  Finally, the cxi.pyana command in quotes is the command that will actually be executed on the host computer, and specifies the config file and the streams to use.  Note the asterisk, which allows averaging all the streams from a single run at one time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Before executing the command, replace &amp;lt;username&amp;gt; in the command and in the config file with your user name.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Pyana Section ===&lt;br /&gt;
Pyana operates by having a root section in the config file which specifies which modules to run.  In this case we are running &#039;&#039;cctbx.xfel&#039;s&#039;&#039; mod_average module.  If we were running multiple modules, we could chain them together here, and each module would be executed in sequence using the parameters specified below.  We also request a number of cpus to parallelize the job with.  Even though averaging must be done on a single host, on that host the processing can be split up among multiple cores.  Note, other aspects of &#039;&#039;cctbx.xfel&#039;&#039;, such as indexing and integration, do not have this restriction.&lt;br /&gt;
&lt;br /&gt;
=== Module Section ===&lt;br /&gt;
The final section specifies parameters specific to averaging:&lt;br /&gt;
* calib_dir: this directory is provided by LCLS and includes the layout information of the 64 tiles of the CS-PAD detector&lt;br /&gt;
* avg_dirname: directory to place the average image&lt;br /&gt;
* stddev_dirname: directory to place the standard deviation image&lt;br /&gt;
* max_dirname: directory to place the maximum projection image&lt;br /&gt;
* detz_offset: experiment-specific number used to calculate the detector distance.  This is the distance in millimeters between the sample interaction region and the far end of the detector stage.  The XTC stream contains the distance from the detector stage to the detector.  These two numbers are subtracted to calculate the distance between sample interaction region and the detector.  We determine this number experimentally using a grid search, testing a range of potential detz_offsets and choosing the one that shows the greatest success at indexing images&lt;br /&gt;
* address: the name of the detector in the XTC stream&lt;br /&gt;
* avg_basename: this name is prepended to a datestamp to name the average image&lt;br /&gt;
* stddev_basename: this name is prepended to a datestamp to name the standard deviation image&lt;br /&gt;
* max_basename: this name is prepended to a datestamp to name the maximum projection image image&lt;br /&gt;
&lt;br /&gt;
=== Running and testing the command ===&lt;br /&gt;
Submit the job as specified above, using the bsub command in the header:&lt;br /&gt;
 $ bsub -n 6 -J r0002 -o /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/dark_r0002.out -q psanacsq -R &amp;quot;span[hosts=1]&amp;quot;&lt;br /&gt;
      &amp;quot;cxi.pyana -c ~/myrelease/dark.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0002-s0*.xtc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Type bjobs to see if the job is running.  When it is, follow the output thusly:&lt;br /&gt;
 $ tail -f /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/dark_r0002.out&lt;br /&gt;
&lt;br /&gt;
When the average has been completed, the output can be inspected using the &amp;quot;cctbx&amp;quot; image viewer:&lt;br /&gt;
 $ cctbx.image_viewer /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks/Ds1-r0002-*.pickle&lt;br /&gt;
&lt;br /&gt;
== Averaging an experimental light run ==&lt;br /&gt;
&lt;br /&gt;
Once the dark run is made, experimental runs can be averaged to see the extent of diffraction and potential pathologies in the run. Copy the average.cfg file from the tutorials directory to your pyana directory:&lt;br /&gt;
&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ cp /reg/g/cctbx/tutorials/preprocessing/average.cfg .&lt;br /&gt;
&lt;br /&gt;
The cfg will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# -*- Mode: Conf -*-&lt;br /&gt;
#&lt;br /&gt;
# Since mod_average must be run on a single host, it cannot be&lt;br /&gt;
# submitted using cxi.lsf.&lt;br /&gt;
#&lt;br /&gt;
# bsub -n 6 -J r0003 -o /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/average_r0003.out -q psanacsq -R &amp;quot;span[hosts=1]&amp;quot; \&lt;br /&gt;
#   &amp;quot;cxi.pyana -c average.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0003-s0*.xtc&amp;quot;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
[pyana]&lt;br /&gt;
modules = my_ana_pkg.mod_average&lt;br /&gt;
num-cpu = 8&lt;br /&gt;
&lt;br /&gt;
[my_ana_pkg.mod_average]&lt;br /&gt;
calib_dir      = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
dark_path      = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks/&amp;lt;name of dark average&amp;gt;.pickle&lt;br /&gt;
dark_stddev    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/darks/&amp;lt;name of dark stddev&amp;gt;.pickle&lt;br /&gt;
avg_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/averages&lt;br /&gt;
stddev_dirname = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/averages&lt;br /&gt;
max_dirname    = /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/averages&lt;br /&gt;
detz_offset    = 581&lt;br /&gt;
address         = CxiDs1-0|Cspad-0&lt;br /&gt;
avg_basename    = Ds1-r0003-avg&lt;br /&gt;
stddev_basename = Ds1-r0003-stddev&lt;br /&gt;
max_basename    = Ds1-r0003-max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only difference is the addition of two parameters:&lt;br /&gt;
* dark_path: path to the average dark image created before&lt;br /&gt;
* dark_stddev: path to the standard deviation dark image created before&lt;br /&gt;
&lt;br /&gt;
The job is ran as before using the bsub command in the header, again remembering to change all instances of &amp;lt;username&amp;gt; to your own SLAC user name.  Here you must also change &amp;lt;name of dark average&amp;gt; and &amp;lt;name of dark stddev&amp;gt; to the names of the average and standard deviation images created in the previous step.  The result of the run will be three new images that can be viewed with cctbx.image_viewer in the same manner as the darks were.&lt;br /&gt;
&lt;br /&gt;
== Information contained in the light average ==&lt;br /&gt;
&lt;br /&gt;
Firstly, the light and dark images can be used to mask of any bad pixels, as detailed below. The light images (maximum in particular) also serve as a virtual, dark-subtracted, powder pattern that can used to inspect the data for diffraction. The light maximum should also flag up obvious errors in meteorology, because rings will be non-continuous if the quadrants are misaligned. Intensity values from the corners of the light average or maximum are also useful to estimate background when taking first guesses at thresholds for hit-finding and integration.&lt;br /&gt;
&lt;br /&gt;
== Creating a mask image ==&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; uses three images to create a mask.  Those images, and the purposes of them are listed below:&lt;br /&gt;
* Average image from a dark run: pixels ≤ 0 are considered dead, pixels &amp;gt; 2000 are too sensitive&lt;br /&gt;
* Standard deviation from a dark run: pixels ≤ 0 are considered dead, pixels ≥ 10 are too uncertain&lt;br /&gt;
* Maximum projection from a lighted run (&#039;&#039;i.e.&#039;&#039; an experimental run): pixels &amp;lt; 300 are considered non-bonded or in a shadow.  The presence of diffracting data is not needed, but also will not interfere.&lt;br /&gt;
&lt;br /&gt;
To create the mask, execute these commands:&lt;br /&gt;
 $ cd /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/&lt;br /&gt;
 $ mkdir masks&lt;br /&gt;
 $ cd masks&lt;br /&gt;
 $ cxi.make_mask -m 10 ../darks/&amp;lt;name of dark average&amp;gt;.pickle ../darks/&amp;lt;name of dark standard deviation&amp;gt;.pickle&lt;br /&gt;
     ../averages/&amp;lt;name of light maximum projection&amp;gt;.pickle&lt;br /&gt;
&lt;br /&gt;
A new image is created where each pixel has one of two values: -2 (masked out pixels), and 0 (good pixels).  Note, the maximum projection minimum pixel value is overridden here to a value that is more sensible for the tutorial&#039;s lysozyme data.  You will likely need to adjust this parameter based on your data (see below for details and for further overrides).  &lt;br /&gt;
&lt;br /&gt;
Use the resultant mask image during processing with &#039;&#039;cctbx.xfel&#039;&#039; by adding this flag to your pyana config file:&lt;br /&gt;
&lt;br /&gt;
 mask_path   = &amp;lt;path to mask file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, a polygon and a circle can be specified using the --poly_mask and --circle_mask parameters:&lt;br /&gt;
&lt;br /&gt;
 $ cxi.make_mask --poly_mask=17,854,76,967,760,982,762,879 --circle_mask=855,939,103 Cspad-avg.pickle Cspad-stddev.pickle Cspad-max.pickle&lt;br /&gt;
&lt;br /&gt;
This example creates a mask image with the polygon with points (17,854), (76,967), (760,982), and (762,879) masked out, and the circle with center (855,939) and radius 103 masked out. Only one polygon and circle can be specified at the moment.&lt;br /&gt;
&lt;br /&gt;
The mask can be examined with cctbx.image_viewer.&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
Some additional options are available for specifying the details of the masking operation:&lt;br /&gt;
;-a,  --avg_max (default 2000)&lt;br /&gt;
: specifies the maximum value in ADU a pixel in the average image can have before it&#039;s masked out.  The minimum is always zero.&lt;br /&gt;
;-s, --stddev_max (default 10)&lt;br /&gt;
: specifies the maximum value in ADU a pixel in the standard deviation image can have before it&#039;s masked out.  The minimum is always zero.&lt;br /&gt;
;-m, --maxproj_min (default 300)&lt;br /&gt;
: specifies the minimum value in ADU a pixel in the maximum projection image can have before it&#039;s masked out.  Of the three parameters for controlling cutoffs in &#039;&#039;cxi.make_mask&#039;&#039;, the -m option is unique from the -a and -s options in that it will likely vary the according to your sample&#039;s background.  Carefully examine the corners of your lighted maximum projection and choose a value lower than the ADU values displayed.  Also note that there is no cutoff on the high end of the maximum projection image specified in the mask, as that is defined as the saturation value for the detector.&lt;br /&gt;
;-x, --mask_pix_val (default -2)&lt;br /&gt;
: specifies the value to use when masking out a pixel. In other words, bad pixels in images in the XTC stream will be replaced with this value.&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Progress_monitoring&amp;diff=250</id>
		<title>Progress monitoring</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Progress_monitoring&amp;diff=250"/>
		<updated>2014-02-11T00:33:25Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Replaced ./lsf.sh with cxi.lsf.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If configured to do so, &#039;&#039;cctbx.xfel&#039;&#039; can use a mysql database during hit finding to log the hit rate and other useful parameters, enabling real-time monitoring via a graphical display.  &lt;br /&gt;
&lt;br /&gt;
== Configuring trial monitoring ==&lt;br /&gt;
Add to the mod_hitfind section of your pyana config file these lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cxi.lsf will replace this with its deterimined id, otherwise&lt;br /&gt;
# set it to the ID you wish.  0 is the default.&lt;br /&gt;
trial_id        = 0&lt;br /&gt;
db_logging      = True&lt;br /&gt;
sql_buffer_size = 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These three parameters turn on and configure database-backed logging of hitfinding results:&lt;br /&gt;
* trial_id: we find it useful to organize processing in numbered trials.  Whenever we go back and change the parameters of our processing, adjusting the target cell or spotfinder parameters for example, we re-process under a different trial ID.  When you submit your processing job using cxi.lsf, you can specify the trial ID on the command line with –t.  What you specify will overwrite what is listed here in the cfg file.  If you use bsub, then what is in the cfg file is what’s used.  Note, it isn’t a good idea to re-use the trial_id when re-prossing the data if database logging is being used, simply because the hits will be logged twice which will clutter future analysis.  Finally, if you want to see which trials you have used for which runs, execute &#039;&#039;&#039;cxi.list_db_metadata&#039;&#039;&#039;&lt;br /&gt;
* db_logging: Switch for turning on and off logging&lt;br /&gt;
* sql_buffer_size: a queue size for regulating how often to add data to the database.  In our experience, 5 has been just fine.&lt;br /&gt;
&lt;br /&gt;
== Monitoring hit finding in real time ==&lt;br /&gt;
After submitting a job with db logging enabled, use cxi.monitor_trials &amp;lt;trial number&amp;gt; to display the hit rate during processing.  Other command line options and their defaults are listed below, including the ability to display multiple runs at once.  The default is to display the 5 latest runs by timestamp.&lt;br /&gt;
* t_wait = 8000: amount of time in ms between queries to the database&lt;br /&gt;
* hit_cutoff = 16: the number of bragg spots before a frame is considered a hit.  If this is different than what’s in your config file, then the monitor will be using a different cutoff to display which frames are hits.&lt;br /&gt;
* average_window = 1000: how many frames are in the sliding averaging window shown in the hit % graph&lt;br /&gt;
* n_points = 1000: how many total points to display on the graph.  Set it to 0 to display all the data points (can be computationally intensive).&lt;br /&gt;
* display_time = 1800: number of seconds of experiment time to display.  Displays this number of seconds unless that would add up to more than 5 runs.&lt;br /&gt;
* run_num = display only this run&lt;br /&gt;
* run_min = start at this run&lt;br /&gt;
* run_max = end with this run&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Indexing_and_integration&amp;diff=211</id>
		<title>Indexing and integration</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Indexing_and_integration&amp;diff=211"/>
		<updated>2014-02-11T00:31:31Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Replaced ./lsf.sh with cxi.lsf.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In principle, one could attempt to index and integrate every single image recorded during a &amp;quot;diffract-and-destroy&amp;quot; experiment.  Typically only a small fraction of the recorded images exhibit an indexable lattice, and in practice a &#039;&#039;hit-finder&#039;&#039; is needed to triage the stream of images, and preserve computational resources.&lt;br /&gt;
&lt;br /&gt;
Indexing and integration are tightly coupled; it is impossible to integrate an image without first obtaining an indexing solution.  The result of successfully indexing an image is essentially a model of crystal–beam interaction.  The model not only describes how the crystal is oriented with respect to the direction of the X-ray pulse, but also its degree of imperfection (&#039;&#039;i.e.&#039;&#039; mosaicity), and qualities of the illuminating pulse (&#039;&#039;e.g.&#039;&#039; bandwidth).  The integration algorithm uses this model to predict where Bragg spots appear on the image, and integrates the intensities around those predications.  The integration algorithm thus exploits the regularity of the underlying crystal lattice to recover signal where it was too weak to be detected.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;pyana&amp;lt;/code&amp;gt; section ==&lt;br /&gt;
&lt;br /&gt;
For historical reasons, hit-finding and indexing/integration are both implemented in the same analysis module, called &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt;.  To chain the two functions together, &#039;&#039;pyana&#039;&#039; must be configured to pass each event through two different instances of the same module.  The two instances are differentiated by their name following the colon.  In the example below, the first instance is called &amp;lt;code&amp;gt;hitfind&amp;lt;/code&amp;gt;, and the second is &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[pyana]&lt;br /&gt;
modules = my_ana_pkg.mod_hitfind:hitfind \&lt;br /&gt;
          my_ana_pkg.mod_hitfind:index&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Any instance of an analysis module can signal &#039;&#039;pyana&#039;&#039; to skip further processing of the event. In the case above, the &amp;lt;code&amp;gt;hitfind&amp;lt;/code&amp;gt; instance of &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt; would signal &#039;&#039;pyana&#039;&#039; to skip the event if it determines that the image associated with the event is not a hit.  In that case, the second instance, &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;, will never see the event.  Otherwise, the event is fed to the second instance, which will attempt indexing and integration on the associated image.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;pyana&amp;lt;/code&amp;gt;-section of the processing configuration used for this part of the tutorial has one more feature.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[pyana]&lt;br /&gt;
modules = my_ana_pkg.mod_hitfind:hitfind \&lt;br /&gt;
          my_ana_pkg.mod_dump:hit        \&lt;br /&gt;
          my_ana_pkg.mod_hitfind:index   \&lt;br /&gt;
          my_ana_pkg.mod_dump:indexed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Each instance of &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt; is followed by an instance of &amp;lt;code&amp;gt;mod_dump&amp;lt;/code&amp;gt;.  &amp;lt;code&amp;gt;mod_dump&amp;lt;/code&amp;gt; is a simple module that just outputs the image associated with the event to the file system.  In the above configuration, images are written to disk if they are determined to be hits, and then written again—possibly using a different name—if indexing and integration succeeds.&lt;br /&gt;
&lt;br /&gt;
== Hit-finding==&lt;br /&gt;
&lt;br /&gt;
Hit-finding may be viewed as a pattern-recognition problem, separate from whatever methods are used for actual processing of a diffraction image.  The hit-finder in &#039;&#039;cctbx.xfel&#039;&#039;, however, is based on the same algorithms as are used for data analysis.  In particular, the hit-finder implemented in mod_hitfind uses the &#039;&#039;Spotfinder&#039;&#039; (Zhang &#039;&#039;et al.&#039;&#039;, 2006) algorithm to detect strong, low-resolution peaks.&lt;br /&gt;
&lt;br /&gt;
The configuration for the &amp;lt;code&amp;gt;hitfind&amp;lt;/code&amp;gt; instance of &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt; is shown below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my_ana_pkg.mod_hitfind:hitfind]&lt;br /&gt;
address         = CxiDs1-0|Cspad-0&lt;br /&gt;
calib_dir       = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
dark_path       = /reg/g/cctbx/tutorials/darks/Ds1-r0002-avg.pickle&lt;br /&gt;
dark_stddev     = /reg/g/cctbx/tutorials/darks/Ds1-r0002-stddev.pickle&lt;br /&gt;
detz_offset     = 581&lt;br /&gt;
dispatch        = nop&lt;br /&gt;
distl_flags     = permissive&lt;br /&gt;
distl_min_peaks = 16&lt;br /&gt;
threshold       = 450&lt;br /&gt;
xtal_target     = /reg/g/cctbx/tutorials/indexing/hitfind-7.1.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;address&amp;lt;/code&amp;gt;&lt;br /&gt;
: Full data source address of the DAQ device, see [https://confluence.slac.stanford.edu/display/PCDS/Pyana+User+Manual#PyanaUserManual-DataSourceAddress Data Source Address] in the [https://confluence.slac.stanford.edu/display/PCDS/Pyana+User+Manual Pyana User Manual].  This identifies the detector from which images are to be extracted.&lt;br /&gt;
; &amp;lt;code&amp;gt;calib_dir&amp;lt;/code&amp;gt;&lt;br /&gt;
: This value defines the initial placement of the detector elements.  &#039;&#039;cctbx.xfel&#039;&#039; implements its metrology corrections with respect to these initial definitions.  As a result, the value of this option should not be changed.&lt;br /&gt;
; &amp;lt;code&amp;gt;dark_path&amp;lt;/code&amp;gt;&lt;br /&gt;
: Path to an average image from a dark run (&#039;&#039;i.e.&#039;&#039; pedestal) to use for dark-subtraction.&lt;br /&gt;
; &amp;lt;code&amp;gt;dark_stddev&amp;lt;/code&amp;gt;&lt;br /&gt;
: Path to a standard-deviation image from a dark run.&lt;br /&gt;
; &amp;lt;code&amp;gt;detz_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
: The distance from the interaction region, where the X-ray pulse and the sample jet intersect, to the back of the detector stage, in mm.&lt;br /&gt;
; &amp;lt;code&amp;gt;dispatch&amp;lt;/code&amp;gt;&lt;br /&gt;
: What action &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt; is to take.  The value should be &amp;lt;code&amp;gt;nop&amp;lt;/code&amp;gt; for hit-finding.&lt;br /&gt;
; &amp;lt;code&amp;gt;distl_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
: General behavior of the hit-finder, either &amp;lt;code&amp;gt;permissive&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;restrictive&amp;lt;/code&amp;gt;.&lt;br /&gt;
; &amp;lt;code&amp;gt;distl_min_peaks&amp;lt;/code&amp;gt;&lt;br /&gt;
: How many &#039;&#039;strong&#039;&#039;, low-resolution peaks are required to classify the image as a hit.&lt;br /&gt;
; &amp;lt;code&amp;gt;threshold&amp;lt;/code&amp;gt;&lt;br /&gt;
: How high a peak must be above the background to be classified as &#039;&#039;strong&#039;&#039;, in analog-to-digital units (ADU). &lt;br /&gt;
; &amp;lt;code&amp;gt;xtal_target&amp;lt;/code&amp;gt;&lt;br /&gt;
: &#039;&#039;phil&#039;&#039;-file containing further configuration options for the hit-finder.&lt;br /&gt;
&lt;br /&gt;
== Image output ==&lt;br /&gt;
The configuration section for image output is given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my_ana_pkg.mod_dump:hit]&lt;br /&gt;
address      = CxiDs1-0|Cspad-0&lt;br /&gt;
calib_dir    = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
out_dirname  = out&lt;br /&gt;
out_basename = shot-&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;address&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;calib_dir&amp;lt;/code&amp;gt; options were explained in [[#Hit-finding|Hit-finding]] above.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;out_dirname&amp;lt;/code&amp;gt;&lt;br /&gt;
: Directory portion of output image pathname.&lt;br /&gt;
; &amp;lt;code&amp;gt;out_basename&amp;lt;/code&amp;gt;&lt;br /&gt;
: Filename prefix of output image pathname.&lt;br /&gt;
&lt;br /&gt;
The actual pathname of the image as it is written to the file system is determined by joining &amp;lt;code&amp;gt;out_dirname&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;out_basename&amp;lt;/code&amp;gt; using the directory separator (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; on Unix), and appending a textual representation of the timestamp when the image was recorded.&lt;br /&gt;
&lt;br /&gt;
== Indexing and integration ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
address              = CxiDs1-0|Cspad-0&lt;br /&gt;
calib_dir            = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0&lt;br /&gt;
dark_path            = /reg/g/cctbx/tutorials/darks/Ds1-r0002-avg.pickle&lt;br /&gt;
dark_stddev          = /reg/g/cctbx/tutorials/darks/Ds1-r0002-stddev.pickle&lt;br /&gt;
detz_offset          = 581&lt;br /&gt;
dispatch             = index&lt;br /&gt;
integration_dirname  = integration&lt;br /&gt;
integration_basename = int-&lt;br /&gt;
xtal_target          = Ls04-lysozyme.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The options not already explained in [[#Hit-finding|Hit-finding]] are:&lt;br /&gt;
; &amp;lt;code&amp;gt;dispatch&amp;lt;/code&amp;gt;&lt;br /&gt;
: What action &amp;lt;code&amp;gt;mod_hitfind&amp;lt;/code&amp;gt; is to take.  The value should be &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; for indexing.&lt;br /&gt;
; &amp;lt;code&amp;gt;integration_dirname&amp;lt;/code&amp;gt;&lt;br /&gt;
: Directory portion of output integration file pathname.&lt;br /&gt;
; &amp;lt;code&amp;gt;integration_basename&amp;lt;/code&amp;gt;&lt;br /&gt;
: Filename prefix of output integration file pathname.&lt;br /&gt;
; &amp;lt;code&amp;gt;xtal_target&amp;lt;/code&amp;gt;&lt;br /&gt;
: &#039;&#039;[[phil]]&#039;&#039;-file containing further configuration options for the indexing and integration algorithms.  Descriptions of these parameters are found on the &#039;&#039;[[phil]]&#039;&#039; section of the tutorial.&lt;br /&gt;
&lt;br /&gt;
The integration file is not an image file, but a list of Miller indices, their integrated intensities, and estimated uncertainties.  The actual pathname of the integration file as it is written to the file system is determined by joining out_dirname and out_basename using the directory separator (/ on Unix), and appending a textual representation of the timestamp when the corresponding image was recorded.&lt;br /&gt;
&lt;br /&gt;
== Processing the tutorial data ==&lt;br /&gt;
To submit a processing job to the cluster, execute the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd ~/myrelease&lt;br /&gt;
$ sit_setup&lt;br /&gt;
$ cp /reg/g/cctbx/tutorials/indexing/Ls04-lysozyme.cfg .&lt;br /&gt;
$ cxi.lsf \&lt;br /&gt;
    -c Ls04-lysozyme.cfg -i /reg/d/ana11/cxi/data/Mar2013calib/xtc \&lt;br /&gt;
    -o /reg/g/cctbx/tutorials/scratch/&amp;lt;username&amp;gt;/lysozyme \&lt;br /&gt;
    -p 6 -q psanacsq  -r 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To minimize the load on the cluster during the tutorial, please do not submit more than one run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
How to monitor progress, check on number of hits, number of integrated images.  How to inspect sample images. etc&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=100</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=100"/>
		<updated>2014-02-07T11:02:13Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Cleanup.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Nightly bundles are stored in /net/cci/auto_build/cctbx/results.  The script to generate the labelit bundles is at ~/projects/doc/make_labelit_source_bundle.sh. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Long-standing gremlin: it appears that for initial installs, it is necessary to run make twice!  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Maintaining_an_installation&amp;diff=420</id>
		<title>Maintaining an installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Maintaining_an_installation&amp;diff=420"/>
		<updated>2014-02-07T10:56:23Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Unified maintenance for regular users and developers.i&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Keeping up to date with PSDM releases==&lt;br /&gt;
&lt;br /&gt;
Since the &#039;&#039;cctbx.xfel&#039;&#039; modules do not critically depend on any particular version of &#039;&#039;pyana&#039;&#039;, it is generally safe to closely track the latest version of the PSDM software distribution.  To upgrade to the current PSDM release,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ relupgrade ana-current&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; must be substituted for path of the test release.  The &#039;&#039;cctbx.xfel&#039;&#039; modules should then be rebuilt using&lt;br /&gt;
 $ scons -c&lt;br /&gt;
 $ scons&lt;br /&gt;
It is possible to manually edit &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/.sit_release&amp;lt;/code&amp;gt; to contain &amp;lt;code&amp;gt;ana-current&amp;lt;/code&amp;gt; instead of a particular version number.  This ensures that the latest version of the PSDM software distribution is used during each session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Keeping a developer installation up to date ==&lt;br /&gt;
&lt;br /&gt;
Given the rapid development of the &#039;&#039;PHENIX&#039;&#039; suite, it is recommended to update the sources and rebuild often. Certain changes may require the configure command (or &amp;lt;code&amp;gt;libtbx.refresh&amp;lt;/code&amp;gt;) to be rerun.&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ ./allsvn update&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
&amp;lt;!-- XXX How often should one do something about the hot tarballs (i.e. annlib_hot.tar.gz, boost_hot.tar.gz, and scons_hot.tar.gz)? XXX See also Nick’s note at the end of document about the New framework for specifying crystal targets. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=99</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=99"/>
		<updated>2014-02-07T10:39:23Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Unified prerequisites for regular users and developers.i&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Nightly bundles are stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
&amp;lt;!-- XXX Why is this PHENIX when we really want cctbx.xfel --&amp;gt;&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- It used to be necessary to run make twice, but that seems to no longer be the case.  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=98</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=98"/>
		<updated>2014-02-07T10:37:57Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Unified compilation for regular users and developers.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Nightly bundles are stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
&amp;lt;!-- XXX Why is this PHENIX when we really want cctbx.xfel --&amp;gt;&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- It used to be necessary to run make twice, but that seems to no longer be the case.  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=97</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=97"/>
		<updated>2014-02-07T10:31:45Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Unified configuration for regular users and developers.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Nightly bundles are stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
&amp;lt;!-- XXX Why is this PHENIX when we really want cctbx.xfel --&amp;gt;&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory, &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below, using the Python interpreter located using the above find command.  The build directory is often located next to the source directory (&amp;lt;code&amp;gt;~/projects/phenix-build&amp;lt;/code&amp;gt; is a common developer choice).&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel&lt;br /&gt;
&amp;lt;!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=96</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=96"/>
		<updated>2014-02-07T10:18:02Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Unified source setup for regular users and developers.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Note again that several sites already have &#039;&#039;cctbx.xfel&#039;&#039; installed, and that this step can be skipped for regular users not involved in the development of the software.  Once &#039;&#039;cctbx.xfel&#039;&#039; has been installed it must be [[Setup | set up]] before it can be used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download and extract a source tree ==&lt;br /&gt;
&lt;br /&gt;
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas &amp;lt;code&amp;gt;~/projects/phenix-src&amp;lt;/code&amp;gt; is a common choice among developers).  The directory must accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
&lt;br /&gt;
=== Regular users ===&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Nightly bundles are stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Why is this PHENIX when we really want cctbx.xfel --&amp;gt;&lt;br /&gt;
A user account on cci.lbl.gov is required, the name of which is to be substituted for &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; below. &lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ svn export svn+ssh://&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh&lt;br /&gt;
 $ ./phenix_svn_getting_started.csh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ rm phenix_svn_getting_started.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory ==&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
The Python interpreter required for the next step must be the same interpreter provided by the PSDM software distribution.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.  The name and location of the build directory is arbitrary; &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_build&amp;lt;/code&amp;gt; is a common choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
&lt;br /&gt;
Initialise the running shell using the newly created configuration files.  bash-users should&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users will instead need to run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  &lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=345</id>
		<title>Set up PSDM software</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=345"/>
		<updated>2014-02-07T09:43:41Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Migrated note about prompt.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ mbox&lt;br /&gt;
| type = notice&lt;br /&gt;
| text = Note that throughout the instructions &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the commands typed to the shell.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The [https://confluence.slac.stanford.edu/display/PCDS/Data+Management Photon Science Data Management (PSDM)] software distribution must be installed.  The PSDM software distribution provides &#039;&#039;pyana&#039;&#039;, which is a critical dependency of &#039;&#039;cctbx.xfel&#039;&#039;.  Its installation root directory affects the absolute paths used in the following instructions and differs from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Installation root directory&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/net/viper/raid1/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
| Only available on viper.lbl.gov&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
The PSDM software distribution is supported on the most popular flavors of Linux and is installed at several sites worldwide.  Separate installation and maintenance instructions are provided by the PSDM project at [https://confluence.slac.stanford.edu/display/PCDS/PSDM+software+distribution PSDM software distribution].  The package can be installed anywhere on the filesystem, and it is generally possible to install it without superuser privileges.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a test release and an analysis package ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;i&amp;gt;test release&amp;lt;/i&amp;gt;, which refers to a particular release of the PSDM distribution, is represented by a directory in the file system, often called &amp;lt;code&amp;gt;analysis-rel&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;myrelease&amp;lt;/code&amp;gt;. An analysis package within the test release in turn refers to the files implementing the analysis modules of the package. Details about test releases and analysis packages are covered in [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  To prepare the environment for using the PSDM software distribution, bash-users should source &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt;,&lt;br /&gt;
 $ . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with the path to the installation root directory.  csh-users should source &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; instead,&lt;br /&gt;
 % source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; only modifies the environment of the &amp;lt;em&amp;gt;current shell&amp;lt;/em&amp;gt;, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh &amp;amp;&amp;amp; . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh &amp;amp;&amp;amp; source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.  This ensures the environment is properly prepared for non-interactive shells, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; the shells that are used to run jobs submitted to the cluster.  To also be able to use the PSDM software from interactive shells, it is recommended that bash-users put&lt;br /&gt;
 test -r ~/.bashrc &amp;amp;&amp;amp; . ~/.bashrc&lt;br /&gt;
near the top of &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt;.  There is no need to edit any additional files for csh-users, because csh always reads &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A test released based on the most current PSDM distribution is then set up in the current working directory using&lt;br /&gt;
 $ newrel ana-current &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ newpkg &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&lt;br /&gt;
Note that the names for the test release and the analysis package, &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt; above, are common, but nevertheless arbitrary, choices.&lt;br /&gt;
&lt;br /&gt;
These steps only need to be performed once.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Pyana+User+Manual Pyana User Manual]&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Packages+and+Releases Analysis Workbook. Packages and Releases]&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Setup&amp;diff=135</id>
		<title>Setup</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Setup&amp;diff=135"/>
		<updated>2014-02-07T09:40:06Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Cleanup.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- XXX Should probably rename this page to &amp;quot;Set up &#039;&#039;cctbx.xfel&#039;&#039;&amp;quot; or some such --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisities ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; must be [[Installation | installed]] before it can be used.  The installation root directories affect the absolute paths used in the following instructions and differ from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Installation build directory&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Installation source directory&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys_test/cctbx/cctbx_build&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys_test/cctbx&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| No central, shared installation available&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/cctbx/build&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/cctbx/sources&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; can be installed anywhere on the filesystem where write access is granted.  Developers will generally have &#039;&#039;cctbx.xfel&#039;&#039; installed in their home directory.  Even if &#039;&#039;cctbx.xfel&#039;&#039; is already installed, the environment must first be [[Set up PSDM software | prepared for the PSDM software distribution]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;cctbx.xfel&#039;&#039; setup ==&lt;br /&gt;
&lt;br /&gt;
To start using &#039;&#039;cctbx.xfel&#039;&#039;, the environment has to be configured.  The details depend on the &#039;&#039;cctbx.xfel&#039;&#039; installation root directories and the user&#039;s shell.&lt;br /&gt;
In what follows &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with the actual build  and source directories of the &#039;&#039;cctbx.xfel&#039;&#039; installation.  bash-users can prepare the environment for &#039;&#039;cctbx.xfel&#039;&#039; using&lt;br /&gt;
 $ . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh&lt;br /&gt;
From a csh, the corresponding command is&lt;br /&gt;
 % source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;setpaths&amp;lt;/code&amp;gt; only modifies the environment of the &amp;lt;em&amp;gt;current shell&amp;lt;/em&amp;gt;, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh &amp;amp;&amp;amp; \&lt;br /&gt;
   . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh &amp;amp;&amp;amp; \&lt;br /&gt;
   source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/reg/g/cctbx/build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/setpaths.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.&lt;br /&gt;
&lt;br /&gt;
To make the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules available to PSDM&#039;s &#039;&#039;pyana&#039;&#039;,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ ln -fns &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/xfel/cxi/cspad_ana src&lt;br /&gt;
 $ cd ..&lt;br /&gt;
 $ ln -s &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/sources&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/xfel/cxi/lsf.sh .&lt;br /&gt;
 $ scons&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; are the path to the test release and the name of the analysis package chosen while [[Set up PSDM software | setting up the PSDM software distribution]].  The last step compiles the &#039;&#039;cctbx.xfel&#039;&#039; analysis modules.  These steps need only be performed once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
At SLAC, test that it is working by &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cxi.pyana -c /reg/g/cctbx/tutorials/setup/test.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0004-s00-c00.xtc&lt;br /&gt;
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 &#039;&#039;pyana&#039;&#039; with a configuration file (&amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt;) and an XTC file.  For more information, see the [[Overview]] and other tutorial pages.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Maintaining_an_installation&amp;diff=419</id>
		<title>Maintaining an installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Maintaining_an_installation&amp;diff=419"/>
		<updated>2014-02-07T08:31:47Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Migrated text from PSDM page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Keeping up to date with PSDM releases==&lt;br /&gt;
&lt;br /&gt;
Since the &#039;&#039;cctbx.xfel&#039;&#039; modules do not critically depend on any particular version of &#039;&#039;pyana&#039;&#039;, it is generally safe to closely track the latest version of the PSDM software distribution.  To upgrade to the current PSDM release,&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ relupgrade ana-current&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; must be substituted for path of the test release.  The &#039;&#039;cctbx.xfel&#039;&#039; modules should then be rebuilt using&lt;br /&gt;
 $ scons -c&lt;br /&gt;
 $ scons&lt;br /&gt;
It is possible to manually edit &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/test/release&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/.sit_release&amp;lt;/code&amp;gt; to contain &amp;lt;code&amp;gt;ana-current&amp;lt;/code&amp;gt; instead of a particular version number.  This ensures that the latest version of the PSDM software distribution is used during each session.&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=344</id>
		<title>Set up PSDM software</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=344"/>
		<updated>2014-02-07T08:21:40Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Simplification.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The [https://confluence.slac.stanford.edu/display/PCDS/Data+Management Photon Science Data Management (PSDM)] software distribution must be installed.  The PSDM software distribution provides &#039;&#039;pyana&#039;&#039;, which is a critical dependency of &#039;&#039;cctbx.xfel&#039;&#039;.  Its installation root directory affects the absolute paths used in the following instructions and differs from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Installation root directory&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/net/viper/raid1/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
| Only available on viper.lbl.gov&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
The PSDM software distribution is supported on the most popular flavors of Linux and is installed at several sites worldwide.  Separate installation and maintenance instructions are provided by the PSDM project at [https://confluence.slac.stanford.edu/display/PCDS/PSDM+software+distribution PSDM software distribution].  The package can be installed anywhere on the filesystem, and it is generally possible to install it without superuser privileges.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a test release and an analysis package ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;i&amp;gt;test release&amp;lt;/i&amp;gt;, which refers to a particular release of the PSDM distribution, is represented by a directory in the file system, often called &amp;lt;code&amp;gt;analysis-rel&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;myrelease&amp;lt;/code&amp;gt;. An analysis package within the test release in turn refers to the files implementing the analysis modules of the package. Details about test releases and analysis packages are covered in [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  To prepare the environment for using the PSDM software distribution, bash-users should source &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt;,&lt;br /&gt;
 $ . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with the path to the installation root directory.  csh-users should source &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; instead,&lt;br /&gt;
 % source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; only modifies the environment of the &amp;lt;em&amp;gt;current shell&amp;lt;/em&amp;gt;, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh &amp;amp;&amp;amp; . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh &amp;amp;&amp;amp; source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.  This ensures the environment is properly prepared for non-interactive shells, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; the shells that are used to run jobs submitted to the cluster.  To also be able to use the PSDM software from interactive shells, it is recommended that bash-users put&lt;br /&gt;
 test -r ~/.bashrc &amp;amp;&amp;amp; . ~/.bashrc&lt;br /&gt;
near the top of &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt;.  There is no need to edit any additional files for csh-users, because csh always reads &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A test released based on the most current PSDM distribution is then set up in the current working directory using&lt;br /&gt;
 $ newrel ana-current &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ newpkg &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&lt;br /&gt;
Note that the names for the test release and the analysis package, &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt; above, are common, but nevertheless arbitrary, choices.&lt;br /&gt;
&lt;br /&gt;
These steps only need to be performed once.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Pyana+User+Manual Pyana User Manual]&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Packages+and+Releases Analysis Workbook. Packages and Releases]&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=343</id>
		<title>Set up PSDM software</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=343"/>
		<updated>2014-02-07T08:18:55Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Cleanup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The [https://confluence.slac.stanford.edu/display/PCDS/Data+Management Photon Science Data Management (PSDM)] software distribution must be installed.  The PSDM software distribution provides &#039;&#039;pyana&#039;&#039;, which is a critical dependency of &#039;&#039;cctbx.xfel&#039;&#039;.  Its installation root directory affects the absolute paths used in the following instructions and differs from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Installation root directory&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/net/viper/raid1/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
| Only available on viper.lbl.gov&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
The PSDM software distribution is supported on the most popular flavors of Linux and is installed at several sites worldwide.  Separate installation and maintenance instructions are provided by the PSDM project at [https://confluence.slac.stanford.edu/display/PCDS/PSDM+software+distribution PSDM software distribution].  The package can be installed anywhere on the filesystem, and it is generally possible to install it without superuser privileges.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a test release and an analysis package ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;i&amp;gt;test release&amp;lt;/i&amp;gt;, which refers to a particular release of the PSDM distribution, is represented by a directory in the file system, often called &amp;lt;code&amp;gt;analysis-rel&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;myrelease&amp;lt;/code&amp;gt;. An analysis package within the test release in turn refers to the files implementing the analysis modules of the package. Details about test releases and analysis packages are covered in [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  To prepare the environment for using the PSDM software distribution, bash-users should source &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt;,&lt;br /&gt;
 $ . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with the path to the installation root directory.  csh-users should source &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; instead,&lt;br /&gt;
 % source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; only modifies the environment of the &amp;lt;em&amp;gt;current shell&amp;lt;/em&amp;gt;, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh &amp;amp;&amp;amp; . &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh &amp;amp;&amp;amp; source &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/psdm&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/etc/ana_env.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.  This ensures the environment is properly prepared for non-interactive shells, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; the shells that are used to run jobs submitted to the cluster.  To also be able to use the PSDM software from interactive shells, it is recommended that bash-users put&lt;br /&gt;
 test -r ~/.bashrc &amp;amp;&amp;amp; . ~/.bashrc&lt;br /&gt;
near the top of &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt;.  There is no need to edit any additional files for csh-users, because csh always reads &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A test released based on the most current PSDM distribution is then set up in the current working directory using&lt;br /&gt;
 $ newrel ana-current &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ newpkg &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&lt;br /&gt;
Note that the names for the test release and the analysis package, &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt; above, as well as the location of the &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt; directory are common, but nevertheless arbitrary, choices.&lt;br /&gt;
&lt;br /&gt;
These steps only need to be performed once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Pyana+User+Manual Pyana User Manual]&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Packages+and+Releases Analysis Workbook. Packages and Releases]&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=95</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=95"/>
		<updated>2014-02-07T07:22:24Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Typo.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document aims to be a step-by-step installation guide for &#039;&#039;cctbx.xfel&#039;&#039;.  Note that in this text &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The user prompt is distinct from &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, which denotes the prompt of the superuser.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the command typed to the shell.  This installation can be performed by any regular user—no superuser privileges are required.&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = notice&lt;br /&gt;
| text = Installing &#039;&#039;cctbx.xfel&#039;&#039; is not necessary for most users, as &#039;&#039;cctbx.xfel&#039;&#039; is installed at SLAC already and is generally accessible.  General users should instead go to [[setup]] to configure their unix account at SLAC to run &#039;&#039;cctbx.xfel.&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
See [[Set up PSDM software]].  It is assumed that &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; has been sourced, a release directory has been configured in &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel&amp;lt;/code&amp;gt;, and that an empty analysis package has been set up in &amp;lt;code&amp;gt;~/myrelease/my_ana_pkg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel/my_ana_pkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX In addition, these software packages need to be available: reportlab, h5py, etc --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download and extract &#039;&#039;cctbx&#039;&#039; and &#039;&#039;LABELIT&#039;&#039; source bundles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Seems to be important to source ana_env.sh before building! XXX Stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is probably the only place where the developer installation is different from the standard installation.  Investigate and accommodate! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that developers should follow the instructions in [[Installation for developers]] instead.  This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate. The directory should accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Extract the sources:&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is duplicated in the developer instructions! --&amp;gt;&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
This next two steps require access to a C++ compiler and a Python interpreter.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.  The name and location of the build directory is arbitrary; &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_build&amp;lt;/code&amp;gt; is a common choice.&lt;br /&gt;
&lt;br /&gt;
Now, initialise the running shell using the newly created configuration files.  bash-users should do&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users should instead run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
If building at SLAC, log into one of the psanacs nodes. Then compile:&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=94</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=94"/>
		<updated>2014-02-07T07:18:23Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Used mbox for leading note.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document aims to be a step-by-step installation guide for &#039;&#039;cctbx.xfel&#039;&#039;.  Note that in this text &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The user prompt is distinct from &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, which denotes the prompt of the superuser.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the command typed to the shell.  This installation can be performed by any regular user—no superuser privileges are required.&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = notice&lt;br /&gt;
| text = installing &#039;&#039;cctbx.xfel&#039;&#039; is not necessary for most users, as &#039;&#039;cctbx.xfel&#039;&#039; is installed at SLAC already and is generally accessible.  General users should instead go to [[setup]] to configure their unix account at SLAC to run &#039;&#039;cctbx.xfel.&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
See [[Set up PSDM software]].  It is assumed that &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; has been sourced, a release directory has been configured in &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel&amp;lt;/code&amp;gt;, and that an empty analysis package has been set up in &amp;lt;code&amp;gt;~/myrelease/my_ana_pkg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel/my_ana_pkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX In addition, these software packages need to be available: reportlab, h5py, etc --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download and extract &#039;&#039;cctbx&#039;&#039; and &#039;&#039;LABELIT&#039;&#039; source bundles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Seems to be important to source ana_env.sh before building! XXX Stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is probably the only place where the developer installation is different from the standard installation.  Investigate and accommodate! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that developers should follow the instructions in [[Installation for developers]] instead.  This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate. The directory should accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Extract the sources:&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is duplicated in the developer instructions! --&amp;gt;&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
This next two steps require access to a C++ compiler and a Python interpreter.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.  The name and location of the build directory is arbitrary; &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_build&amp;lt;/code&amp;gt; is a common choice.&lt;br /&gt;
&lt;br /&gt;
Now, initialise the running shell using the newly created configuration files.  bash-users should do&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users should instead run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
If building at SLAC, log into one of the psanacs nodes. Then compile:&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=93</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=93"/>
		<updated>2014-02-07T07:16:40Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Used mbox for the warning.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;IMPORTANT: installing &#039;&#039;cctbx.xfel&#039;&#039; is not necessary for most users, as &#039;&#039;cctbx.xfel&#039;&#039; is installed at SLAC already and is generally accessible.  General users should instead go to [[setup]] to configure their unix account at SLAC to run &#039;&#039;cctbx.xfel.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This document aims to be a step-by-step installation guide for &#039;&#039;cctbx.xfel&#039;&#039;.  Note that in this text &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The user prompt is distinct from &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, which denotes the prompt of the superuser.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the command typed to the shell.  This installation can be performed by any regular user—no superuser privileges are required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
See [[Set up PSDM software]].  It is assumed that &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; has been sourced, a release directory has been configured in &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel&amp;lt;/code&amp;gt;, and that an empty analysis package has been set up in &amp;lt;code&amp;gt;~/myrelease/my_ana_pkg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel/my_ana_pkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX In addition, these software packages need to be available: reportlab, h5py, etc --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download and extract &#039;&#039;cctbx&#039;&#039; and &#039;&#039;LABELIT&#039;&#039; source bundles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Seems to be important to source ana_env.sh before building! XXX Stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is probably the only place where the developer installation is different from the standard installation.  Investigate and accommodate! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that developers should follow the instructions in [[Installation for developers]] instead.  This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate. The directory should accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
{{ mbox&lt;br /&gt;
| type = speedy&lt;br /&gt;
| text = New bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.  Also note that the labelit_bundle cannot currently be downloaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Extract the sources:&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is duplicated in the developer instructions! --&amp;gt;&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
This next two steps require access to a C++ compiler and a Python interpreter.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.  The name and location of the build directory is arbitrary; &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_build&amp;lt;/code&amp;gt; is a common choice.&lt;br /&gt;
&lt;br /&gt;
Now, initialise the running shell using the newly created configuration files.  bash-users should do&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users should instead run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
If building at SLAC, log into one of the psanacs nodes. Then compile:&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Ambox_speedy_deletion.png&amp;diff=418</id>
		<title>File:Ambox speedy deletion.png</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Ambox_speedy_deletion.png&amp;diff=418"/>
		<updated>2014-02-07T07:12:43Z</updated>

		<summary type="html">&lt;p&gt;Hattne: http://commons.wikimedia.org/wiki/File:Ambox_speedy_deletion.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://commons.wikimedia.org/wiki/File:Ambox_speedy_deletion.png&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Ambox_notice.png&amp;diff=417</id>
		<title>File:Ambox notice.png</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Ambox_notice.png&amp;diff=417"/>
		<updated>2014-02-07T07:10:49Z</updated>

		<summary type="html">&lt;p&gt;Hattne: http://en.wikipedia.org/wiki/File:Ambox_notice.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://en.wikipedia.org/wiki/File:Ambox_notice.png&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Imbox_notice.png&amp;diff=416</id>
		<title>File:Imbox notice.png</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Imbox_notice.png&amp;diff=416"/>
		<updated>2014-02-07T02:12:32Z</updated>

		<summary type="html">&lt;p&gt;Hattne: http://commons.wikimedia.org/wiki/File:Imbox_notice.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://commons.wikimedia.org/wiki/File:Imbox_notice.png&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Lua-logo-nolabel.svg&amp;diff=415</id>
		<title>File:Lua-logo-nolabel.svg</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Lua-logo-nolabel.svg&amp;diff=415"/>
		<updated>2014-02-07T02:10:39Z</updated>

		<summary type="html">&lt;p&gt;Hattne: http://commons.wikimedia.org/wiki/File:Lua-logo-nolabel.svg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://commons.wikimedia.org/wiki/File:Lua-logo-nolabel.svg&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Edit-copy_green.svg&amp;diff=414</id>
		<title>File:Edit-copy green.svg</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Edit-copy_green.svg&amp;diff=414"/>
		<updated>2014-02-07T01:44:07Z</updated>

		<summary type="html">&lt;p&gt;Hattne: http://commons.wikimedia.org/wiki/File:Edit-copy_green.svg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://commons.wikimedia.org/wiki/File:Edit-copy_green.svg&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Imbox_content.png&amp;diff=413</id>
		<title>File:Imbox content.png</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Imbox_content.png&amp;diff=413"/>
		<updated>2014-02-06T21:46:34Z</updated>

		<summary type="html">&lt;p&gt;Hattne: http://commons.wikimedia.org/wiki/File:Imbox_content.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://commons.wikimedia.org/wiki/File:Imbox_content.png&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Template-info.png&amp;diff=412</id>
		<title>File:Template-info.png</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=File:Template-info.png&amp;diff=412"/>
		<updated>2014-02-06T20:48:40Z</updated>

		<summary type="html">&lt;p&gt;Hattne: From http://commons.wikimedia.org/wiki/File:Template-info.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;From http://commons.wikimedia.org/wiki/File:Template-info.png&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_ssh-agent&amp;diff=320</id>
		<title>Set up ssh-agent</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_ssh-agent&amp;diff=320"/>
		<updated>2014-02-05T21:41:20Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Nitpicks.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Checking out or updating the &#039;&#039;PHENIX&#039;&#039; sources will establish many ssh-connections to several servers hosting the source repositories.  While not necessary for a successful installation, having an ssh-agent running on the machine used to access the repositories will save much error-prone password-typing.  The idea is to provide the remote server with the public half of a cryptographic key pair, which enables it to encrypt a randomly generated challenge and send it to the ssh-agent.  If the agent has acquired the corresponding private key it can respond with the decrypted challenge, thereby proving to the remote server that it has access to the decrypted private key.  The ssh-agent has authenticated with the server without any user intervention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a cryptographic key pair ==&lt;br /&gt;
&lt;br /&gt;
The first step is to generate a complementary pair of cryptographic keys.  This step can be skipped if a key pair already exists—it is perfectly safe to use the same key pair to authenticate with any number of remote systems.  One of the keys is public and the other is private.  The public component of the key pair can be freely distributed without compromising security; indeed, any system one wishes to authenticate with will need access to the public key.  The private component must be kept secret.  In addition, the private key can be encrypted using a passphrase without which it cannot be used.  It is possible to generate a key pair without a passphrase, but then anybody who gains access to the key also acquires access to all systems the key unlocks.&lt;br /&gt;
&lt;br /&gt;
In the example below, an RSA key pair is generated in the default location, &amp;lt;i&amp;gt;/home/user/.ssh/id_rsa&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;/home/user/.ssh/id_rsa.pub&amp;lt;/i&amp;gt;.  The passphrase should be complex—when using ssh-agent one will not need to type it very often.  &lt;br /&gt;
 $ ssh-keygen&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Enter file in which to save the key (&amp;lt;i&amp;gt;/home/user/.ssh/id_rsa&amp;lt;/i&amp;gt;): &amp;lt;b&amp;gt;[PRESS RETURN]&amp;lt;/b&amp;gt;&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &amp;lt;b&amp;gt;[ENTER A COMPLEX PASSPHRASE AND PRESS RETURN]&amp;lt;/b&amp;gt;&lt;br /&gt;
 Enter same passphrase again: &amp;lt;b&amp;gt;[REPEAT COMPLEX PASSPHRASE AND PRESS RETURN]&amp;lt;/b&amp;gt;&lt;br /&gt;
 Your identification has been saved in &amp;lt;i&amp;gt;/home/user/.ssh/id_rsa&amp;lt;/i&amp;gt;.&lt;br /&gt;
 Your public key has been saved in &amp;lt;i&amp;gt;/home/user/.ssh/id_rsa.pub&amp;lt;/i&amp;gt;.&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 &amp;lt;i&amp;gt;ba:f2:7a:78:aa:b0:33:1d:53:de:63:01:62:15:d6:c9 user@host&amp;lt;/i&amp;gt;&lt;br /&gt;
Then, start the ssh-agent, and add the decrypted private key of the newly generated key pair to the ssh-agent&#039;s cache.&lt;br /&gt;
 $ eval `ssh-agent`&lt;br /&gt;
 $ ssh-add&lt;br /&gt;
 Enter passphrase for &amp;lt;i&amp;gt;/home/user/.ssh/id_rsa&amp;lt;/i&amp;gt;: &amp;lt;b&amp;gt;[ENTER COMPLEX PASSPHRASE AND PRESS RETURN]&amp;lt;/b&amp;gt;&lt;br /&gt;
 Identity added: &amp;lt;i&amp;gt;/home/user/.ssh/id_rsa&amp;lt;/i&amp;gt; (&amp;lt;i&amp;gt;/home/user/.ssh/id_rsa&amp;lt;/i&amp;gt;)&lt;br /&gt;
New ssh-processes will now act as clients to the ssh-agent, and attempt to use the keys it holds to authenticate with the remote system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Distribute the public key to the remote system ==&lt;br /&gt;
&lt;br /&gt;
The remote system needs access to the public component of the key pair to generate the authenticating challenge for the ssh-agent.  This means that the &amp;lt;em&amp;gt;public&amp;lt;/em&amp;gt; component of the key pair has to be present in &amp;lt;code&amp;gt;~/.ssh/authorized_keys&amp;lt;/code&amp;gt; on the remote system.&lt;br /&gt;
 $ cat ~/.ssh/id_rsa.pub | ssh &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;user@remote.host&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;quot;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&amp;quot;&lt;br /&gt;
This will append the public key of the recently created key pair to &amp;lt;code&amp;gt;~/.ssh/authorized_keys&amp;lt;/code&amp;gt; on the &amp;lt;em&amp;gt;remote&amp;lt;/em&amp;gt; system.  It is now possible to access &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;remote.host&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; without typing a password on the command line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Distribute the public key to SourceForge ===&lt;br /&gt;
&lt;br /&gt;
The servers at SourceForge can be made aware of the public key, too.  To do so, access the account from the web interface and navigate to [http://sourceforge.net/account/services SSH Settings], and choose [https://sourceforge.net/account/ssh Edit SSH Keys for Shell/CVS].  The public key can now be pasted into the text box.  Note that it may take several minutes for the change to take effect.&lt;br /&gt;
&lt;br /&gt;
== Using &#039;&#039;keychain&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
An ssh-agent started from command line only affects ssh-connections started from the same shell, and separate ssh-agents would be required for each new login shell.  The private key would have to be decrypted from every login shell separately.  Furthermore, ssh-agents are not necessarily terminated when the login shell exits, potentially cluttering the system with orphaned ssh-agents.  &#039;&#039;keychain&#039;&#039; is a shell script that was written to avoid this situation: it probes the system for any running ssh-agents, and attempts to use a running agent instead of starting a new daemon.  If no ssh-agents are running, &#039;&#039;keychain&#039;&#039; starts a new process and uses ssh-add to add the specified private keys.&lt;br /&gt;
&lt;br /&gt;
At CCI and SLAC &#039;&#039;keychain&#039;&#039; is installed at &amp;lt;code&amp;gt;~hattne/gentoo/usr/bin/keychain&amp;lt;/code&amp;gt;.  At NERSC it is at &amp;lt;code&amp;gt;/global/project/projectdirs/lcls/gentoo/usr/bin/keychain&amp;lt;/code&amp;gt;.  It is recommended to run &#039;&#039;keychain&#039;&#039; from the shell configuration files for interactive, login shells.  To do so, bash-users can add the following lines to their &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt;:&lt;br /&gt;
  test -x &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/keychain&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;amp;&amp;amp; \&lt;br /&gt;
    eval `&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/keychain&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; --agents ssh --eval id_rsa --inherit any-once --stop others`&lt;br /&gt;
csh-users would modify &amp;lt;code&amp;gt;~/.login&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Using agent forwarding ==&lt;br /&gt;
&lt;br /&gt;
It is not necessary to start ssh-agents on every system logged in to.  If an ssh-agent is running on the host used to access a remote system, a connection to the agent can be forwarded using the ssh’s &amp;lt;code&amp;gt;-A&amp;lt;/code&amp;gt; option.  Any ssh-processes on the remote system will now query the ssh-agent on the host logged in from.  &#039;&#039;keychain&#039;&#039; will recognize that agent-forwarding is in effect and will not start a new agent on the remote system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-agent OpenBSD manual pages: ssh-agent]&lt;br /&gt;
* [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen OpenBSD manual pages: ssh-keygen]&lt;br /&gt;
* [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-add OpenBSD manual pages: ssh-add]&lt;br /&gt;
* [https://sourceforge.net/apps/trac/sourceforge/wiki/SSH%20keys SSH keys - SourceForge]&lt;br /&gt;
* [http://www.funtoo.org/Keychain Keychain—Funtoo]&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=92</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=92"/>
		<updated>2014-02-05T21:37:03Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Point to finalizing the installation using instructions in Setup.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;IMPORTANT: installing &#039;&#039;cctbx.xfel&#039;&#039; is not necessary for most users, as &#039;&#039;cctbx.xfel&#039;&#039; is installed at SLAC already and is generally accessible.  General users should instead go to [[setup]] to configure their unix account at SLAC to run &#039;&#039;cctbx.xfel.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This document aims to be a step-by-step installation guide for &#039;&#039;cctbx.xfel&#039;&#039;.  Note that in this text &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The user prompt is distinct from &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, which denotes the prompt of the superuser.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the command typed to the shell.  This installation can be performed by any regular user—no superuser privileges are required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
See [[Set up PSDM software]].  It is assumed that &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; has been sourced, a release directory has been configured in &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel&amp;lt;/code&amp;gt;, and that an empty analysis package has been set up in &amp;lt;code&amp;gt;~/myrelease/my_ana_pkg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel/my_ana_pkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX In addition, these software packages need to be available: reportlab, h5py, etc --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download and extract &#039;&#039;cctbx&#039;&#039; and &#039;&#039;LABELIT&#039;&#039; source bundles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Seems to be important to source ana_env.sh before building! XXX Stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is probably the only place where the developer installation is different from the standard installation.  Investigate and accommodate! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that developers should follow the instructions in [[Installation for developers]] instead.  This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate. The directory should accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
Note: new bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation. &amp;lt;!-- This should probably be some kind of warning box, see http://www.mediawiki.org/wiki/Template:Mbox XXX Note also that downloads of the labelit bundle are intentionally &amp;quot;disabled&amp;quot;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the sources:&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is duplicated in the developer instructions! --&amp;gt;&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
This next two steps require access to a C++ compiler and a Python interpreter.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.  The name and location of the build directory is arbitrary; &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_build&amp;lt;/code&amp;gt; is a common choice.&lt;br /&gt;
&lt;br /&gt;
Now, initialise the running shell using the newly created configuration files.  bash-users should do&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users should instead run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
If building at SLAC, log into one of the psanacs nodes. Then compile:&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.  To finalize the installation, see [[Setup]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=342</id>
		<title>Set up PSDM software</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Set_up_PSDM_software&amp;diff=342"/>
		<updated>2014-02-05T21:20:59Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Comments, thanks to mamin@.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX What&#039;s PSDM? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PSDM software distribution must be installed.  PSDM provides installation and maintenance instructions at [https://confluence.slac.stanford.edu/display/PCDS/PSDM+software+distribution PSDM software distribution].  The distribution can be installed anywhere on the filesystem; it is generally possible to install the PSDM software distribution without superuser privileges.&lt;br /&gt;
&lt;br /&gt;
The installation root directory affects the absolute paths used in these instructions and differs from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Installation root directory&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/net/viper/raid1/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
| Only available on viper.lbl.gov&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/psdm&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Create a test release and an analysis package ==&lt;br /&gt;
&lt;br /&gt;
In what follows it is assumed that the PSDM software distribution is installed at &amp;lt;code&amp;gt;/reg/g/psdm&amp;lt;/code&amp;gt;.  Substitute &amp;lt;code&amp;gt;/reg/g/psdm&amp;lt;/code&amp;gt; with the appropriate path in the instructions below.  These steps only need to be performed once.&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;test release&#039;&#039;, which refers to a particular release of the LCLS packages, is represented by a directory in the file system, often called &amp;lt;code&amp;gt;analysis-rel&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;myrelease&amp;lt;/code&amp;gt;. 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 [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  In a bash shell, the environment is prepared for PSDM using&lt;br /&gt;
 $ . /reg/g/psdm/etc/ana_env.sh&lt;br /&gt;
For csh, the corresponding command is&lt;br /&gt;
 % source /reg/g/psdm/etc/ana_env.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; only modifies the environment of the current shell, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r /reg/g/psdm/etc/ana_env.sh &amp;amp;&amp;amp; . /reg/g/psdm/etc/ana_env.sh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r /reg/g/psdm/etc/ana_env.csh &amp;amp;&amp;amp; source /reg/g/psdm/etc/ana_env.csh&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt; as appropriate.&lt;br /&gt;
&lt;br /&gt;
This ensures the environment is properly prepared for non-interactive shells, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; the shells that are used to run jobs submitted to the cluster.  To also be able to use the PSDM software from interactive shells, it is recommended that bash-users put&lt;br /&gt;
 test -r &amp;quot;${HOME}/.bashrc&amp;quot; &amp;amp;&amp;amp; . &amp;quot;${HOME}/.bashrc&amp;quot;&lt;br /&gt;
near the top of &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt;.  There is no need to edit any additional files for csh-users, because csh always reads &amp;lt;code&amp;gt;~/.cshrc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A test released based on the most current LCLS software is then set up in the current working directory using&lt;br /&gt;
 $ newrel ana-current &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ newpkg &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;&lt;br /&gt;
Note that the names for the test release and the analysis package, &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;my_ana_pkg&amp;lt;/i&amp;gt;, as well as the location of the &amp;lt;i&amp;gt;myrelease&amp;lt;/i&amp;gt; directory are common, but nevertheless arbitrary, choices.&lt;br /&gt;
&lt;br /&gt;
== Keeping up to date with PSDM releases==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX THIS IS NOT TO BE RUN UNTIL LATER --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the &#039;&#039;cctbx.xfel&#039;&#039; modules do not critically depend on any particular version of the PSDM software, it is generally possible to closely track the latest version of the PSDM distribution.  To upgrade to the current PSDM release, do&lt;br /&gt;
 $ cd myrelease&lt;br /&gt;
 $ relupgrade ana-current&lt;br /&gt;
If &amp;lt;code&amp;gt;relinfo&amp;lt;/code&amp;gt; does not output &amp;lt;code&amp;gt;ana-current&amp;lt;/code&amp;gt; after that, one can edit &amp;lt;code&amp;gt;~/myrelease/.sit_release&amp;lt;/code&amp;gt; manually to that effect.  Then rebuild&lt;br /&gt;
 $ scons -c&lt;br /&gt;
 $ scons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* More detailed manual: [https://confluence.slac.stanford.edu/display/PCDS/Pyana+User+Manual Pyana User Manual]&lt;br /&gt;
* [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Packages+and+Releases Analysis Workbook. Packages and Releases]&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=91</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=91"/>
		<updated>2014-02-05T20:37:28Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Better find command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;IMPORTANT: installing &#039;&#039;cctbx.xfel&#039;&#039; is not necessary for most users, as &#039;&#039;cctbx.xfel&#039;&#039; is installed at SLAC already and is generally accessible.  General users should instead go to [[setup]] to configure their unix account at SLAC to run &#039;&#039;cctbx.xfel.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This document aims to be a step-by-step installation guide for &#039;&#039;cctbx.xfel&#039;&#039;.  Note that in this text &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The user prompt is distinct from &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, which denotes the prompt of the superuser.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the command typed to the shell.  This installation can be performed by any regular user—no superuser privileges are required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
See [[Set up PSDM software]].  It is assumed that &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; has been sourced, a release directory has been configured in &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel&amp;lt;/code&amp;gt;, and that an empty analysis package has been set up in &amp;lt;code&amp;gt;~/myrelease/my_ana_pkg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel/my_ana_pkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX In addition, these software packages need to be available: reportlab, h5py, etc --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download and extract &#039;&#039;cctbx&#039;&#039; and &#039;&#039;LABELIT&#039;&#039; source bundles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Seems to be important to source ana_env.sh before building! XXX Stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is probably the only place where the developer installation is different from the standard installation.  Investigate and accommodate! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that developers should follow the instructions in [[Installation for developers]] instead.  This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate. The directory should accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
Note: new bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation. &amp;lt;!-- This should probably be some kind of warning box, see http://www.mediawiki.org/wiki/Template:Mbox XXX Note also that downloads of the labelit bundle are intentionally &amp;quot;disabled&amp;quot;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the sources:&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is duplicated in the developer instructions! --&amp;gt;&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
This next two steps require access to a C++ compiler and a Python interpreter.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename &amp;quot;*/$SIT_ARCH/*/python&amp;quot; 2&amp;gt; /dev/null&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.  The name and location of the build directory is arbitrary; &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_build&amp;lt;/code&amp;gt; is a common choice.&lt;br /&gt;
&lt;br /&gt;
Now, initialise the running shell using the newly created configuration files.  bash-users should do&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users should instead run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
If building at SLAC, log into one of the psanacs nodes. Then compile:&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=90</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=90"/>
		<updated>2014-02-05T20:20:10Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Fix broken find command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;IMPORTANT: installing &#039;&#039;cctbx.xfel&#039;&#039; is not necessary for most users, as &#039;&#039;cctbx.xfel&#039;&#039; is installed at SLAC already and is generally accessible.  General users should instead go to [[setup]] to configure their unix account at SLAC to run &#039;&#039;cctbx.xfel.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This document aims to be a step-by-step installation guide for &#039;&#039;cctbx.xfel&#039;&#039;.  Note that in this text &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The user prompt is distinct from &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, which denotes the prompt of the superuser.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the command typed to the shell.  This installation can be performed by any regular user—no superuser privileges are required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
See [[Set up PSDM software]].  It is assumed that &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; has been sourced, a release directory has been configured in &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel&amp;lt;/code&amp;gt;, and that an empty analysis package has been set up in &amp;lt;code&amp;gt;~/myrelease/my_ana_pkg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel/my_ana_pkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX In addition, these software packages need to be available: reportlab, h5py, etc --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download and extract &#039;&#039;cctbx&#039;&#039; and &#039;&#039;LABELIT&#039;&#039; source bundles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Seems to be important to source ana_env.sh before building! XXX Stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is probably the only place where the developer installation is different from the standard installation.  Investigate and accommodate! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that developers should follow the instructions in [[Installation for developers]] instead.  This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate. The directory should accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
Note: new bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation. &amp;lt;!-- This should probably be some kind of warning box, see http://www.mediawiki.org/wiki/Template:Mbox XXX Note also that downloads of the labelit bundle are intentionally &amp;quot;disabled&amp;quot;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the sources:&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is duplicated in the developer instructions! --&amp;gt;&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
This next two steps require access to a C++ compiler and a Python interpreter.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT/sw/external/python -perm /0111 -name python -type f 2&amp;gt; /dev/null | grep $SIT_ARCH&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.  The name and location of the build directory is arbitrary; &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_build&amp;lt;/code&amp;gt; is a common choice.&lt;br /&gt;
&lt;br /&gt;
Now, initialise the running shell using the newly created configuration files.  bash-users should do&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users should instead run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
If building at SLAC, log into one of the psanacs nodes. Then compile:&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=89</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=89"/>
		<updated>2014-02-05T20:02:18Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Consistency with developer instructions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;IMPORTANT: installing &#039;&#039;cctbx.xfel&#039;&#039; is not necessary for most users, as &#039;&#039;cctbx.xfel&#039;&#039; is installed at SLAC already and is generally accessible.  General users should instead go to [[setup]] to configure their unix account at SLAC to run &#039;&#039;cctbx.xfel.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This document aims to be a step-by-step installation guide for &#039;&#039;cctbx.xfel&#039;&#039;.  Note that in this text &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The user prompt is distinct from &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, which denotes the prompt of the superuser.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the command typed to the shell.  This installation can be performed by any regular user—no superuser privileges are required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
See [[Set up PSDM software]].  It is assumed that &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; has been sourced, a release directory has been configured in &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel&amp;lt;/code&amp;gt;, and that an empty analysis package has been set up in &amp;lt;code&amp;gt;~/myrelease/my_ana_pkg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel/my_ana_pkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX In addition, these software packages need to be available: reportlab, h5py, etc --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download and extract &#039;&#039;cctbx&#039;&#039; and &#039;&#039;LABELIT&#039;&#039; source bundles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Seems to be important to source ana_env.sh before building! XXX Stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is probably the only place where the developer installation is different from the standard installation.  Investigate and accommodate! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that developers should follow the instructions in [[Installation for developers]] instead.  This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate. The directory should accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
Note: new bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation. &amp;lt;!-- This should probably be some kind of warning box, see http://www.mediawiki.org/wiki/Template:Mbox XXX Note also that downloads of the labelit bundle are intentionally &amp;quot;disabled&amp;quot;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the sources:&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is duplicated in the developer instructions! --&amp;gt;&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
This next two steps require access to a C++ compiler and a Python interpreter.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT -executable -name python -type f&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx_build&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.  The name and location of the build directory is arbitrary; &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;/cctbx_build&amp;lt;/code&amp;gt; is a common choice.&lt;br /&gt;
&lt;br /&gt;
Now, initialise the running shell using the newly created configuration files.  bash-users should do&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users should instead run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=88</id>
		<title>Ha14 installation</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Ha14_installation&amp;diff=88"/>
		<updated>2014-02-05T19:33:17Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Consistency with developer instructions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;IMPORTANT: installing &#039;&#039;cctbx.xfel&#039;&#039; is not necessary for most users, as &#039;&#039;cctbx.xfel&#039;&#039; is installed at SLAC already and is generally accessible.  General users should instead go to [[setup]] to configure their unix account at SLAC to run &#039;&#039;cctbx.xfel.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This document aims to be a step-by-step installation guide for &#039;&#039;cctbx.xfel&#039;&#039;.  Note that in this text &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; denotes the prompt of any unprivileged user on the system.  Certain shells may be configured to use &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; for that purpose.  The user prompt is distinct from &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, which denotes the prompt of the superuser.  The prompt should &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; be included in the command typed to the shell.  This installation can be performed by any regular user—no superuser privileges are required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite: install and set up the PSDM suite ==&lt;br /&gt;
&lt;br /&gt;
See [[Set up PSDM software]].  It is assumed that &amp;lt;code&amp;gt;ana_env.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; has been sourced, a release directory has been configured in &amp;lt;code&amp;gt;~/myrelease&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel&amp;lt;/code&amp;gt;, and that an empty analysis package has been set up in &amp;lt;code&amp;gt;~/myrelease/my_ana_pkg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;~/analisys-rel/my_ana_pkg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX In addition, these software packages need to be available: reportlab, h5py, etc --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download and extract &#039;&#039;cctbx&#039;&#039; and &#039;&#039;LABELIT&#039;&#039; source bundles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Seems to be important to source ana_env.sh before building! XXX Stored in /net/cci/auto_build/cctbx/results --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is probably the only place where the developer installation is different from the standard installation.  Investigate and accommodate! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that developers should follow the instructions in [[Installation for developers]] instead.  This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; psexport pool do. In what follows, the absolute path &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be replaced with something more appropriate. The directory should accessible everywhere &#039;&#039;cctbx.xfel&#039;&#039; is to be run.&lt;br /&gt;
 $ mkdir -p &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ cd &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;/path/to/cctbx/directory&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz&lt;br /&gt;
 $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz&lt;br /&gt;
Note: new bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation. &amp;lt;!-- This should probably be some kind of warning box, see http://www.mediawiki.org/wiki/Template:Mbox XXX Note also that downloads of the labelit bundle are intentionally &amp;quot;disabled&amp;quot;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the sources:&lt;br /&gt;
 $ mkdir cctbx_project&lt;br /&gt;
 $ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1&lt;br /&gt;
 $ tar -xpvzf labelit_bundle_20130814.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX This is duplicated in the developer instructions! --&amp;gt;&lt;br /&gt;
Add the &amp;lt;code&amp;gt;cxi_user&amp;lt;/code&amp;gt; directory and its &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt; module.  This defines the default integration algorithm used by &#039;&#039;cctbx.xfel&#039;&#039;.&lt;br /&gt;
 $ mkdir cxi_user&lt;br /&gt;
 $ cat &amp;gt; cxi_user/__init__.py &amp;lt;&amp;lt; EOF&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import post_outlier_rejection&lt;br /&gt;
 from xfel.mono_simulation.mono_treatment import pre_get_predictions&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Configure the source tree ==&lt;br /&gt;
This next two steps require access to a C++ compiler and a Python interpreter, any minor version between 2.5 and 2.7.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable &amp;lt;i&amp;gt;via&amp;lt;/i&amp;gt; psanacs, do.  The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses.   That interpreter can be located using find, &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ find $SIT_ROOT -executable -name python -type f&lt;br /&gt;
At SLAC this interpreter is located somewhere under &amp;lt;code&amp;gt;/reg/g/psdm/sw/external/python&amp;lt;/code&amp;gt;.  Then create and initialize the build directory and compile the sources using the appropriate Python interpreter.  Developers may want to use slightly different configuration options, see [[Installation for developers]].&lt;br /&gt;
 $ mkdir cctbx_build&lt;br /&gt;
 $ cd cctbx_build&lt;br /&gt;
 $ &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; ../cctbx_project/libtbx/configure.py xfel&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;python&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt; should be substituted with output of the previous find command.&lt;br /&gt;
&lt;br /&gt;
Now, initialise the running shell using the newly created configuration files.  bash-users should do&lt;br /&gt;
 $ . setpaths.sh&lt;br /&gt;
while csh-users should instead run&lt;br /&gt;
 % source setpaths.csh&lt;br /&gt;
&lt;br /&gt;
== Compile the sources ==&lt;br /&gt;
 $ make&lt;br /&gt;
On SLAC&#039;s interactive nodes, this takes just over 6 minutes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- It used to be necessary to run make twice, but that seems to no longer be the case.  XXX Maybe should include a bit on running the regression tests here? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://cctbx.sourceforge.net/current_cvs/installation.html#manually-building-from-sources-under-unix Manually building from sources under Unix]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- POSSBILE ADDITIONS:&lt;br /&gt;
&lt;br /&gt;
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).&lt;br /&gt;
&lt;br /&gt;
COMMON PITFALLS:&lt;br /&gt;
&lt;br /&gt;
forget to source the shell configuration files&lt;br /&gt;
forget to run sit_setup&lt;br /&gt;
running cxi.pyana from outside the myrelease directory&lt;br /&gt;
&lt;br /&gt;
DEBUGGING:&lt;br /&gt;
&lt;br /&gt;
And a few more things to check: output of &amp;quot;ls -lR arch/*&amp;quot;, output of &amp;quot;which python2.7&amp;quot;, and the &amp;quot;scons.out&amp;quot; file that results from &amp;quot;scons TRACE=7 &amp;gt; scons.out 2&amp;gt;&amp;amp;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What Linux distribution are you running this on (could you past the output of &amp;quot;uname -a&amp;quot; and &amp;quot;cat /etc/issue&amp;quot;)?  Could you also tell me which scons you are using (output of &amp;quot;which scons&amp;quot;).  Last, could you attach a dump of the environment (env &amp;gt; env.out)?&lt;br /&gt;
&lt;br /&gt;
Andy&#039;s information request on debugging: full output from these commands:&lt;br /&gt;
&lt;br /&gt;
% rm -rf arch build&lt;br /&gt;
% printenv&lt;br /&gt;
% which scons&lt;br /&gt;
% which python&lt;br /&gt;
% which python2.7&lt;br /&gt;
% scons TRACE=9&lt;br /&gt;
% ls -lR arch&lt;br /&gt;
% ls -lR my_ana_pkg&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Setup&amp;diff=134</id>
		<title>Setup</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Setup&amp;diff=134"/>
		<updated>2014-02-05T18:52:05Z</updated>

		<summary type="html">&lt;p&gt;Hattne: Moved scratch-area setup to tutorial.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- XXX Should probably rename this page to &amp;quot;Set up &#039;&#039;cctbx.xfel&#039;&#039;&amp;quot; or some such --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisities ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;cctbx.xfel&#039;&#039; must be installed, which in turn requires the PSDM software distribution to be set up.  See [[Set up PSDM software]] for the latter and [[Installation]] for the former.  &#039;&#039;cctbx.xfel&#039;&#039; can be installed anywhere on the filesystem where write access is granted.&lt;br /&gt;
&lt;br /&gt;
The installation root directory affects the absolute paths used in these instructions and differs from site to site.  Some common installation root directories are listed below.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Site&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Installation root directory&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;| Notes&lt;br /&gt;
|-&lt;br /&gt;
| BNL&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/crys_test/cctbx&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CCI, LBNL&lt;br /&gt;
|&lt;br /&gt;
| No central installation available&lt;br /&gt;
|-&lt;br /&gt;
| SLAC&lt;br /&gt;
| &amp;lt;code&amp;gt;/reg/g/cctbx/sources&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
Developers will generally have &#039;&#039;cctbx.xfel&#039;&#039; installed in their home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;cctbx.xfel&#039;&#039; setup ==&lt;br /&gt;
&lt;br /&gt;
To start using &#039;&#039;cctbx.xfel&#039;&#039;, the environment has to be configured.  The details depend on the &#039;&#039;cctbx.xfel&#039;&#039; installation root directory and the user&#039;s shell.&lt;br /&gt;
In what follows it is assumed that &#039;&#039;cctbx.xfel&#039;&#039; is installed at &amp;lt;code&amp;gt;/reg/g/cctbx/build&amp;lt;/code&amp;gt;.  Substitute &amp;lt;code&amp;gt;/reg/g/cctbx/build&amp;lt;/code&amp;gt; with the appropriate path in the instructions below.  These steps need only be performed once.&lt;br /&gt;
&lt;br /&gt;
In a bash shell, the environment is prepared for &#039;&#039;cctbx.xfel&#039;&#039; using&lt;br /&gt;
 $ . /reg/g/cctbx/build/setpaths.sh&lt;br /&gt;
For csh, the corresponding command is&lt;br /&gt;
 % source /reg/g/cctbx/build/setpaths.csh&lt;br /&gt;
Sourcing &amp;lt;code&amp;gt;setpaths.sh&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ana_env.csh&amp;lt;/code&amp;gt; only modifies the environment of the current shell, and would have to be repeated every time a new shell is started.  To make the changes persistent, add&lt;br /&gt;
 test -r &amp;quot;/reg/g/cctbx/build/setpaths.sh&amp;quot; &amp;amp;&amp;amp; \&lt;br /&gt;
   . &amp;quot;/reg/g/cctbx/build/setpaths.sh&amp;quot;&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, or&lt;br /&gt;
 test -r &amp;quot;/reg/g/cctbx/build/setpaths.csh&amp;quot; &amp;amp;&amp;amp; \&lt;br /&gt;
   source &amp;quot;/reg/g/cctbx/build/setpaths.csh&amp;quot;&lt;br /&gt;
to &amp;lt;code&amp;gt;~/.cshrc as appropriate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Linking &#039;&#039;cctbx.xfel&#039;&#039; to &#039;&#039;pyana&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Run these commands to associate &#039;&#039;pyana&#039;&#039; and &#039;&#039;cctbx.xfel&#039;&#039;:&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
 $ cd ~/myrelease/my_ana_pkg&lt;br /&gt;
 $ ln -fns /reg/g/cctbx/sources/cctbx_project/xfel/cxi/cspad_ana src&lt;br /&gt;
 $ cd ..&lt;br /&gt;
 $ ln -s /reg/g/cctbx/sources/cctbx_project/xfel/cxi/lsf.sh .&lt;br /&gt;
 $ scons&lt;br /&gt;
The last step compiles the analysis modules just linked in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- XXX Should check this with Andy or so; this can probably be done better.   Perhaps note that using -fns will zap any old src link in place. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Run each time on logging on to SLAC ==&lt;br /&gt;
&lt;br /&gt;
Whenever you log on to a fresh shell at SLAC, before you can use any portion of &#039;&#039;cctbx.xfel&#039;&#039; that uses &#039;&#039;pyana&#039;&#039;, you must run these commands:&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ sit_setup&lt;br /&gt;
&lt;br /&gt;
== Test the installation ==&lt;br /&gt;
At SLAC, test that it is working by &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;&lt;br /&gt;
 $ cd ~/myrelease&lt;br /&gt;
 $ cxi.pyana -c /reg/g/cctbx/tutorials/setup/test.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0004-s00-c00.xtc&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
More specifically, this command starts &#039;&#039;pyana&#039;&#039; with a configuration file (&amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt;) and an XTC file.  For more information, see the [[Overview]] and other tutorial pages.&lt;/div&gt;</summary>
		<author><name>Hattne</name></author>
	</entry>
</feed>