Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Starting psocake in SFX mode

If you are on a psana machine, set up your environment by adding these lines to .bashrc (or your start up script):

Code Block
languagebash
# PSANA
source /reg/g/psdm/etc/psconda.sh

# CrystFEL
source /reg/g/cfel/crystfel/crystfel-dev/setup-sh

# CCP4 (version may change)
source /reg/common/package/ccp4-7.1/bin/ccp4.setup-sh

# XDS
export PATH=/reg/common/package/XDS-INTEL64_Linux_x86_64:$PATH

Make sure you have the psana environment setup (psana python Setup) before starting this tutorial. Also, check out a kerberos ticket by typing “kinit” which is needed for communicating with the experiment e-Log.

...

Code Block
languagepython
$ psocake -m sfx

 


1) There are four parameters required to uniquely identify an image at LCLS. Type the (1) experiment name, (2) run number, (3) detector name, and (4) event number in the Experiment Parameters panel.

For this tutorial, we will look at experiment cxitut13, run 10, detector DscCsPad, event 11.

...

During the experiment, you have access to psfehhiprioq which allows you to run psocake from Fast Feedback (FFB) nodes. To do this, append -a ffb. Note that only psfehhiprioq has access to the data on FFB:

Code Block
languagepython
$ psocake -e cxitut13 -r 10 -d DscCsPad -n 11 -m sfx -a ffb

 


Note that available detector names will be printed on the terminal once you have typed in the experiment name and the run number. 

...

mask.txt is compatible with the calibration manager application, calibman.

 


To delete the mask on the screen, select "Unmask" under Masking mode. Drag a blue circle mask generator over the detector and click "Stamp circular mask".

...

To check which queues are free, type the following in the terminal: 


Code Block
languagepython
$ bqueues | grep ps
psnehhiprioq    117  Open:Active       -    -    -    -     0     0     0     0
psfehhiprioq    117  Open:Active       -    -    -    -     0     0     0     0
psnehprioq      116  Open:Active       -    -    -    -     0     0     0     0
psfehprioq      116  Open:Active       -    -    -    -     0     0     0     0
psnehq          115  Open:Active       -    -    -    -     0     0     0     0
psfehq          115  Open:Active       -    -    -    -   520   276   244     0
psdebugq        114  Open:Active       -    -    -    -     0     0     0     0
psanaq          112  Open:Active       -    -    -    -  7466  6612   854     0
psnehidleq       70  Open:Active       -    -    -    -    96     0    96     0
psfehidleq       70  Open:Active       -    -    -    -   104     0     0   104
psanaidleq       70  Open:Active       -    -    -    -   552   432     0   120

At the time of writing this documentation, psanaq is quite busy processing 7466 jobs. 6612 jobs are pending. 854 jobs are currently running. For more information on which queue you are allowed to use, see Batch System Analysis Jobs

...

Detector panels can manually adjusted using: calibmanIf you are on a psana machine, you can run CrystFEL programs by setting up your environment:

Code Block
languagebash
source /reg/g/cfel/crystfel/crystfel-dev/setup-sh
CFDEPDIR=/reg/g/cfel/dependencies
export PATH=${CFDEPDIR}/bin:$PATH

Secondly, we need to know the diffraction geometry before we can index. It is often the case at the beginning of a beamtime that the detector distance to the interaction point (coffset) is not precisely known (We are talking about sub-millimetre precision), and we can use the Diffraction Geometry panel to find this distance.

...

Once you are happy with the detector geometry and indexing parameters, you can click "Launch indexing”.
  • Run(s): 10
  • Sample name: lysozyme
  • Queue: psanaq
  • CPUs: 24
  • Keep CXI images: On

Indexing will take some time to complete. If successful, you should see a stream file in: /reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake/r0010/cxitut13_0010.stream

You can check the status of your indexing job here: /reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake/r0010/status_index.txt

Psocake saves the detector images of only the hits in the .cxi file. It is likely that you may want to reindex these files to optimize the indexing rate. If you anticipate that you have finalized the indexing parameters, set 'Keep CXI images' to Off. It will delete the detector images in your .cxi file which will free up your precious disk space for doing other things.

As with peak finding, you can launch indexing jobs on multiple runs by specifying runs in the Run(s) field.

Indexing multiple lattices

CrystFEL can index multiple lattices per image. Set "Extra CrystFEL parameters" to --multi,--no-check-peaks. This will enable "subtract and retry" method.

Indexing pump-probe experiments

In a pump probe experiment, it is sometimes desirable to index only certain events, e.g index only the pumped crystals. This information is recorded in the EVR which psocake saves in the .cxi file.

So if you want to index only the hits with laser on (say EVR1: 182), then type the following in the "Index condition" field:

182 in #evr1#

Psocake will also accept combinations using AND/OR:

182 in #evr1# and 173 in #evr1# 

You can attach a tag to the stream filename by using the "Tag" field, e.g. evr182 would produce cxitut13_0010_evr182.stream.

Detector centering

Let's check whether your detector is well centered with respect to your beam. You want the centre to be as accurate as possible (at least to a pixel accuracy) for high indexing rates (>40%).

Load the powder rings generated by clicking the "Load image" button in the Image Control panel. Open "cxitut13_0010_maxHits.npy". Adjust the intensity as necessary.

Draw resolution rings by ticking "Resolution rings" in the Diffraction Geometry panel. You can change the ring resolution by typing number in "Resolution (pixels)". Type 165 and see whether your powder rings overlap with the resolution rings. If they do, then the detector is centered. If not, then you can click on the "Deploy automatically centred geometry" to recenter your detector. If you are unhappy with the results, you can use "Deploy manually centred geometry" which will shift the detector centre to the centre of the green ROI circle.

Since we are at run10, the newly deployed geometry file is named 10-end.data. If there already exists a geometry file with the same name, it will be renamed to 10-end.data-<timeModified>

 


Jumping to indexed images

Once you have completed indexing a run, you may want to look at the indexed events.

In the small data panel, type the CXIDB filename:

  • filename: /reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake/r0010/cxitut13_0010.cxi
  • dataset: /entry_1/result_1/index
You can click on the red marker in the plot to jump to the corresponding events.
Once you are satisfied with indexing all your runs, please remember to backup your .cxi files in the /res directory of your experiment. The scratch folder will get wiped after few months (Data Retention Policy).
The stream file is small enough to transfer back to your institute for post-processing (CrystFEL tutorial) and phase retrieval (PHENIX).
For phase retrieval, you can use Phenix and CCP4 by sourcing the following lines:


 

Code Block
languagebash
# Phenix
source /reg/common/package/phenix/phenix-1.10.1-2155/phenix_env.sh
# CCP4
source /reg/common/package/ccp4/ccp4-7.0/bin/ccp4.setup-sh
# XDS is available here
/reg/common/package/XDS-INTEL64_Linux_x86_64/

For viewing the electron density, use coot contained inside phenix.

 


Beam Parameters for Publications

You can use psana to retrieve EPICS variables that are used in SFX publications, such as the pulse energy and the number of photons per pulse.
Code Block
languagepy
titleCommon EPICS variables for SFX
ebeam = ebeamDet.get(evt)
pulseEnergy = ebeam.ebeamL3Energy()  # MeV

es = psana.DataSource.env().epicsStore()
calculatedNumberOfPhotons = get_es_value(es, 'SIOC:SYS0:ML00:AO580', NoneCheck=False, exceptReturn=0) * 1e12  # photons
 


Bug/Comments:

Please send bug reports/comments:

yoon82@slac.stanford.edu

Tiny url for this tutorial: http://tinyurl.com/zj4m23n