-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReadme
More file actions
177 lines (125 loc) · 6.7 KB
/
Readme
File metadata and controls
177 lines (125 loc) · 6.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
This is intended to be a quick guide to getting started with Cheetah
Thanks to:
Chuck Yoon
Rick Kirian
Nadia Zatsepin
Oleksandr Yefanov
Anton Barty
There are a couple of steps to follow when starting from scratch:
1. Compile libcheetah (the analysis part of the code)
2. Link libcheetah to the file reading front-end (currently psana at LCLS)
3. Run the analysis
4. Optimise parameters for your experiment
Some knowledge of your computing architecture is assumed.
------------------------------------------------------------------------
For people in a hurry: Compiling pdslib, libcheetah and psana
------------------------------------------------------------------------
In your startup script .profile or .bashrc add the following line:
. /reg/g/psdm/bin/sit_setup.sh
Then
Look at examples/build-all
Which builds everything from steps 0 to 2. For more information, read on.
For running cheetah, go to step 3.
------------------------------------------------------------------------
0. Compiling the SLAC data analysis libraries
------------------------------------------------------------------------
Look at: examples/build-pdslib
Which does the following:
>------------------------------------------------------------------------<
cd source/lcls/myana/release/pdsdata
make x86_64-linux
>------------------------------------------------------------------------<
Technically this is only required if compiling cheetah within the myana framework.
libcheetah and psana SHOULD be able to compile without this.
However, it seems to help if this is present (make does not tank).
Some modification may be required for compilation on your home system
(mainly missing #includes and some type definitions. SLAC does not
guarantee ease portability outside of their own system, nor do we.)
------------------------------------------------------------------------
1. Compiling libcheetah
------------------------------------------------------------------------
Look at: examples/build-libcheetah
This script executes the makefile in source/, but it first sets a few environment variables.
Here's what is in the script:
>------------------------------------------------------------------------<
export HDF5DIR=/reg/neh/home/rkirian/local
export CHEETAHDIR=/reg/neh/home/rkirian/software/cheetah
export LD_LIBRARY_PATH="/reg/neh/home/rkirian/local/lib:/reg/neh/home/rkirian/software/cheetah/source/lcls/myana/release/build/pdsdata/lib/x86_64-linux"
export LD_RUN_PATH="/reg/neh/home/rkirian/local/lib:/reg/neh/home/rkirian/software/cheetah/source/lcls/myana/release/build/pdsdata/lib/x86_64-linux"
make cheetah
make libcheetah
cp cheetah /reg/d/psdm/cxi/cxi54312/scratch/programs/bin/cheetah-rick
cp cheetah /reg/neh/home/rkirian/local/bin
cp libcheetah.so.* /reg/neh/home/rkirian/local/lib
>------------------------------------------------------------------------<
Copy this script, edit these fields to point to where things are for you, and run it.
Re-run this after making any changes to libcheetah.
Make sure to point to a thread-safe version of the HDF5 library.
If you don't cheetah will start to run, but randomly crash with segmentation faults whenever two threads try to write an HDF5 file at the same time.
Simply add "--enable-threadsafe" to the hdf5 ./configure command.
hdf5-directory > ./configure --enable-threadsafe
------------------------------------------------------------------------
2. Compiling psana with libcheetah
------------------------------------------------------------------------
Look at: examples/build-psana
Which does the following:
>------------------------------------------------------------------------<
cd ~/cheetah/source/lcls-psana
. /reg/g/psdm/bin/sit_setup.sh
export LIBPATH=/reg/neh/home/rkirian/local/lib
scons
>------------------------------------------------------------------------<
In case of errors, look at ~/cheetah/source/lcls-psana/README
Common errors are:
- Path to libcheetah not set
- Mismatched HDF5 versions
- Out-of-date psana references
Look at: examples/update-psana for fixing the last problem.
It is possibly a good idea to re-compile psana after making any changes to libcheetah.
Note that SLAC does not guarantee psana to be easily portable outside of their own systems.
------------------------------------------------------------------------
3. Running analysis scripts
------------------------------------------------------------------------
Cheetah can now be run directly; however it is more useful to have a script do a lot of the housekeeping for you.
This is what scripts/hitfinder does.
Look at:
scripts/hitfinder
examples/run-cheetah-psana
First you have to set a few environment variables telling Cheetah where to look for things:
>------------------------------------------------------------------------<
XTCDIR: Path to where the xtc data is (default: ./)
H5DIR: Path to where the results of cheetah will be written (default: ./)
CONFIGDIR: Search path for ini files (default: ./)
TMPDIR: A place to put temporary files (default: /tmp)
CHEETAH: The path to cheetah (default: cheetah)
>------------------------------------------------------------------------<
Then hitfinding for data can be done with a simple one-line command, such as:
> hitfinder -r 57 -i /some/path/foobar.ini
Running "hitfinder -h" tells you all the options.
------------------------------------------------------------------------
4. Optimising Cheetah for your experiment
------------------------------------------------------------------------
Operation of cheetah is controlled by the parameters specified in cheetah.ini
As with most analysis programs, not all default parameters can cover every situation, and it is most likely that you can benefit from tweaking parameters.
Monitoring output and optimising, in particular Bragg peak identification, is normal procedure.
Common things to change are:
Crystals:
- Local background subtraction radius (tradeoff for speed vs peak size)
- Size and number of Bragg peaks to qualify as a hit
- Minimum signal:noise ratio
- Static ADC threshold (if used)
Single particles:
- ADC value and number of pixels above threshold to qualify as a hit
- Number of past non-hit frames to use as background
See the full cheetah documentation for all options, or talk to your local guru.
Most parameters take sensible default values if not specified.
There are many 'hidden parameters' which are not critical, but can be tweaked if you need to.
------------------------------------------------------------------------
5. Source code for cheetah
------------------------------------------------------------------------
Cheetah's shared library is under:
~/cheetha/source/cheetah.lib
Myana source code is under:
~/cheetah/source/lcls/myana
Psana source code is under:
~/cheetah/source/lcls-psana