This is an UNSTABLE release and not recommended for production use (please use rc.96 instead). * jfjoch_broker: For DECTRIS detectors add dark data collection during initialization for bad pixel mask * jfjoch_broker: Refactor of calibration logic for more clear code (likely to introduce problems) * jfjoch_viewer: Add option to handle user pixel mask (experimental) * jfjoch_viewer: More options for ROI * jfjoch_viewer: Add window to display calibration Reviewed-on: #2 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
1.6 KiB
Pixel mask
Mask format
Jungfraujoch follows generally NXmx format format for pixel mask. Pixel mask is described as 32-bit unsigned integer array of size the same as the image. Conditions to mask pixel are described by setting a particular bit to one. This way it is possible to encode reason why pixel is included in the pixel mask, also for one pixel there can be multiple reasons encoded at the same time.
Bit values are set as follows:
Bit 0 - gap (pixel with no sensor)
Bit 1 - error pixel (for PSI JUNGFRAU: pixel doesn't set proper gain during pedestal, for DECTRIS: pixel is part of detector pixel mask)
Bit 4 - noisy pixel (for PSI JUNGFRAU: pixel pedestal G0 RMS is over threshold, for DECTRIS: pixel was flagged with signal during dark data collection at initialization)
Bit 8 - user defined mask
Bit 30 - module edge (only for PSI systems)
Bit 31 - chip edge interpolated pixel (multipixel)
Custom user mask
Jungfraujoch allows to upload custom user mask. This happens in two steps. First create mask in TIFF format:
import numpy as np
import tifffile as tiff
# Create a 2068x2164 numpy array filled with zeros, with 32-bit unsigned integers
array = np.zeros((2068, 2164), dtype=np.uint32)
# Mark the pixel (300, 400) with the value 1
array[300, 400] = 1
# Save the array as a TIFF file
tiff.imwrite('mask.tiff', array)
Pixels with non-zero value in the TIFF file will be marked as belonging to the user mask (bit 8).
Then upload the mask to Jungfraujoch server:
curl -v http://<jfjoch_broker http address>/config/user_mask.tiff -XPUT --data-binary @mask.tiff