Versions Compared

Key

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

...

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 1144.

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

...

Code Block
languagepython
$ psocake exp=cxitut13:run=10 -d DscCsPad -n 1144 -m sfx

Or you can also use the -e and -r arguments for the experiment and the run number:

Code Block
languagepython
$ psocake -e cxitut13 -r 10 -d DscCsPad -n 1144 -m sfx

To check psocake version:

...

To save the user-defined mask, click on "Save static mask" on the mask panel which will save the mask in the scratch folder. This will combine the green and blue masks into a single mask. For this example, the your mask will be saved here:

/reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake/r0010/mask.npy (unassembled 3D ndarray)

/reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake/r0010/mask.txt (2D text)

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

...

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".

Peak finding

In this section, we will find peaks on the detector image. To find the peaks on the image, set the "Algorithm" to “Droplet” in the Peak Finder panel. Details of the peak finding algorithm is given here: Hit and Peak Finding Algorithms#Twothreshold"Dropletfinder". You should notice peaks being highlights in the Image panel.

Let's define the area of the peaks that you are looking for. Examine the peaks Examine the peaks found by zooming in/out with the middle mouse scroll (or a two finger slide on a Mac touchpad). Notice that the Bragg peaks are composed of 2 to 6 8 connected pixels. Setting the radius to 2 sets a 5x5 cyan boundary around the Bragg peaks (radius x 2+1 = 5). Change the following values in the Peak Finder panel.
  • Set npix_min: 2
  • Set npix_max: 68
  • radius: 2

Move the green square over the water ring to study the The two threshold droplet algorithm requires us to set two thresholds; a low and a high. The low threshold is the background noise level. The high threshold is the minimum height of our peaks of interest. Move the green square over the water ring to study the level of background noise in the ROI Histogram panel. Notice that the water ring intensities can go up to 120 ADUs. A Strong Bragg spot is spots are at least 250 ADUs. Signal to noise ration seems to be high 7, so Ideally, we want to reject peaks that have low signal to noise ratios. Let's set it to 7 sigma, typically you need to stay above 4. So set the following values.
  • thr_low: 120
  • thr_high: 250
  • son_min: 7

Hover the mouse pointer over the Bragg peaks to study the intensities. The sum of the Bragg peak pixels are above 400 500 ADUs. Set the following values:

  • Set atot_thr: 400
    500

LetYou can jump to other events to see if your peak parameters are well tuned. Once you are happy, let's launch the peak finder on the cluster .for a small number of events to see how this set of parameters performs. The output directory on the
peak finder
Peak Finder panel should already be automatically set to: /reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake
Since we are analyzing run 10, /r0010 directory will be generated under the output directory.
The default setting will analyze run 10 on psanaq with 24 CPUs. Number of events to process set to 0 -1 analyzes all the events.
Click "Launch peak finder”. For For this demo, let's analyze only 30 50 events with 2 CPUs.
  • Run(s): 10
  • CPUs: 2
  • Number of events to process: 30
Note: You can launch peak finding jobs on multiple runs, e.g. Run(s) 1,10:13 will launch peak finding on runs 1, 10, 11, and 13.
  • 50

Click "Launch peak finder”. 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
Note: You can launch peak finding jobs on multiple runs when you are ready to analyze the entire experiment, e.g. Run(s) 1,10:13 will launch peak finding on runs 1, 10, 11, and 13.
The CXIDB file is generated in the output directory in the following format: <experiment name>_<4-digit run number>.cxi (i.e., /The CXIDB file is generated in the output directory in the following format: <experiment name>_<4-digit run number>.cxi (i.e., /reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake/r0010/cxitut13_0010.cxi) 

...

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.
.
At CXI, the detector geometry may not be centred exactly. You can fix the centre by clicking "Deploy automatically centred geometry" in the Diffraction geometry panel. This uses cxitut13_0010_maxHits.npy and cxitut13_0010_maxMisses.npy.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 you should see the CXIDB filename:

  • filename: /reg/d/psdm/cxi/cxitut13/scratch/<username>/psocake/r0010/cxitut13_0010.cxi
  • dataset: /entry_1/result_1/nPeaksAll
"/entry_1/result_1/nPeaksAll" is an array containing number of peaks found for each event. Unfortunately the naming convention is cryptic, but it is how it is named inside a CXIDB file.
This should load a plot of all the peaks found so far per event. Click "Refresh" to update the plot even if your batch job is still running.

...

Let's try to index the diffraction pattern at event 1144.

  • In the experiment parameters panel, set Event Number to 1144.

In the indexing panel, tick "Indexing on". Indexed peaks will be marked with magenta circles. These triple rings represent the integration radius.

...