Pilatus Detector System

The Pilatus X-ray detectors are programmable cameras. Py4Syn uses the standard area detector EPIC IOC for communicating with them. Since the IOC provides a high level API, most of the acquisition logic is implemented in the IOC. The camera is implemented as a standard ICountable, but instead of returning values to be plotted, the acquired images are stored into files.

Using EPICS Pilatus camera module

Usage of Python class for EPICS Pilatus cameras.

class py4syn.epics.PilatusClass.Pilatus(mnemonic, pv)[source]

Class to control Pilatus cameras via EPICS.

Examples

>>> from shutil import move
>>> from py4syn.epics.PilatusClass import Pilatus
>>> from py4syn.epics.ShutterClass import SimpleShutter
>>> 
>>> def getImage(pv, fileName='image.tif', shutter=''):
...     shutter = SimpleShutter(shutter, shutter)
...     camera = Pilatus('pilatus', pv)
...     camera.setImageName('/remote/' + fileName)
...     camera.setCountTime(10)
...     camera.startCount()
...     shutter.open()
...     camera.wait()
...     camera.stopCount()
...     shutter.close()
...     move('/remote/' + fileName, '/home/user/' + fileName)
...     camera.close()
...

Constructor See py4syn.epics.StandardDevice

Parameters:
mnemonic : string

A mnemonic for the camera

pv : string

Base name of the EPICS process variable

canMonitor()[source]

Returns false indicating that Pilatus cannot be used as a counter monitor.

canStopCount()[source]

Returns true indicating that Pilatus has a stop command.

close()[source]

Stops an ongoing acquisition, if any, and puts the EPICS IOC in idle state.

getFileName()[source]

Returns the name of the image to be saved.

getFilePath()[source]

Returns the path where image file should be saved.

getValue(**kwargs)[source]

This is a dummy method that always returns zero, which is part of the py4syn.epics.ICountable interface. Pilatus does not return a value while scanning. Instead, it stores a file with the resulting image.

isCounting()[source]

Returns true if the camera is acquiring an image, or false otherwise.

Returns:
`bool`
setAcquirePeriod(period)[source]

Sets the acquire period.

Parameters:
t : float

Acquisition period

setCountTime(t)[source]

Sets the image acquisition time.

Parameters:
t : float

Acquisition time

setFileName(name)[source]

Sets the output image file name. The image will be saved with this name after the acquisition.

Parameters:
name : string

The name of image to save.

setFilePath(path)[source]

Sets the output image file path. The image will be saved in this location after the acquisition.

Parameters:
name : string

The path of location to save the image.

setImageName(name)[source]

Sets the output image file name. The image will be saved with this name after the acquisition.

Parameters:
name : string

The full pathname of the image.

setPresetValue(channel, val)[source]

Dummy method to set initial counter value.

setTriggerMode(mode)[source]

Trigger mode

Parameters:
mode : int

0 : Internal 1 : Ext. Enable 2 : Ext. Trigger 3 : Mult. Trigger 4 : Alignment

startCount()[source]

Starts acquiring an image. It will acquire for the duration set with setCountTime(). The resulting file will be stored in the file set with setImageName().

See: setCountTime(), setImageName()

Examples

>>> def acquire(pilatus, time, filename):
...     pilatus.setCountTime(time)
...     pilatus.setImageName(filename)
...     pilatus.startCount()
...     pilatus.wait()
...     pilatus.stopCount()
...
statusChange(value, **kw)[source]

Helper callback used to wait for the end of the acquisition.

stopCount()[source]

Stops acquiring the image. This method simply calls close().

See: close()

wait()[source]

Blocks until the acquisition completes.