7. pnCCD Data Acquisition

7.1. Run Control

The SQS DAQ Karabo subproject is called SQS_DAQ_RUN_MGMT, which is found under the AMAIN main project. Click on the little triangle beside the SQS_DAQ_RUN_MGMT subproject to expand it. Open the SQS_RUN_CONTROL_GLOBAL_STATE scene (Fig. 7.1).

_images/Run_Controller.png

Fig. 7.1 The SQS_RUN_CONTROL_GLOBAL_STATE scene with which one can set up the run control. Here, only the data sources related to the pnCCD devices are selected.

To set up the DAQ in order to take a data run with pnCCD:

  1. Make sure that detector is in acquiring mode. If so, the ADC 1 and ADC 2 states are both in Acquiring mode on the pnCCD_Main scene (see Fig. 6.2).

  2. If a run is not currently in progress, click on the Ignore data button (see Fig. 7.1). This step is only necessary if you want to change the proposal number and/or the data sources. With this step, the DAQ will go into the Ignore state.

  3. From the Data Source Groups field (see Fig. 7.1), select, by clicking on the little square on their left hand side, the pnCCD data aggregators, which are:

    • SQS_NQS_PNCCD1M-CAL
    • SQS_NQS_PNCCD1M-META
    • SQS_DIGITIZER-UTC1: This is required only if you need to use Karabo bridge.
    • The three abovementioned data sources are sufficient for pnCCD. If the experiment requires some other data sources from SQS devices other than pnCCD, make sure their corresponding data sources are also selected. The SQS beamline scientists should be able to assist you in identifying these latter data sources if you are unsure which ones to select.
  4. Click on the green check mark (Apply All Changes) on the top left corner of the SQS_RUN_CONTROL_GLOBAL_STATE scene to apply the changes. At this point, the Data source boolean state indicator (resembels a small LED on the bottom middle of Fig. 7.1) should be green.

  5. Write the desired proposal number in the corresponding field in the SQS_RUN_CONTROL_GLOBAL_STATE scene (see Fig. 7.1) and hit Enter (keyboard return). Click on Retrieve Proposal button. The Proposal boolean state indicator (resembels a small LED on the bottom middle of Fig. 7.1) should now also be green.

  6. Click on the Push to DAQ button on the SQS_RUN_CONTROL_GLOBAL_STATE scene. Wait a few seconds. The Assign boolean state indicator should now be green.

  7. Click on Apply configuration button and wait until the status message bar (on the middle bottom of Fig. 7.1) confirms that the application was successful. The Configure boolean state indicator should now be green.

  8. Click on Monitor data button on the SQS_RUN_CONTROL_GLOBAL_STATE scene and ensure the Monitor boolean state indicator also turns green.

  9. At this point, the Progress bar should be green and should show 100 percent. if everything has worked like it should, the big boolean state LED indicator called Gloabal State should be green.

  10. If you want to take a dark run, choose “Dark Run for Gain xxx” (specify which gain setting it is for) as the Run Type and choose “No Sample” for the Sample field (see Fig. 7.1). If these are not available, please ask an SQS beamline scientist to make them using the Meta Data Catalog so that the dark runs can be labeled correctly. Everytime you make a change, click on the keyboard return key to ensure that your change is saved in Karabo. If the run is not a dark one, choose appropriate names for Run Type and Sample fields.

  11. Follow the instructions given in DarkRuns to start a dark run.

  12. After enough data are saved (for example, 500 trains are enough for a dark run), click on Stop run button (see Fig. 7.1) to stop the run.

7.2. Offline Data

Following the instructions given in the previous section, raw data are saved on disk.

7.2.1. Accessing the Raw Data

To access the raw data, follow these steps:

  1. Make sure you have permission to access the proposal under study. If not, ask the SQS beamline scientists to add your username to the desired proposal if possible.

  2. Connect to the Maxwell cluster (you may need to first connect to bastion.desy.de):

    ssh -XY username@max-exfl
    
  3. Go to the directory where the current raw data are being stored:

    cd /gpfs/exfel/exp/SQS/201921/p002430/raw/r0010
    
  4. Here, the syntax is as follows:

    • SQS is the instrument.
    • 201921 is the cycle number.
    • p002430 is the proposal number.
    • r0010 means the desired run number is 10.
  5. If the DAQ is setup correctly and the connection between the DAQ device and the data aggregators is established correctly, for run number XXX, there should be a few files in the r0XXX directory. Depending on the selected data sources, these files are of three types:

    • Files like RAW-R0XXX-DA##-S000##.h5
    • Files like RAW-R0XXX-PNCCD01-S000##.h5
    • Files like RAW-R0XXX-PNCCD02-S000##.h5

where DA## or PNCCD## refers to the data aggregators, and S000## refers to the file sequence. Roughly, every 500 trains consists of one sequence. Therefore, if the duration of the run corresponds to 1500 trains, you will end up with 3 raw data files per each selected data aggregator. Note that there will be one image frame saved per train. Also, the slow data are saved in the PNCCD02 data files, while the fast data are saved in the PNCCD01 data files. The slow data refer to the pnCCD gain, bias voltages (HV values for top and bottom pnCCD modules) and the sensors’ temperatures. The fast data are the pnCCD image arrays.

Note

  • Only those files whose names contain PNCCD01 or PNCCD02 will have the data collected by the pnCCD detector because only these files are generated by the correct pnCCD data aggregators.
  1. To open a raw data file, which contains the pnCCD fast data, on Maxwell cluster, do the following:

    1
    2
    module load xray
    hdfview3 RAW-R0XXX-PNCCD01-S000##.h5
    
  2. Go to Open menu (looks like an open book with a red arrow pointing downwards) and click on the menu button found on the top looking like a box with a black square and a ring inside. Browse to gpfs folder and then browse to your desired raw data file.

  3. A window opens, which should have the complete path of your desired raw data file in Recent Files box. Browse to the following path to have access to the raw image data:

    /INSTRUMENT/SQS_NQS_PNCCD1MP/CAL/PNCCD_FMT-0:output/data/image/
    
  4. To ensure data is being properly written on the disk, make sure that the image is non empty and non zero. To do this, one has to display the data and ensure the size of the data array is \(x \times 1024 \times 1024\), where \(x\) is the number of frames and \(0 < x \leq 500\). To display the raw data:

    • Double click on the image to open the raw data image as an array in a spreadsheet.
    • To visualize the data as 2D images (see Fig. 7.2 and Fig. 7.3), right click on the image in the above mentioned path and click on Open As. A window pops up. Select Image as display type. Select the desired color scale from the Select palette drop-down menu. If desired, choose a valid range by setting the desired minimum and maximum ADU values. Set Height as dimension 1 (1024 pixels) and Width as dimension 2 (1024 pixels). Depth would be dimension 0 which is the number of available frames. Click on Reset to set the Depth-End to the maximum available number of frames. Now, you can also change the frame to be displayed (default is frame 0). Finally, press OK to display the image. Once the image is shown, one can choose to display various frames by using the forward and backward arrows.
_images/hdfview3.png

Fig. 7.2 Setting up hdfview3 to display the raw image data.

_images/RawData.png

Fig. 7.3 The raw image data using the hdfview3 tool. The image that is shown here is only part of the actual image due to the limitation of the size of my remote desktop display. What is plotted is sequence 3 of run 76 from proposal p002720 from cycle 202022. The displayed image is frame 49 out of 500 available images and shows the scattered X-rays from a membrane with a lot of small holes.