Versions Compared

Key

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

...

-num_groups: The number of groups into which lasing off profiles are clustered. Setting this number to 1 would be Increasing this number will make better references, but they may also make them less accurate, as you would be averaging a larger number of profiles. If you decide to increase this number by a factor, then I would also increase n by the same factor, so in the end the total number of reference is the same. (see also thoughts from Tim Maxwell below).

-islandsplitmethod: (default value: 'scipylabel') Several image processing algorithms have been created to separate bunches that appear on the same image.  See here for some algorithm details.

  • 'scipyLabel' calls the scipy label function to label contiguous regions.  this is fast, but requires a region of no signal (after de-noising) between the regions.
  • 'autothreshold' tries to separate the islands by automatically finding thresholds that separate them.  this is the recommended mode for multi-bunch operation.
  • 'contourLabel' tries to adjust a threshold until two large groups are found, grouping together pixels using an opencv contour method.  there are two parameters ('ratio1/ratio2') that are settable for the contour method that determine

average all of the lasing off profiles in the run together while setting this number to 'maxshots' would not average your profiles at all. Averaging profiles helps to remove some of the noise you might find in an individual profile but may also make comparisons less accurate. Our experiments have found that setting this parameter to maxshots/3 (which should theoretically lead to groups of ~3) works best.

-roi_expand (default 1): Ratio by which to expand the image from the max and min of the region of interest. This should not affect any analysis but will affect the returned image. Do not set to <1! Call the method 'processedXTCAVImage-roexpand and roiwaistthres: Call the method 'ProcessedXTCAVImage'. If the image does not look clipped, the parameters are fine.

-snrfilter: this one is really sensitive for two bunches, because snr_filter (default 10): Number of sigmas for the noise threshold. This is an important parameter. If you find that all of your images are registering as 'empty', try decreasing this parameter. If you find that your images contain a lot of noise, try increasing this parameter. This parameter is particularly important for 2+ bunch data. Since it sets a threshold based on the noise to higher as the parameter goes up. This means that in an image, zeroing out pixels below that threshold, it is the factor that can separate the two island in case of two bunches, so for two bunch it needs some tweaking . For two bunch data, you may need to tweak this parameter until the two bunches are separated for most of the shots. Bottom line:

  • For single bunch: As low as possible while still removing the noise (i.e.) not getting noise current profiles.
  • For double bunch: As low as possible while separating the two bunches. Call the 'ProcessedXTCAVImageprocessedXTCAVImage' method again, and look at the size of axis 0: this will be the number of bunches detected. You can probably write a program to automatize the determination of this parameter, until you get lets say a 95% of two bunch detection.

Thoughts from Tim Maxwell on Number of Groups

For various beam conditions (note that Tim describes number-of-groups, but our settable parameter is "groupsize"=number-of-events/number-of-groups):

-island_split_method: (default value: 'scipylabel') Only necessary when analyzing data with more than 1 bunch. Several image processing algorithms have been created to separate bunches that appear on the same image.  See here for some algorithm details.

  • 'scipyLabel' calls the scipy label function to label contiguous regions.  this is fast, but requires a region of no signal (after de-noising) between the regions.
  • 'autothreshold' tries to separate the islands by automatically finding thresholds that separate them.  this is the recommended mode for multi-bunch operation.
  • 'contourLabel' tries to adjust a threshold until two large groups are found, grouping together pixels using an opencv contour method.  there are two parameters ('ratio1/ratio2') that are settable for the contour method that determine
  • normal sase (not many beam-related fluctuations): take sqrt of number shots and use that many groups (beat down background noise with lots of averaging).   Tim suggests perhaps a maximum of 100 groups.
  • two-bunch slotted foil (many beam-related of fluctuations): restrict it to 5-10 images per group, make as many groups as possible using typically 30 seconds to a minute of data at 60Hz.
  • split undulator, single bunch, head and tail lase in separate sections of the split undulator: Tim expects this to be somewhat more chaotic than SASE, but not as chaotic as slotted-foil, so some number of groups in between.
  • seeded beam: For any results, I would use the SASE settings. However, note that reconstruction for seeding is a little ambiguous. The beam first seeds, so is partly spoiled before seeding itself in the second stage. Therefore it isn't clear exactly with one lasing off reference which part lased more for the seeded part. It is similar to the case when one bunch is used to make two pulses with the split undulator. However, if seeding amplification was strong and intense, this may be enough.

Detector Resolution

(From Tim Maxwell)

...