This is a short description on how to use SPEC macros provided by DECTRIS. With the permission from Oliver Bunk, Swiss Light Source, PSI, we hand out a set of macros, which allow to control a PILATUS detector. If you have any questions please direct them to email@example.com and do not contact Oliver Bunk. The macros can help to integrate the detector into a SPEC environment but require a deeper understanding of SPEC for adaption to your own infrastructure. Please make sure that you have a correct SPEC licence from certif.com.
The macros are combined in a zip file.
Standard spec_commands are written italic, PILATUS specific spec_commands are bold.
In the beginning a few words to SPEC: It is a command line interface to control motors at beamline/motorized installation and to read back detector values. Its main purpouse is to move a motor and then count* for a certain time with several devices. Then the motor moves to the next position and the detectors count* again. This is repaeted as often the scan got told to do so. However, the DECTRIS Pilatus detectors do NOT give back values (2d data) to SPEC but write images. The provided SPEC macros allow, however, to use the Pilatus with SPEC saving images to a defined folder.
*...counting means for SPEC one value of some device (e.g. the electrons arriving on a diode)
ct ... simple command (values are only logged in the log file, not in the data file)
The data file .s is standard of SPEC and often used by the user to find the data
There are also log files which are recorded, where "all" data which is also seen on the SPEC screen is written. The three are:
Usual SPEC commands like mv, mvr are working (for details see certif.com). TIP: Using umvr updates the position after a move.
dscan ebtrx -1 1 10 0.5
dsacn... relative scan
ebtrx ... motor name
number of intervals
time to record image/data/counting without moving time
timescan ... with no arguments just records the data (interrupt with Ctrl-C)
loopscan 10 0.5 0.5 ... 10 repetition 0.5 s and wait in between 0.5
As mentioned above, a profound knowledge of SPEC is needed to carefully adapt the macros to its own needs. However, for a fast way of getting them to work only a few modifications have to be done. First the files have to be copied to a location e.g. /usr/local/lib/spec.d/macros and then the site.mac file has to be extended with the content of the site.mac.example file. The order of the qdofile has to adapted with the current entries. It is possible that ordering has to be changed depending on the current installation.
In the pilatusii.mac file the following adaption have to be made:
If the adjustments above are done it should be possible to connect to the detector and start camserver. You should be able to connect to a detector by using pilatus_on 1 on in SPEC. Then the threshold has to be set according to the needs of the experiment (see the Pilatus User Manual for details). For any further help please use pilatus_help or where it points to. Every time you do a SPEC count, there will be a text message, image saved at this path, but you can use SPEC as usual.
In the "standard" SPEC mode, the provided macros make one image at a time with the requested exposure time. To be ale to use the full capabilities of the PILATUS detectors there are two functions available which allows fasts series of images. By using one of the following two commands it is possible to make fast series of images. One mode allows to make a single series of images (here called burst mode) and anther allows to make a burst at each point. The latter is basically a pre-configuration where at each "normal" scan or ct of SPEC not one image is recorded but N imges with the set exposre time. Use also the help command in SPEC without argument.
burst_scan 17 0.1 (means just recording a series of 17 images where each is 100ms long (readout time adjusted to 3ms, but can be changed. min readout time for PILATUS detectors is 2.3ms). No motor is moved at all.
burst_at_each_point 10 (every time the motor stops in a spec scan you do 10 images in a series) can be very useful when you need (e.g.) more dynamical range
normal scan and at each point of ANY scan which is done
Connect second Pilatus by
to check pilatus_show_all ... should show all
set the desired threshold
and work as usual, the data is stored in the pilatus_2 (and pilatus_1) folder