Basic DAQ operations

Diego Venegas-Vargas, Cinyu Zhu - July 2025

Nota Bene

when testing, always send out command one acm a time (instead of to ccdpool) easier to debug and locate the error

0. Prepare

With VME crate and ACM boards properly powered on

1. Ping ACM boards

ping 192.168.110.5
ping 192.168.109.5
ping 192.168.108.5
ping 192.168.106.5
ping 192.168.[ACM Number].5

In many places in the daq program, ccd106 are actually referring to acm106

2. tmux for DAQ Session

cd ~/Soft/ccd-cdaq or tocdaq

tmux a: if there is an active tmux session this will attach you to it

start_daq.sh # if there is not an active tmux session, create it by running this script # this script also starts the clients for each ccd

2.1 tmux commands:

tmux (terminal multiplexer) is a tool that allows you to manage multiple terminal sessions from a single window.

In tmux session every session/terminal on the interface is call a pane.

(when outside tmux) tmux a attach session

ctrl+B, D # detach session

ctrl+B, arrowkeys switch between panes

ctrl+B, [ reading mode, use arrowkeys to scroll up or down

esc: leave reading mode

3. Setup

The following scripts are at LSM_Module_Testing_Scripts or LSM_Module_Testing_Scripts_Paolo

  1. set_cdaq_env

    • set python environment
  2. python start_clients.py

    • This is technically done inside ./start_daq.sh but do doublecheck that all clients are initiated properly via screen -ls

    • At this point, with 4 acm boards, there should be 9 screens, one for each ccd client, one for ccdmanager, one for udp, one for mon_status, one for Spy, and one for run_control

  3. python start_imgbuilders.py

    • this starts the decoder which adds another screen
  4. python LSM_Module_Testing_Scripts/connect_acm.py ccdid

    • start connecting the ACM boards
    • This will add a screen for each acm connected, and will also add the connected acm to the ccdpool
    • to add or remove an acm from the ccdpool:

      python LSM_Module_Testing_Scripts/add_to_ccdpool.py

      python LSM_Module_Testing_Scripts/remove_from_ccdpool.py

  5. python LSM_Module_Testing_Scripts/startup_ccd.py ccdid

    • Start up ccds in each module

    (Following procedures are included in the take_high(low)_temp_image.sh)

  6. python LSM_Module_Testing_Scripts/erase_epurge_180K(130K).py

    • Procedure for eraseing and epurge while cooling donw.
    • At 180K do Erase Flush Epurge Flush Erase flush Epurge Flush
    • At 130K do Erase Flush Erase Flush
    • also includes commands to turn VDD_OFF and set Transfer Gate(TG_H, TG_L) to 7.9
  7. python LSM_Module_Testing_Scripts/flush_on_repeat_queue.py

    • after connection, flush a while (~30 min) before taking the data, so that noise lowered down and stablized
  8. python LSM_Module_Testing_Scripts/VDD_ON.py

    • VDD OFF by default when ccd is just started or after epurge, set it ON to read (clear) tracks
    • VDD_OFF.py # (VDD = -6) no or blurred track, only noise, sigma should be around 2.5 ADU for high temp
    • VDD_ON.py # (VDD = -19) clear readout tracks

4. Data-taking

Once all the initiation and startup procedures for clients, acms and ccds are succesfully completed, we can start taking images, traces and psds

python LSM_Module_Testing_Scripts/setup_run.py [-h] -u <your name> -n <image folder> -t <ccds> --rundir LSM_Module_Testing_Data/

python sendrun.py --to ccdpool "daq.set_acq_counter(0)"

  • to restart the counter at the tail of filename. (files still have different names by timestamp.)

  • reset the end counting in filename (done automatically in setup_run)

python LSM_Module_Testing_Scripts/take_image.py <image_name> -n <number of images> --to <ccd110> [-f] [-s] [-p] [-1]

  • Image_name is defined in _config.py for all the template images needed

  • --to ccd110 take image of 110 on standalone mode without master

  • -sserial register image

  • -f flush after every image

  • --level1 level one data is taken rather than default level 2

python LSM_Module_Testing_Scripts/take_psd.py

  • take a power spectrum measurement for each ccd (fourier transformation of the trace without clocking)

python LSM_Module_Testing_Scripts/take_trace.py

  • be aware that sequencer and config file parameters can be specified inside this script.

5. Edit Queue

If the DAQ gets stuck for some reason, we can restart by following these basic steps

./delqueue.py - clear current queue

./pausequeue.py --unpause - afer deleting queue, the queue is left paused so it is necessary to resume its operation.

./shutdown_client.py ccd106

./start_clients.py - if unpause or disconnect_acm failed, try restart client (client is on computer, usually no need to shut it down before disconnect_acm.)

shutdown_ccd, disconnect_acm, power cycle the VME crate (from SC)

  • if power cycle the system still can't solve the problem, ehh go ask for help?

6. Disconnect

python LSM_Module_Testing_Scripts/shutdown_ccd.py ccdid

wait until the queue is all cleared

python LSM_Module_Testing_Scripts/disconnect_acm.py ccdid


7. Visualization and Analysis

set_cdaq_env # python environment for all the non-Wader scripts

Fit a multi skip image and evaluate single electron resolution (Paolo's script):

acm_analysis_simple 106 mod1 <avg*.fz>

Fit a multi skip image and evaluate single electron resolution (WADER):

setwadersACM # WADER environment panaSKImg "avg_*_1000_skips*.fz" -j ~/Soft/ccd-cdaq/LSM_Module_Testing_Scripts/Analysis/moduletest_SER_hightemp_Nuria.json -o . --acm --save-plots - the output files will be saved at the folder where you run the command

Plot psd:

acd_plotter --fname <psd*_1.csv> <psd*_2.csv> --compare --psd

Plot trace:

acd_plotter --fname <trace*.csv> --trace --delta_t 10000

ds9

inspect the image visually and make preliminary analysis (hist, statistics)

ds9 <avg*.fz>

8. Miscellaneous

alias we are using:

alias ds9="ds9 -scale zscale -scale linear -mecube -regions shape box" # open ds9 with cube, and use box region by default
alias set_cdaq_env='source /home/damicm/Soft/ccd-cdaq/cdaq_env/bin/activate'
alias adc_plotter='python /home/damicm/Soft/ldaq/tools/adc_plotter.py'
alias acm_analysis_simple='python /home/damicm/analysis_Paolo/acm_analysis_simple.py'
alias setwadersACM='source /home/damicm/repos/waders/pysimdamicm/venv_waders_ACM/bin/activate'

Which CCD is connected to which channel

in ds9 topbar: file -> header -> select the first file, you will find:

CH0     = 'CCD_A   '                                                            
CH1     = 'CCD_B   '                                                            
CH2     = 'CCD_D   '                                                            
CH3     = 'CCD_C   '  

useful when you just want to find a paramter but ds9 takes forever to load on your pc

set_cdaq_env

fitsheader <name_of_the_file>

Printout only the first 2 lines of a ls (or any command)

useful when you want to get the full filename of the image you just took

ls -lt | head -n 3

Copy file from daq to local

useful if your computer takes forever to open ds9 via XQuartz

scp -r "daq2:path_to_the_file_with_wildcards*.fz" <destination>

(daq2 is set in ~/.ssh/config)