Page tree

There is a suite of tools to help you calibrate a percival. They take command-line parameters, which usually have default-values and do not show a GUI. This is partly because at DLS the high-power computers lack GUI support. All support the -h option for help.

The software is in a rough state, and you should be willing to make a few changes to it here and there to get it to do what you want. However WN has used it successfully at Diamond and it is the best software available.

They are in user_scripts if they are finished and working. Experimental or unfinished programs are in sandbox.

Some of these scripts were written when the frame-size standard was 1408 columns, and some when it was 1440. You may need to alter the scripts to cope with 1440 columns, where the cols 0,31 are unused.



Script NamePurpose
tool_vin_scan.pyThis script initiates 300 acquisitions on the detector/daq system. The results can be used to calibrate the head. This is called a "scan" over VIn values.
tool_merge_daq.pyThis script combines the output from two FP's in to a single file, and also can add a reference column.
wn_adc_graph.pyThis script will create a 3d-histogram of the coarse / fine values seen at various VRST levels.
wn_pixel_histo.pyThis will create a 2d-histogram of the values on pixels. The x-axis is the pixel value and the y axis is number of pixels.
ruff_query_pixel.pyThis tells you the value of a specific pixel of a specific frame of a specific acquisition.
tool_calib_graph.pyThis creates graphs of the distiller output and it is useful for that.
ruff_index_gen.pyThis generates an index.dat file of the acquisitions you wish to run the distiller on.
meanvar-gen

This is a C++ program in percival-detector/data/frameProcessor/test, and may get packaged in the rpm in future. You can run it like eg.

/home/ulw43618/Projects/percival-detector/data/build/bin/calib-ms --calib /dls/detectors/Percival/captures/example__ADCcor_fixed.h5 --indir /mnt/gpfs02/detectors/new/Percival/captures/scan700 --minframe 10 --maxframe 700

It will run over frames (minframe, maxframe-1) in the acquisitions in the directory indir, use the calib file to create CADU frames, and then construct two images avg and var which are pixelwise average and variance. It will save these under --save.

It will then calculate the mean of avg over all non-nan pixels, and the mean of var over all non-nan pixels. It prints to stdout the man avg, and the sqrt(mean var).

meanvar-gen --multigain

In multigain mode, the program will, for each acquisition, create three frames g0,g1,g2. On frame gn a pixel will contain the average value of that pixel in gain mode gn in the frames of the acquisition, or NaN if it is never seen in gain mode gn. It prints to stdout the total number of pixels in gn across the acquisition and sensor-area, and the average value of them.

with --save, it will save a file mg.h5 which has 6 datasets: gn_tot and gn_count.

wn_multigain_graph.pyThis script reads the output file created by calib-ms --multigain, which you need to save as a text file. For each acquisition and gain-mode it takes the avg pixel-value and uses it for linear-regression; calculating the intersect and slope gives you the Pedestal (printed out) and the ratio between the slopes of 2 gain modes.
wn_meanvar_graph.pyThis is used to discover e_per_adu on a per-pixel basis from the shot-noise.
tool_ptc_graph.pyThis creates the graphs of the ptc so you can get the e_per_adu.
ruff_show_pix.pyThis was written to give you a picture of a frame from the sensor. It works with various datasets in various ways, but generally you specify your input.h5 file and the frame you wish to view.
  • No labels