Skip to content

Machine info

BLISS offers some mechanisms to deal with information obtained from the ESRF accelerator.

MachInfo class provides:

  • counters to access to accelerator information
    • sr_mode: operation mode
    • automatic_mode: automatic FE mode activation
    • tango_uri: address of the Front-End Tango device server
  • counters to access to accelerator information:
    • current
    • lifetime
    • sbcurr
    • refill
  • helper functions to implement refill pretection in a sequence
    • iter_wait_for_refill()
    • check_for_refill()
    • WaitForRefillPreset

Configuration

Configuration example:

- class: MachInfo
  plugin: bliss
  uri: //acs.esrf.fr:10000/fe/master/id42
  name: mama

machinfo properties

  • sr_mode: operation mode in: [USM; MDT; Shutdown; SafetyTest; IdTest]
  • automatic_mode: activation of automatic FE mode: True or False
  • tango_uri: address of the Front-End Tango device server
  • counters:
    • current: Ring current of the machine
    • lifetime: Remaining Lifetime of the beam
    • sbcurr: Ring current of the machine in Single Bunch mode
    • refill: Countdown to the Refill

Counters usage in a scan:

DEMO [8]: ct(0.1, mama)
Sun Mar 08 13:54:39 2020

 current = 8.830000000000009 ( 88.30000000000008/s)
lifetime =     222633.0 (   2226330.0/s)
  refill =       7523.0 (     75230.0/s)
  sbcurr =          0.0
  Out [8]: Scan(number=2, name=ct, path=)

Reading of a particular counter:

DEMO [9]: mama.counters.current
 Out [9]: 'current` Tango attribute counter info:
            device server = //acs.esrf.fr:10000/fe/master/id42
            Tango attribute = SR_Current
            Tango format = "%6.2f"
            Tango unit = "mA"
            scalar
            value: 8.82

DEMO [10]: mama.counters.current.value
 Out [10]: 194.43

__info__

MachInfo object shell info provides:

  • url of the tango device used
  • AutoMode status
  • Operator Message
DEMO  [5]: mama
 Out [1]: -----------------  ------------------------------------------------
          SR Mode:           USM
          Current:           198.07 mA
          Lifetime:          84460 s = 23h 27mn 40s
          Refill CountDown:  2619 s = 43mn 39s
          Filling Mode:      7/8 multibunch
          AutoMode:          False
          -----------------  ------------------------------------------------
          Operator Message   Jun 13 10:01 Delivery:Next Refill at 11:00;
          -----------------  ------------------------------------------------
          check              False
          -----------------  ------------------------------------------------

all_information

all_information property returns most of all the machine information as a dictionary:

DEMO [9]: pprint.pprint(mama.all_information)
{'Automatic_Mode': True,
 'EXP_Itlk_State': tango._tango.DevState.ON,
 'FE_Itlk_State': tango._tango.DevState.ON,
 'FE_State': 'FE open',
 'HQPS_Itlk_State': tango._tango.DevState.ON,
 'PSS_Itlk_State': tango._tango.DevState.ON,
 'SR_Current': 195.93514894706684,
 'SR_Filling_Mode': '7/8 multibunch',
 'SR_Lifetime': 66281.93637072828,
 'SR_Mode': 'USM',
 'SR_Operator_Mesg': 'Jun  3 12:00 Back to USM',
 'SR_Refill_Countdown': 2034.0,
 'SR_Single_Bunch_Current': -0.04008001020600001,
 'UHV_Valve_State': tango._tango.DevState.ON}

iter_wait_for_refill

iter_wait_for_refill(<checktime>, <waittime>=0., <polling_time>=1.)

Helper for waiting the machine refill. It yields two states: WAIT_INJECTION and WAITING_AFTER_BEAM_IS_BACK until the machine refill is finished.

Nothing is returned if the beam is ok.

Example:

for status in iter_wait_for_refill(my_check_time,waittime=1.,polling_time=1.):
    if status == "WAIT_INJECTION":
        print("Scan is paused, waiting injection",end='\r')
    else:
        print("Scan will restart in 1 second...",end='\r')

check_for_refill

check_for_refill(checktime): Return True if <checktime> (in seconds) is smaller than the refill countdown. ie: return True if a task of length <checktime> can be performed before the refill.

Example:

DEMO [4]: from bliss.controllers.machinfo import  MachInfo

DEMO [5]: machinfo.counters.refill
 Out [5]: 'refill` Tango attribute counter info:
             device server = //acs.esrf.fr:10000/fe/master/id42
             Tango attribute = SR_Refill_Countdown
             ...
             value: 6411.0

DEMO [6]: MachInfo.check_for_refill(machinfo, 6300)
 Out [6]: True

DEMO [7]: MachInfo.check_for_refill(machinfo, 6500)
 Out [7]: False