Instruments

Agilent MultiMeter

class sls_detector_tools.AgilentMultiMeter(host, port)[source]

Bases: object

clearVals()[source]

Clears the output values outVals

measure()[source]

Does one measurement with the open instrument, adds the measured value to the outVals and returns it

measureNtimes(N)[source]

Does N measurements with the open instrument and calculates the average, adds the averaged value to the outVals and returns it

writeVal(v)[source]

AgilentMultiMeter.writeVals(v) Writes v into the output values outVals

Keithley SourceMeter

class sls_detector_tools.SourceMeter(verbose=False)[source]

Bases: object

Class to control a Keithley 2410 SourceMeeter over serial interface

close_port()[source]
data_elements()[source]

Set output data elements from the Keithley now set to Voltage Current and Time

get_digits()[source]
off()[source]
on()[source]
open_port(port='/dev/ttyUSB0', baudrate=9600, parity='N', stopbits=1, bytesize=8, xonxoff=0, timeout=1)[source]

Open serial port to communicate with the Keithley make sure that it’s set up in a matching way and that port number is correct

read()[source]
remote(flag)[source]

Turn on and off remote operation of the keithley , remote(True) locks the physical panel

set_digits(n)[source]
set_voltage(V)[source]

BigXrayBox

class sls_detector_tools.BigXrayBox[source]

Bases: sls_detector_tools.xray_box.XrayBox

BigXrayBox at PSI

Examples

box = BigXrayBox()
box.target = 'Fe'
box.voltage = 30
box.current = 80
box.open_shutter('XRF')
HV

Check or switch on/off the high voltage of the xray tube.

Examples

box.HV
>> True

box.HV = False
close_shutter(sh)

Close shutter

Parameters:sh (int or str) – Shutter to close

Examples

box.close_shutter('XRF')
current

Tube current in mA

xray_box.current = 40

xray_box.current
>> 40.0
open_shutter(sh)

Open shutter

Parameters:sh (int or str) – Shutter to open

Examples

box.open_shutter('XRF')
safe

Check if it is safe to open the door.

Returns:valueTrue if it is safe and otherwise False
Return type:bool
shutter_status

Check status of shutters and return dictionary

Examples

box.shutter_status
>> {'Direct beam': 'OFF', 'XRF': 'OFF'}
target

Fluorescence target

Examples

box.target = 'Fe'

box.target
>> 'Fe'
unlock()

Unlock the control from another user

voltage

High voltage of the X-ray tube in kV

xray_box.voltge = 60

xray_box.voltage
>> 60.0
warmup_time

Read the warmuptime left, returns 0 if warmup not in progress

VacuumBox

class sls_detector_tools.VacuumBox[source]

Bases: sls_detector_tools.xray_box.XrayBox

VacuumBox at PSI.

Available shutters:

  • XRF
  • Right
  • Up
HV

Check or switch on/off the high voltage of the xray tube.

Examples

box.HV
>> True

box.HV = False
close_shutter(sh)

Close shutter

Parameters:sh (int or str) – Shutter to close

Examples

box.close_shutter('XRF')
current

Tube current in mA

xray_box.current = 40

xray_box.current
>> 40.0
open_shutter(sh)

Open shutter

Parameters:sh (int or str) – Shutter to open

Examples

box.open_shutter('XRF')
safe

Check if it is safe to open the door.

Returns:valueTrue if it is safe and otherwise False
Return type:bool
shutter_status

Check status of shutters and return dictionary

Examples

box.shutter_status
>> {'Direct beam': 'OFF', 'XRF': 'OFF'}
target

Fluorescence target

Examples

box.target = 'Fe'

box.target
>> 'Fe'
unlock()

Unlock the control from another user

voltage

High voltage of the X-ray tube in kV

xray_box.voltge = 60

xray_box.voltage
>> 60.0
warmup_time

Read the warmuptime left, returns 0 if warmup not in progress