Attributes#
Attributes and commands grouped by the SerialEMCCD plugin capability they
belong to. Plugin source references are to
SerialEMCCD at commit 4d6e4b1;
the calls themselves are listed in SerialEMCCD plugin calls.
Names#
EPICS (CA) |
REST |
|
|---|---|---|
Attribute |
|
|
Root attribute |
|
|
Read-write |
setpoint PV, plus |
|
Command |
write |
|
<id> is the controller id in the YAML config. The PV column in the
tables below leaves out the <id>: prefix.
The sections follow the plugin’s capability areas. The attribute groups in the code (which organise the EPICS screens) don’t always match them; each section names the code’s sub-controller and group.
The “Plugin side” column says whether an attribute is an argument or a result of a plugin call, or driver if it exists only in fastcs-gatan.
Version and diagnostics#
Root controller, group Status. Read once when the driver starts; not polled.
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
Int, R |
result of |
DM version number |
|
|
Int, R |
result of |
Plugin API version ( |
|
|
Int, R |
result of |
Result code of the plugin’s last call ( |
Also implemented on the connection, but not attributes: GetDMVersionAndBuild,
GetDMCapabilities.
Dose rate#
Root controller, group Status. A section of its own because the plugin has no area it obviously belongs to.
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
Float, R |
result of |
Dose rate DM reported for the last image, per unbinned pixel per second; 0 if DM couldn’t give one ( |
Camera selection and insertion#
camera sub-controller: num_cameras, current_camera and select have
no group, the rest are in group Insertion. current_camera is the camera
index every call here uses.
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
Int, R |
result of |
Read at startup |
|
|
Int ≥ 0, RW, default 0 |
argument of the calls below |
Only sent to the plugin by |
|
|
command |
|
The plugin stores the index and uses it when it builds DM scripts for later calls (L504). |
|
|
Bool, R |
result of |
Read at startup and while |
|
|
command |
|
Moves real hardware; then polls |
|
|
command |
|
As |
|
|
Int ≥ 1, RW, default 30 |
driver |
Seconds |
|
|
Int ≥ 1, RW, default 1 |
driver |
Seconds between |
Read mode and K2/K3 parameters#
acquisition sub-controller, group ReadMode. These values are stored in the
driver and only reach the plugin when a command sends them.
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
Int, RW, default 0 |
argument |
0 K2 linear, 1 K2 counting, 2 K2 super-resolution, 3 K3 linear, 4 K3 counting; above 4 is treated as 4. The plugin treats |
|
|
Float, RW, default 1.0 |
argument |
Count scaling. In K3 linear mode it also carries the per-frame offset |
|
|
Int, RW, default 0 |
argument |
Hardware correction setting, 0, 2, 4 or 6; the plugin clamps it to 0-6 and maps it onto DM’s hardware corrections (L5979-L5980, L1281) |
|
|
Bool, RW, default off |
argument |
DM frame alignment: out of scope, keep off |
|
|
Int, RW, default 0 |
argument |
Rotation/flip code for saved frames; negative leaves the plugin’s value unchanged |
|
|
Int, RW, default 0 |
argument |
Flag bits; 32 ( |
|
|
command |
|
|
|
|
command |
|
The plugin calls |
Three more SetK2Parameters2 arguments sit in group FrameSaving in the code.
Only apply_k2_parameters reads them; acquire_dose_fractionated sends its
own values:
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
Bool, RW, default off |
argument |
|
|
|
Float ≥ 0, RW, default 0.05 |
argument |
Seconds per sub-frame |
|
|
Bool, RW, default off |
argument |
Exposure parameters (GetAcquiredImage arguments)#
GetAcquiredImage is the plugin’s one acquisition call; single images,
continuous acquisition and dose fractionation all use it. What one call does
is decided in TemplatePlugIn::GetImage
(L878):
frame saving is on only if SetK2Parameters2 turned on both dose
fractionation and frame saving and SetupFileSaving2 gave a folder and a
name (L897-L899);
continuous mode needs processing above 7 and frame saving and alignment
off (L972-L988).
In the code, the parameters below are in acquisition, group Acquire, along
with the single-image attributes.
Mode |
Set up by |
What the plugin does |
Sent to fastcs-gatan |
|---|---|---|---|
Single image |
|
One exposure; stops continuous mode first if it is running |
One image per call |
Continuous |
|
First call starts an acquisition loop in a plugin thread; each later call copies out its newest frame ( |
One image per call; frames the loop takes between calls never leave the DM PC |
Dose fractionation |
|
One exposure split into sub-frames, written to disk on the DM PC |
One image: the sum. The sub-frames are never sent |
Every call transfers one full image over the network, and that is the
slow part. The plugin sends 2 bytes per pixel in chunks of up to 32 MiB,
waiting for a handshake from the client after each one
(SocketPathway.cpp L37,
L849-L878).
A K3 frame at physical pixel size (5760 × 4092) is 47 MB, two chunks: at
least 0.4 s at 1 Gbit/s, before any processing time. A super-resolution
frame would be four times that.
What GetAcquiredImage can do on the plugin side, briefly (✓ = used by
fastcs-gatan):
✓ exposure time, binning, processing (unprocessed, dark-subtracted, gain-normalised), readout area
✓ shutter selection; shutter delay, settling time, divide-by-2 and DM correction flags (sent as 0)
continuous mode with a quality setting (planned)
✓ dose fractionation with frames saved as MRC, MRCS or TIFF (LZW or ZIP) on the DM PC; further options such as 4-bit packing, summing frames before saving and a gain-normalised sum, set through flag bits
early return (send the sum back before saving finishes), deferred sums, frame alignment in the plugin, tilt sums: out of scope
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
Int ≥ 1, RW, default 1024 |
arguments |
Image width in binned pixels; the readout area starts at 0, 0 |
|
|
Int ≥ 1, RW, default 1024 |
arguments |
Image height in binned pixels |
|
|
Float ≥ 0, RW, default 0.1 |
argument |
Seconds. Single image and continuous; dose fractionation uses |
|
|
Int ≥ 1, RW, default 1 |
argument |
|
|
|
Int, RW, default 0 |
argument |
0 unprocessed, 1 dark-subtracted, 2 gain-normalised. Continuous mode will add its bits on top |
|
|
Int, RW, default 0 |
argument |
DM shutter index |
|
|
Waveform, R |
result: the image |
The image from the last call, single or dose-fractionated sum. Up to 4096 × 5760; decoded as unsigned 16-bit (signed/unsigned not settled yet) |
Single image#
acquisition, group Acquire.
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
command |
|
Returns when the image has arrived. Uses whatever read mode and K2/K3 parameters the plugin last received |
|
|
String, RW, default empty |
driver |
If set, each image is also saved here, on the driver’s machine |
|
|
String, RW, default |
driver |
File names are |
|
|
String, R |
driver |
MRC file of the last saved image |
Continuous#
acquisition, group Continuous. Not implemented yet: both commands
currently fail.
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
Int 0-7, RW, default 0 |
bits 3-5 of |
|
|
|
Bool, R |
driver |
|
|
|
command |
|
Each frame fetched is a full image transfer |
|
|
command |
|
Dose fractionation (frames saved on the DM PC)#
acquisition, group FrameSaving.
acquire_dose_fractionated runs, in a worker thread, with nothing else
allowed on the connection in between:
SetK2Parameters2with dose fractionation and frame saving on, the frame time, and frame alignment offSetupFileSaving2with the folder, name, pixel size and flags (one stack file, not one file per frame)GetAcquiredImage: the exposure; the plugin saves the sub-frames and returns their sumGetFileSaveResult: frames saved and saving errorSetK2Parameters2with dose fractionation and frame saving off again
Read mode, scaling, hardware processing, rotation/flip and k2_flags come
from group ReadMode; size, binning, processing and shutter from the exposure
parameters.
Attribute |
PV |
Type |
Plugin side |
Notes |
|---|---|---|---|---|
|
|
Int ≥ 1, RW, default 40 |
driver input |
Number of sub-frames |
|
|
Float ≥ 0, RW, default 2.0 |
argument |
Total exposure in seconds |
|
|
Float ≥ 0, RW, default 0 |
argument |
Seconds per sub-frame; 0 = exposure / frames. The camera may not reach the requested time, so check |
|
|
String, RW, default empty |
in the name strings of |
Folder on the DM PC. Required |
|
|
String, RW, default |
in the name strings of |
File name without extension |
|
|
Float ≥ 0, RW, default 1.0 |
argument |
|
|
|
Int, RW, default 0 |
argument |
0 = uncompressed MRC; 8 LZW TIFF, 16 ZIP TIFF, 65536 |
|
|
command |
the sequence above |
Returns straight away; watch |
|
|
Bool, R |
driver |
True until the sequence ends |
|
|
Enum, R |
driver |
Idle, Acquiring, Done or Failed |
|
|
String, R |
driver |
Error text, or a note when fewer frames were saved than requested |
|
|
Int, R |
result |
|
|
|
Int, R |
result |
0 = OK, names in |
|
|
String, R |
driver |
Where the plugin wrote the frames, on the DM PC: |
Shutter and settling#
SetShutterNormallyClosed and SetNoDMSettling are implemented on the
connection but have no attributes yet.
Not covered#
Plugin capabilities fastcs-gatan does not use:
DM scripting:
ExecuteScript,QueueScriptDark and gain references, defects:
GetDarkReference,GetGainReference,FreeK2GainReference,GetDefectListFrame alignment in the plugin:
SetupFrameAligning,FrameAlignResults,MakeAlignComFile,IsGpuAvailable,ReturnDeferredSum,GetTiltSumProperties,SaveFrameMdocDigiScan/STEM:
GetDSProperties,AcquireDSImage,ReturnDSChannel,StopDSAcquisitionOther:
WaitUntilReady,SetDMVersion,SetDebugMode
Known limitations#
As the code stands:
Continuous acquisition is not implemented; its commands fail.
Group names differ from the plugin areas:
dose_frac,frame_timeandsave_framesareSetK2Parameters2arguments but sit in group FrameSaving, not ReadMode; group Acquire holds both the shared exposure parameters and the single-image attributes.last_dose_rateand the other Status values are read only at startup.last_frameis decoded as unsigned 16-bit; whether the plugin’s data should be read as signed or unsigned is not settled. Frames larger than 4096 × 5760 (super-resolution) don’t fit it.acquire_imageblocks the driver until the image has arrived, so nothing else updates meanwhile.Shutter and settling calls have no attributes, and the shutter delay, settling, divide-by-2 and corrections arguments of
GetAcquiredImageare always 0.Plugin version: the source cited here is plugin version 121; check
plugin_versionon the real system, which may run an older plugin.