The CXI wavefront sensor is a system composed of a series of checkerboard phase gratings housed in the DSA detector tank, and an Optique Peter microscope mounted on the upstream end of the DG2 stand.

The wavefront sensor (WFS) is not a permanent component in the beamline. We only use it when doing nano-focusing experiments at SC2 (SC01). 

WFS is composed of:

  • 9 gratings in the JF4M detector chamber, on XY stage, we use the stage to select or move in/out the gratings
  • Optique Peter
    • Black Kapton tape covered YAG
    • 45° mirror
    • Objective lens with focus motor
    • Zyla Andor camera

Hardware

The gratings details are as follows. A grating should be selected based on the experiment photon energy and planned detector distance. For example, the gratings are approximately 50cm downstream of focus at the upstream end of detector z motion, and 1 meter downstream of focus at the downstream end of detector z motion.

GratingPosition (x, y)Rotation angle (deg)Design Energy (keV)Grating Design Distance (m)Grating effective period (microns)Height (microns)Substrate thickness (microns)Transmission
1-2.4, -0.25210.50.59.513.420027%
21, -0.5210.50.7510.513.420027%
34.5, -0.75210.511113.420027%
4-3, 51.89.50.5101220018%
51, 51.89.50.75111220018%
64, 51.89.5111.51220018%
7-3,10.5170.511.58.810012%
81, 10.5170.75138.810012%
94, 10.517113.58.810012%

OUT position for the WFS grating: (-12, -10)

The Optique Peter microscope has an effective magnification of 1.8X, and is paired with an Andor Zyla camera, such that the effective pixel size is 3.6111 microns.

Based on in-situ calibration, the gratings are a distance 0.969 meters from nominal focus, and the microscope is a distance 1.033 meters beyond the gratings, when the in-vacuum z-axis detector motion is at 0mm. The analysis software accounts for the position of the detector stage when calculating the focus location.

The gratings can be selected using the Wavefront Sensor screen under User Devices on cxihome, by moving WFS X and Y to the locations in the above table.

The Optique Peter microscope can be translated horizontally (CXI:USR:MMN:09 on CXI User Newport 2) and vertically (CXI:USR:MMS:25) to center the microscope on the beam.

For the moment we are running the zyla at 10Hz when using the full frame in the DAQ.

Software

Preliminary

To run the analysis software running on shared memory (note this has not been tested while other shared memory processes are also running), execute the following on a CXI terminal:

  • su to your personal unix account (may work as cxiopr but has not been tested)
  • If this is the first time running the software for the current experiment, copy the config file from the commissioning experiment
    • cd ~seaberg/Python/wfs_interface/config
    • cp cxix44419.cfg <expname>.cfg (replace <expname> with the current full experiment name)
  • run "~seaberg/Python/wfs_interface/run_WFS.sh"
    • with optional argument -e <expname>, for example "~seaberg/Python/wfs_interface/run_WFS.sh -e cxix44419"
    • You should see the following screen
  • Check current configuration
    • If run with the optional -e argument, the config file with name matching the current experiment will be automatically loaded
    • Under the File menu, select Modify Configuration
    • This should bring up the following window
    • Check to ensure that the following fields read:
      • Focus to grating (m): 0.969
      • Grating to detector (m): 1.033
      • Pixel size (microns): 3.6111
      • Grating z motor: CXI:DS1:MMS:06.RBV
      • Detector name: zyla_0
      • Lineout width (pixels): 100
      • Talbot fraction: 1.0
      • Noise threshold: 10
      • Downsampling: 3
      • Legendre order: 16
    • The following fields may depend on the current configuration/experiment
      • Photon energy (keV)
      • ROI (x0, x1, y0, y1) - should match AMI since this is not a tiled detector
      • Grating pitch (microns): replace with grating effective period in the grating details table at the top of this page, for the currently selected grating
      • Rotation angle (degrees): replace with Rotation angle from above grating details table for the currently selected grating
      • 2D retrieval:
        • If set to False, the wavefront will be processed in 1D (faster)
        • If set to True, the wavefront will be processed in 2D (slower but will show an image of the retrieved wavefront and the focus, instead of the raw image and the FFT)
      • Epics List: add DAQ aliases and/or PV's where you might be interested in looking at how the wavefront properties change as that PV changes.

Analysis

  • To start the wavefront processing, select "live" from the dropdown menu near the lower left of the main screen (with default "local")
  • Click Run
    • This will take some time to generate the basis used for integrating the wavefront gradient, and connecting to the shared memory events
  • If the DAQ is running then information should start coming to the plots on the main screen
  • AMI-style correlation plots can also be made by clicking the Make Plots button
    • Choose the desired X and Y-axis (dropdown menu will be populated once events start being processed)
    • Enter the relevant Min, Max, and number of Points for the X-axis in the text boxes, and hit Enter if you want the new value to be picked up
    • Note that currently there is no way to reset plots without clicking Stop and Run again. There is a 5000 event buffer which is what is used to generate the plots

Offline Data Processing

  • The automatic run processing (ARP) can be set up for offline data processing.
    • If already set up, the processing can be run through the elog as described here: Automatic Run Processing. This will produce files in <exp_dir>/hdf5/smalldata/wfs_hdf5, where <exp_dir> is the experiment directory e.g. /cds/data/psdm/cxi/cxily1321.
      • If requested, this can also be set up to run on the FFB.
    • If not set up yet, the most recent codebase is in /cds/data/psdm/cxi/cxily1321/results/wfs_code (henceforth shortened to wfs_code)
      • Copy the contents of this directory to the appropriate directory for a new experiment, and modify one of the config (*.cfg) files in wfs_code/code to match the current geometry, with filename given by <expnum>.cfg
  • Example Jupyter notebooks can be found in the wfs_code/notebooks directory.
  • No labels