Skip to content

Telescope script

The telescope script was made to be able to easily configure multiple readout boards and modules, e.g. for a cosmics telescope. If a cocina compatible PS is used to power RB and modules, the script can even take care of powering the boards on, otherwise it will configure RBs and Modules up to a physics configuration to be able to take data.

The configurations are based on yaml config files that should be located in configs/, e.g. telescope_bu_2.yaml:

0:
    type: "modulev1"
    psu: [["192.168.2.1", "ch1"], ["192.168.2.1", "ch2"], ["192.168.2.1", "ch3"]]
    modules: [[104], [], []]

This configuration contains a single layer (0), with modules of type modulev1, list of power supply channels (optional) and a list of connected modules with their IDs. In this example, module 104 sits in slot 1 of the RB (below the VTRx+ optical transceiver).

When your config file is ready, you can run the telescope script like

ipython3 -i telescope.py -- --kcu 192.168.0.10 --offset 15 --configuration bu_2 --power_up

This will use the KCU board with IP address 192.168.0.10, use the configuration file from above, power up the boards through the cocina software package, and will put the thresholds of the ETROCs to the baseline + 15 (offset is set to 15).

Below are a few examples on how to interact with RBs and ETROCs:

# read temperatures from RB 0, returns a python dict
rbs[0].read_temp()

# get readings of all the ADCs on the GBT-SCA Chip
rbs[0].SCA.read_adcs()

# show the module status of all the connected modules
for i in range(3):
    rbs[0].modules[i].show_status()

# read temperature from ETROC 0 on the connected module
rbs[0].modules[0].ETROCs[0].read_temp()

# change the power mode of one of the ETROCs
rbs[0].modules[0].ETROCs[0].set_power_mode("medium")  # high, low, default also available

# read the current power consumption of the module, connected to channel 2 of the power supply
PSUs['192.168.2.1'].measure('ch2', 'power')

# set the L1A (trigger) rate of the KCU board to 100kHz
fifos[0].set_trigger_rate(100000)  # don't forget to set it back to 0!

Keep in mind that once you re-initialize a RB or ETROC through e.g. new_rb = ReadoutBoard(...) or new_etroc = ETROC(...) the respective boards or chips will be set into their default configuration again. Any changes made, i.e. switch of power mode, will be overwritten. To still be able to manipulate an already initialized RB or ETROC we have added a poke* functionality, e.g.

from tamalero.ReadoutBoard import ReadoutBoard
from tamalero.utils import get_kcu, load_yaml
from tamalero.Module import Module


rb = ReadoutBoard(0, kcu=kcu, config='modulev1', poke=True)
module = Module(rb, i=1, poke=True)

This will allow you to e.g. just read the temperature of a given ETROC without having to reconfigure it. More examples can be found in the poke_board.py script, which can be used e.g. like

ipython3 -i poke_board.py -- --temperature --kcu 192.168.0.10 --configuration modulev1 --etroc 0,1,2 --module 1 --rb 0

to just obtain temperatures from 3 ETROCs on module 1 on RB 0.

To power down the entire test stand described above you can do

ipython3 -i power_cycle.py -- --ip 192.168.2.1 --ch ch1,ch2,ch3 --power_down