Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
storage_ring.py 478 B


"""
Functions dealing with the storage ring pvs

"""
from epics import caget
from time import sleep

from .utilities import dateandtime

def wait_for_beam():
    """
    Monitors the storage ring current and breaks when the ring current is above 60 mA
    Checks the status every 30 seconds
    """
    while True:
        SR=caget("S:SRcurrentAI.VAL")
        if (SR<80):
            sleep(30)
        else:
            print("Beam is back -"+dateandtime())
            break