BCDA-APS / apstools

various tools for use with Bluesky at the APS
https://bcda-aps.github.io/apstools/latest/
Other
16 stars 9 forks source link

add support for Caen picoammeter - TetraAMM #878

Closed prjemian closed 4 months ago

prjemian commented 1 year ago

Thanks, @cpchuang, for suggesting.

prjemian commented 1 year ago

@cpchuang emailed:

this is the unit I mentioned about... my group has few. https://www.caenels.com/product/tetramm/

EPICS support, https://github.com/epics-modules/quadEM

prjemian commented 1 year ago

example GUI

image

prjemian commented 4 months ago

Ophyd has support that uses the area detector classes: https://github.com/bluesky/ophyd/blob/030c668da64443c54e17679f3342df371c52a620/ophyd/quadem.py#L128

prjemian commented 4 months ago

Many beamlines are planning to use the TetrAMM:

prjemian commented 4 months ago

The example TetrAMM IOC has the following PREFIX and RECORD definitions:

epicsEnvSet("PREFIX",    "QE1:")
epicsEnvSet("RECORD",    "TetrAMM:")

It loads a commonPlugins file similar to areaDetector IOCs, which uses those values for the record names:

dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=$(RECORD)image1:,PORT=$(PORT)_Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=11,TYPE=Float64,FTVL=DOUBLE,NELEMENTS=110000,ENABLED=0")

This results in record names like QE1:tetrAMM:image1:ArrayData

prjemian commented 4 months ago

Support exists in ophyd, nothing more to do here except show how to connect it.

from ophyd import TetrAMM

tetramm = TetrAMM("usxTetr1:qe1:", name="tetramm")
tetramm.wait_for_connection()

Components

sorted(tetramm.component_names)
['acquire',
 'acquire_mode',
 'averaging_time',
 'bias_interlock',
 'bias_state',
 'bias_voltage',
 'conf',
 'configuration_names',
 'current1',
 'current2',
 'current3',
 'current4',
 'current_names',
 'current_offset_calcs',
 'current_offsets',
 'current_scales',
 'em_range',
 'firmware',
 'geometry',
 'hvi_readback',
 'hvs_readback',
 'hvv_readback',
 'image',
 'integration_time',
 'model',
 'num_acquire',
 'num_acquired',
 'num_average',
 'num_averaged',
 'num_channels',
 'ping_pong',
 'position_offset_calc_x',
 'position_offset_calc_y',
 'position_offset_x',
 'position_offset_y',
 'position_scale_Y',
 'position_scale_x',
 'read_data',
 'read_format',
 'reset',
 'resolution',
 'ring_overflows',
 'sample_time',
 'sum_all',
 'trigger_mode',
 'values_per_read']

Example read() (formatted)

tetramm.read()
================================ ========= ==========================
name                             value     timestamp                 
================================ ========= ==========================
tetramm_current_names_ch1        1         IOC boot                  
tetramm_current_names_ch2        2         IOC boot                  
tetramm_current_names_ch3        3         IOC boot                  
tetramm_current_names_ch4        4         IOC boot                  
tetramm_current_offsets_ch1      0.0       2024-06-14 08:41:51.328904
tetramm_current_offsets_ch2      0.0       2024-06-14 08:41:51.328905
tetramm_current_offsets_ch3      0.0       2024-06-14 08:41:51.328905
tetramm_current_offsets_ch4      0.0       2024-06-14 08:41:51.328906
tetramm_current_offset_calcs_ch1 0.0       IOC boot                  
tetramm_current_offset_calcs_ch2 0.0       IOC boot                  
tetramm_current_offset_calcs_ch3 0.0       IOC boot                  
tetramm_current_offset_calcs_ch4 0.0       IOC boot                  
tetramm_current_scales_ch1       1.0       2024-06-14 08:41:51.328907
tetramm_current_scales_ch2       1.0       2024-06-14 08:41:51.328908
tetramm_current_scales_ch3       1.0       2024-06-14 08:41:51.328908
tetramm_current_scales_ch4       1.0       2024-06-14 08:41:51.328909
tetramm_position_offset_x        0.0       2024-06-14 08:41:51.328910
tetramm_position_offset_y        0.0       2024-06-14 08:41:51.328910
tetramm_position_offset_calc_x   0.0       IOC boot                  
tetramm_position_offset_calc_y   0.0       IOC boot                  
tetramm_position_scale_x         1000000.0 2024-06-14 08:41:51.328911
tetramm_position_scale_Y         1000000.0 2024-06-14 08:41:51.328912
tetramm_current1_mean_value      0.0       IOC boot                  
tetramm_current2_mean_value      0.0       IOC boot                  
tetramm_current3_mean_value      0.0       IOC boot                  
tetramm_current4_mean_value      0.0       IOC boot                  
================================ ========= ==========================

tetramm.read_configuration()
=========================== ============================================================ ==========================
name                        value                                                        timestamp                 
=========================== ============================================================ ==========================
tetramm_configuration_names ['tetramm_configuration_names' 'tetramm_integration_time'    2024-06-14 18:01:43.812179
                             'tetramm_averaging_time' 'tetramm_current_names'                                      
                             'tetramm_current_offsets' 'tetramm_current_offset_calcs'                              
                             'tetramm_current_scales' 'tetramm_image' 'tetramm_current1'                           
                             'tetramm_current2' 'tetramm_current3' 'tetramm_current4'                              
                             'tetramm_sum_all']                                                                    
tetramm_integration_time    0.0                                                          2024-06-14 08:41:51.328855
tetramm_averaging_time      0.1                                                          2024-06-14 08:41:51.328878
=========================== ============================================================ ==========================