licel_tr_tcpip

Class Holding methods to communicate with transient recorder

class Licel.licel_tr_tcpip.TransientRecorder(commandSocket, pushSocket, killSocket, socket_File)
TRtype() dict

Get transient recorder hardware information for the selected transient recorder. Old TR produced before Oct. 2009 will not support this command If this command is not supported default values for a TR20-160 are filled in

Returns:

dictionary containing hardware info

Return type:

dict{‘ADC Bits’ : ‘ ‘, ‘PC Bits’ : ‘ ‘ , ‘FIFOLength’: ‘ ‘ , binWidth’ : ‘ ‘,’ID’ : ‘ ‘, ‘HWCAP’ : ‘ ‘, ‘binShift’: ‘ ‘, ‘raw’: ‘ ‘}

blockRackTrigger(trig: str) str

Block a trigger related to the acquisition at the specified Memory = A, B, C, or D. The typical use case is when the rack trigger A and B are driven but a certain channel should be active only when trigger A or B arrives To unblock Trigger see unblockRackTrigger

Parameters:

trig (str) – trigger to be blocked, possible value are A, B, C, D

clearMemory() str

Clear both memories (A and B) of the previously selected device. For more info visit: https://licel.com/manuals/ethernet_pmt_tr.pdf#TCPIP.CLEAR

continueAcquisition() str

Continue the recording process for the previously specified device without reinitializing the memory.

disablePretrigger() str

Disable the pretrigger for a selected TR

enablePretrigger() str

Enable the pretrigger for a selected TR. In TR20-16bit this will be 128 bins long shipped till 2018, since 2018 the TR40-16bit-3U will have 1/16 of the trace length. This means for a 16k the pretrigger will be 1024 bins long. The TR will power up with pretrigger off. TR devices supporting pretrigger indicate it by bit 3 in the HWCAP field of the TRTYPE? command.

getCombinedRawAnalogueData(TRType, dataParser, bins, shots, device, memory)

get the combined raw analogue data set.

Parameters:
  • TRType (dict{'ADC Bits' :" " , 'PC Bits' : " ", 'FIFOLength': " ", 'binWidth' :" " , 'ID' : " ", 'HWCAP' : " ", 'binShift': " "}) – dict holding information about the transient recorder hardware

  • dataParser (Licel.licel_data.DataParser) – Class holding method for processing and parsing raw data

  • bins (int) – number of bins to read.

  • shots (int) – number of acquired shots.

  • device (int) – transient recorder address

  • memory (str can be: 'MEM_A', 'MEM_B', 'MEM_C', 'MEM_D') – memory to read.

Returns:

combined analogue data set and the clipping information for each data point.

Return type:

[Analogue data set: numpy.ndarray(dtype=uint32, ndim =1), Clipping information: numpy.ndarray(dtype=uint32, ndim =1)]

getCombinedRawAnalogueSquaredData(dataParser, binsSqd, device, memory)

get the combined raw analogue squared data

Parameters:
  • dataParser (Licel.licel_data.DataParser) – Class holding method for processing and parsing raw data

  • binsSqd – number of bins to read.

  • device (int) – transient recorder address

  • memory (str can be: 'MEM_A', 'MEM_B', 'MEM_C', 'MEM_D') – memory to read.

Returns:

the combined raw analogue squared data

Return type:

numpy.ndarray(dtype=uint64, ndim =1)

getMultipleShots() str

Return the shotnumber for each memory, there is one clearing cycle at the start.

getMultipleShotsAB() str

Return the shotnumber for each memory, there is one clearing cycle at the start.

getRawPhotonCountingData(TRType, dataParser, bins, shots, device, memory)

get the raw photon data set.

Parameters:
  • TRType (dict{'ADC Bits' :" " , 'PC Bits' : " ", 'FIFOLength': " ", 'binWidth' :" " , 'ID' : " ", 'HWCAP' : " ", 'binShift': " "}) – dict holding information about the transient recorder hardware

  • dataParser (Licel.licel_data.DataParser) – Class holding method for processing and parsing raw data

  • bins (int) – number of bins to read.

  • shots (int) – number of acquired shots.

  • device (int) – transient recorder address

  • memory (str can be: 'MEM_A', 'MEM_B', 'MEM_C', 'MEM_D') – memory to read.

Returns:

photon data set.

Return type:

numpy.ndarray(dtype=uint32, ndim =1)

getRawPhotonCountingSquaredData(dataParser, binsSqd, device, memory)

get the photon counting raw squared data

Parameters:
  • dataParser (Licel.licel_data.DataParser) – Class holding method for processing and parsing raw data

  • binsSqd – number of bins to read.

  • device (int) – transient recorder address

  • memory (str can be: 'MEM_A', 'MEM_B', 'MEM_C', 'MEM_D') – memory to read.

Returns:

the combined photon counting raw squared data

Return type:

numpy.ndarray(dtype=uint64, ndim =1)

getShotsAB() str

Return the shot number for each memory, there is one clearing cycle at the start.

getStatus() list[bool, bool, str, int]

Return the shot number for each memory, there is one clearing cycle at the start.

multipleClearMemory() str

Clears both memories (A and B) of the currently selected devices.

multipleContinueAcquisition() str

The acquisition process of the selected multiple devices will be restarted without clearing their memories.

multipleStartAcquisition() str

The acquisition process will be started with the next received trigger for multiple devices

multipleStopAcquisition() str

The acquisition process will be stoped after the next received trigger for multiple devices

multipleWaitForReady(milliSec: int) str

Wait milliSec until all devices returned from the armed state.

Parameters:

milliSec (int) – milliseconds to wait, maximum is 400ms

Returns:

controller response containing executed if successful else failed.

Return type:

string

selectMultipleTR(devicelist: list[int]) str

The TR corresponding to the numbers in the device list will be selected which means that they will become sensitive to all future commands that do not require a device number input. The devices will be deselected if another select command is issued.

setDiscriminatorLevel(discriminatorLevel: int) str

Set the discriminator level between 0 and 63 for the selected transient recorders. When the threshold mode is activated, a discriminator level of 63 outputs -100mV When the threshold mode is deactivated, a discriminator level of 63 outputs -25mV

setInputRange(Range: str) str

Change the input voltage range.

permissable parameters are:

  • “-500mV”

  • “-100mV”

  • “-20mV”

setMaxBins(numMaxBins: int) str

Sets the tracelength if the memory configuraton switch 5 is in the ON Position. A user defined tracelength allows a better usage of the acquisition time for high repetition rate systems.

setMaxShots(maxShots: int) str

Set the maxmimum shotnumber of the TR this can be an arbitrary number between 2 and 65335, the startup default is 4096. This will work with newer TR. If this command fails and the unit claims that it supports 64k shots then Licel_TCPIP_SetShotLimit will work.

setShotLimit(limit: str) str

Switch between 4k and 64k maxshots. permissable arguments are :

limit = str “64K”

limit = str “4K”

setSlaveMode() str

Set slave mode. End push mode for more information: https://licel.com/manuals/ethernet_pmt_tr.pdf#TCPIP.SLAVE

setThresholdMode(thresholdMode: str) str

Sets the damping state to either on or off. If a value of 1 is sent then damping is turned on. If a value of 0 is sent, the damping is turned off. When the damping is set to low, a discriminator level of 63 outputs -25mV When the damping is set to High, a discriminator level of 63 outputs -100mV

singleShot() str

Start the currently selected transient recorder.

startAcquisition() str

Start the currently selected transient recorder.

stopAcquisition() str

Stops the currently selected transient recorder.

unblockRackTrigger() str

To unblock previously blocked triggers by blockRackTrigger

waitForReady(delay: int) str

Waits for return of the device from the armed state. If the waiting time is longer than the time specified by delay than the device remains armed and will be return to the idle state with next reading of binary data a stop command should have been sent before to the transient recorder. :param delay: delay in ms :type delay: int

Returns:

if timeout occurs timeout else ‘’Device returned from armed state’’

Return type:

str