Basic CSPAD analysis code

An example of how to do a simple CSPAD analysis on xtc data can be found in myana_cspad.cc in the example directory of myana (/reg/g/pcds/package/ana/example).  To help users setting up analyses we provide two classes, CspadCorrector and CspadGeometry, that apply user-selected corrections to the data.  An example of their use can be found in myana_cspad.cc. The classes themselves are found in the same directory for users who wish to extract the algorithms for use outside the myana framework.

CSPAD data corrections

The corrector class, CspadCorrector, can read three files to correct or allow better use of the data: pedestals, gains, and exceptional pixel maps.  The information is written by offline scripts in a simple ASCII format reflecting the readout scheme, by quadrant, two-by-one, column, and row. 

Pedestals

The pedestal file can be made by the user by running 'cspadPedestalCalculator' from the myana example directory.  A script is provided for the experiment operator to so generate a pedestal file from a dark frame run and push it to the online monitoring; for example, '/reg/g/pcds/dist/pds/xpp/scripts/cspad_xtc2ami.py --run <RUN#>' for the XPP environment. It is believed that the pedestals are stable at the few-hour timescale at least; in future running this will be monitored by the online task if practical.  The pedestal varies by several photons from pixel to pixel so this is an important correction for low-occupancy running.  Note that pedestals for high-gain and low-gain running differ.

Gains

Currently under study.

Bad pixels

For each pixel the file will indicate the OR of states like dead, hot, noisy, low-gain.  Under development.

Common-mode noise

There is per-frame correction provided to take out coherent shifts in the pedestal of each two-by-one.  This can be several photons.  There are two algorithms available.  The default bins all pixels in the two-by-one and finds the first peak on the left over a threshold then corrects that value to zero.  Another looks at the truncated distribution of values in a small region and corrects that to zero if the rms of the values is small, indicating no hits, otherwise it keeps looking for a low-rms region.  Both methods fail in the limit where there is high occupancy; the default is more robust against this, and the user can of course adjust the threshold to be more sensitive to the pedestal peak.

CSPAD Alignment

The CspadGeometry class encodes the relative alignment of the detector sections.  It provides accessor functions for retrieving an individual section's translation and rotation.  It also provides a method for interpolating the detector data onto a regular grid using the translations and rotations.  Techniques for determining the alignment constant set are still under development, so the best-estimate constants are simply embedded in the class source code for now.

  • No labels