Examples

Get the pv value from the quad elements

  • Import ‘pytac’

    >>> import pytac
    
  • Initialize the VMX mode

    >>> lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
    
  • Version 1: Get the Quad elements and print their readback values on the b1 field:

    >>> quads = lattice.get_elements('QUAD')
    >>> for quad in quads:
    >>>    print(quad.get_pv_value('b1', 'readback'))
    71.3240509033
    129.351394653
    98.2537231445
    ...
    
  • Version 2: Print the quad pv values on the b1 field using the lattice. This is more efficient:

    >>> lattice.get_family_values('QUAD', 'b1', 'readback')
    [71.32496643066406,
     129.35191345214844,
     98.25287628173828,
    ...