Versions Compared

Key

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

"Data analysis == Piece of cake"

Sections in this tutorial

It is important always a good idea for the people doing analysis to be able to look at the their detector images and probe intensity values. Given that a typical LCLS experiment has millions of snapshots to choose from, it is also critical that you can quickly select images of interest and set regions of interest using masks. By the end of this tutorial, you will be able to browse imageimages, jump to images of interest, generate maskmasks, find peaks in your images and index crystal diffraction patterns.

Table of Contents

 

Code Block
languagetext
Citation for psocake (and other psana-based programs):
@article{Damiani:zw5004, 
author = "Damiani, D. and Dubrovin, M. and Gaponenko, I. and Kroeger, W. and Lane, T. J. and Mitra, A. 
and O'Grady, C. P. and Salnikov, A. and Sanchez-Gonzalez, A. and Schneider, D. and Yoon, C. H.", 
title = "{Linac Coherent Light Source data analysis using {it psana}}", 
journal = "Journal of Applied Crystallography", 
year = "2016", volume = "49", number = "2", pages = "672--679", month = "Apr", 
doi = {10.1107/S1600576716004349}, url = {http://dx.doi.org/10.1107/S1600576716004349}, }

Starting psocake in SFX mode

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 --help

Mask making

In this example, let's mask out pixels that should not be used for analysis, mask out the jet streak at the centre of the detector, and mask out the water ring.

...

You can load the user-defined mask using the "Load user-defined mask" button and selecting mask.npy.

Peak finding

 

To find the Bragg peaks on the image, set the "Algorithm" to “Droplet” in the Peak Finder panel.

...

If the hit finding parameters are good, cxitut13_0010_maxMisses.npy should not contain many Bragg spots. You can look at these images by using the "Load image" button in the Image Control panel.

As an aside, you can check the status of launched jobs by typing "bjobs" in your Terminal. This will display the job ID and the status amongst other information.
A logfile of the peak finding is also saved under the same directory, .<jobID>.log. Note the "." in front of the logfile name.
If the status stays in PEND or SUSP mode for awhile, then you may want to kill the jobs. To kill a batch job, type "bkill <jobID>". For more information, please refer to: Submitting Batch Jobs

Jumping to interesting images based on the number of peaks

Once you have submitted the peak finder job, let's plot the number of peaks found for each event.

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/nPeaksAll

...

  • dataset: /entry_1/result_1/index

Indexing crystals

First things first, crystal indexing requires an accurate detector geometry. Latest CXI geometry files can be found here: Geometry history

...

It is often the case at the beginning of a beamtime that the detector distance to the interaction point (coffset) is not well known, and we can use the Diffraction Geometry panel to find this distance.
  • In the diffraction geometry panel, set "Detector distance" to 156mm. Try incrementing this distance in 1mm step till the unit cell parameters are as close as possible to lys.cell. The optimum detector distance is around 158mm.
    Everytime the "Detector distance" value is changed by the user, psocake converts the psana geometry (in /reg/d/psdm/cxi/cxitut13/calib/CsPad\:\:CalibV1/CxiDs1.0\:Cspad.0/geometry/10-11.data) to a CrystFEL geom file (in /reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake/<runNumber>/.temp.geom).
  • Try drawing a resolution ring on top of the water ring by using “Resolution (pixels)” field. If your detector distance is correct, the crystallographic resolution ring should display 3.2A.
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: Off

If you would like to save the detector images in the .cxi file, turn on "Keep CXI images". Only set this to true, if you anticipate that you will want to reindex this run. Otherwise, it's just a total waste of your precious disk space.

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

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_10.stream

 

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.

Bug/Comments:

Please send bug reports/comments to Chuck:

yoon82@slac.stanford.edu