pilatusROI: An Enhanced EPICS Interface to the Pilatus Detector


February 1, 2008

Mark Rivers

University of Chicago


NOTE: This module is now obsolete and has been replaced by the areaDetector module.




The Pilatus detector is controlled at the lower level by a program called camserver that runs on the Linux machine to which the Pilatus detector is connected. camserver listens for socket connections from clients, and accepts ASCII commands to collect images and perform other actions.

Dectris supplies a basic EPICS interface with the Pilatus that uses the "stream" device support to communicate with camserver. While this interface is useable, it lacks many of the features that are desireable for use on a beamline.

pilatusROI is designed to be a replacement for the EPICS device support provided from Dectris. It includes the following features that the Dectris support lacks:

Note that pilatusROI uses different EPICS PV names from those used for the same functions in the Dectris EPICS support. This allows both databases to be used with no conflict if so desired.



The EPICS implementation consists of the following:


EPICS records

The following EPICS records are used by pilatusROI. All records are prefixed by the macro $(DET) which must be passed to the template file when the records are loaded.

Acquisition related records

Detector related records

File name related records

The FilePath, Filename, FileNumber, and FileFormat PVs are all used to create the final FullFilename.

ROI related records

The SNL code supports up to 32 rectangular ROIs. Fewer ROIs can be used by loading the pilatusROI_N.template file fewer than 32 times, and passing NROIS<32 to the SNL program when it is started. In the following record names $(N) is a number from 1 to 32. ROIs can be any size from a single pixel to the entire chip. An ROI is considered invalid and ignorred by the SNL program if any of Xmin, Xmax, YMin, YMax is less than 0 or greater than the size of the chip in that direction. The ROI is also invalid if Xmin>XMax or YMin>YMax. The ROI$(N)TotalCounts and ROI$(N)NetCounts are computed as each TIFF file is read, regardless of the value of NImages. The ROI$(N)WFTotalCounts and ROI$(N)WFNetCounts arrays are computed and posted to EPICS when acquiring data with NImages>1. The first element in each array is the for the first image in the series, etc.

Image related records

Bad pixel map related records

Flat field correction related records

Communication related records

Scan related records