def GetSMPStatus(Beam): if Beam == "Beam 1": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') coords = [ (872, 572), #Stable Beams (872, 600), #Moveable Devices Allowed In (872, 629), #Beam Presence (872, 658), #Setup Beam (872, 686), #Global Beam Permit (872, 715) #Link Status of Beam Permits ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] if colors[5].g == 255: del colors[3] #if in stable beams remove the setup flag elif len(colors) == 6 & colors[3].g == 255: del colors[5] #if in setup remove the stable beams flag for color in colors: if color.r == 255: print("There is a fault with Beam 1's SMP status") return print("Beam 1's SMP status is good.") elif Beam == "Beam 2": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') coords = [ (945, 572), #Stable Beams (945, 600), #Moveable Devices Allowed in (945, 629), #Beam Presence (945, 658), #Setup Beam (945, 686), #Global Beam Permit (945, 715) #Link Status of Beam Permits ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] if colors[5].g == 255: del colors[3] #if in stable beams remove the setup flag elif len(colors) == 6 & colors[3].g == 255: del colors[5] #if in setup remove the stable beams flag for color in colors: if color.r == 255: print("There is a fault with Beam 2's SMP status") return print("Beam 2's SMP status is good.")
def GetExpMagnetStatusIndividual(magnet): if magnet == LHCStatusOptions.EXPMagnets.ALICE_solenoid: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((365, 60))).g == 255: print("{} is functioning correctly.".format( magnet.name.replace('_', ' '))) else: print("{} is faulty.".format(magnet.name.replace('_', ' '))) elif magnet == LHCStatusOptions.EXPMagnets.ALICE_dipole: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((365, 100))).g == 255: print("{} is functioning correctly.".format( magnet.name.replace('_', ' '))) else: print("{} is faulty.".format(magnet.name.replace('_', ' '))) elif magnet == LHCStatusOptions.EXPMagnets.ATLAS_solenoid: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((365, 142))).g == 255: print("{} is functioning correctly.".format( magnet.name.replace('_', ' '))) else: print("{} is faulty.".format(magnet.name.replace('_', ' '))) elif magnet == LHCStatusOptions.EXPMagnets.ATLAS_torid: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((365, 180))).g == 255: print("{} is functioning correctly.".format( magnet.name.replace('_', ' '))) else: print("{} is faulty.".format(magnet.name.replace('_', ' '))) elif magnet == LHCStatusOptions.EXPMagnets.CMS_solenoid: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((365, 220))).g == 255: print("{} is functioning correctly.".format( magnet.name.replace('_', ' '))) else: print("{} is faulty.".format(magnet.name.replace('_', ' '))) elif magnet == LHCStatusOptions.EXPMagnets.LHCb_dipole: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((365, 260))).g == 255: print("{} is functioning correctly.".format( magnet.name.replace('_', ' '))) else: print("{} is faulty.".format(magnet.name.replace('_', ' '))) else: pass
def Check60AmpPCPermit(): colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') colors.append(Color(*rgb_img.getpixel((108, 403)))) #S12 colors.append(Color(*rgb_img.getpixel((203, 403)))) #S23 colors.append(Color(*rgb_img.getpixel((297, 403)))) #S34 colors.append(Color(*rgb_img.getpixel((392, 402)))) #S45 colors.append(Color(*rgb_img.getpixel((498, 402)))) #S56 colors.append(Color(*rgb_img.getpixel((595, 402)))) #S67 colors.append(Color(*rgb_img.getpixel((688, 403)))) #S78 colors.append(Color(*rgb_img.getpixel((772, 402)))) #S81 for color in colors: if color.r == 255: print("A PCPermit is down.") return print("All PCPermits are up.")
def GetExpMagnetStatus(): colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcexpmag.png") rgb_img = img.convert('RGB') coords = [ (365, 60), #ALICE solenoid (365, 100), #ALICE dipole (365, 140), #ATLAS solenoid (365, 180), #ATLAS toroid (365, 220), #CMS solenoid (365, 260) #LHcb dipole ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Not all Experiment magnets are functioning correctly.") return print("All Experiment magnets are functioning correctly.")
def CheckVistarComments(): img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") print(pytesseract.image_to_string(img.crop((0,556,512,731)), 'eng'))
def CheckVistarPage(): img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") print(pytesseract.image_to_string(img,'eng'))
def GetSMPStatusIndividual(beam, smpflag): if beam == LHCStatusOptions.Beams.Beam1: if smpflag == LHCStatusOptions.SMPFlags.Link_Status_of_Beam_Permits: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((872, 572))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Global_Beam_Permit: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((872, 600))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Setup_Beam: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((872, 629))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Beam_Presence: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((872, 658))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Moveable_Devices_Allowed_In: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((872, 686))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Stable_Beams: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((872, 715))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) else: pass elif beam == LHCStatusOptions.Beams.Beam2: if smpflag == LHCStatusOptions.SMPFlags.Link_Status_of_Beam_Permits: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((945, 572))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Global_Beam_Permit: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((945, 600))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Setup_Beam: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((945, 629))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Beam_Presence: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((945, 658))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Moveable_Devices_Allowed_In: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((945, 686))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) elif smpflag == LHCStatusOptions.SMPFlags.Stable_Beams: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc1.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((945, 715))).g == 255: print("{} flag is true.".format(smpflag.name.replace('_', ' '))) else: print("{} flag is false.".format(smpflag.name.replace( '_', ' '))) else: pass else: pass
def GetBeamDumpStatusIndividual(beam, component): if beam == LHCStatusOptions.Beams.Beam1: if component == LHCStatusOptions.Components.BeamDumped: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((192, 38))).g == 255: print("{} has not been dumped.".format(beam.value)) else: print("{} has been dumped.".format(beam.value)) elif component == LHCStatusOptions.Components.Kicker: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((73, 60))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.BETS: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((200, 60))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.IPOC_U_Beam_Dump_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((323, 60))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.LASS: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((76, 80))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.RETRIGGER: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((200, 82))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.XPOC: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((326, 82))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.REMOTE_U_Beam_Dump_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((81, 101))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.ON_U_Beam_Dump_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((193, 102))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.REMOTE_U_Injection_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((90, 168))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.ON_U_Injection_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((194, 168))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.TIMING_ON: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((333, 168))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.CONDITIONING: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((65, 189))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.TIMEOUT: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((286, 188))).g == 255: print("The {} has not expired.".format(component.value)) else: print("The {} has expired.".format(component.value)) elif component == LHCStatusOptions.Components.IPOC_U_Injection_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((111, 210))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.IQC: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((290, 210))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) else: pass elif beam == LHCStatusOptions.Beams.Beam2: if component == LHCStatusOptions.Components.BeamDumped: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((593, 38))).g == 255: print("{} has not been dumped.".format(beam.value)) else: print("{} has been dumped.".format(beam.value)) elif component == LHCStatusOptions.Components.Kicker: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((472, 60))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.BETS: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((600, 60))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.IPOC_U_Beam_Dump_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((723, 60))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.LASS: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((476, 80))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.RETRIGGER: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((600, 82))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.XPOC: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((726, 82))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.REMOTE_U_Beam_Dump_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((481, 101))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.ON_U_Beam_Dump_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((593, 102))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.REMOTE_U_Injection_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((490, 168))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.ON_U_Injection_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((594, 168))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.TIMING_ON: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((733, 168))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.CONDITIONING: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((465, 189))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.TIMEOUT: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((686, 188))).g == 255: print("The {} has not expired.".format(component.value)) else: print("The {} has expired.".format(component.value)) elif component == LHCStatusOptions.Components.IPOC_U_Injection_Pane: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((511, 210))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) elif component == LHCStatusOptions.Components.IQC: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((690, 210))).g == 255: print("The {} is good.".format(component.value)) else: print("The {} is faulty.".format(component.value)) else: pass else: pass
def GetBeamDumpStatus(Beam): if Beam == "Beam 1": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') coords = [ (192, 38), #BeamOneDumped (73, 60), #Kicker (200, 60), #BETS (323, 60), #IPOC - Beam Dump Pane (76, 80), #LASS (200, 82), #RETRIGGER (326, 82), #XPOC (81, 101), #REMOTE - Beam Dump Pane (193, 102), #ON - Beam Dump Pane (90, 168), #REMOTE - Injection Pane (194, 168), #ON - Injection Pane (333, 168), #TIMING ON (65, 189), #CONDITIONING (286, 188), #TIMEOUT (111, 210), #IPOC - Injection Pane (290, 210) #IQC ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like there is a error with the Beam 1 Beam Dump.") return print("Everything looks good for the Beam 1 Beam Dump.") elif Beam == "Beam 2": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhcbds.png") rgb_img = img.convert('RGB') coords = [ (593, 38), #BeamTwoDumped (472, 60), #Kicker (600, 60), #BETS (723, 60), #IPOC - Beam Dump Pane (476, 80), #LASS (600, 82), #RETRIGGER (726, 82), #XPOC (481, 101), #REMOTE - Beam Dump Pane (593, 102), #ON - Beam Dump Pane (490, 168), #REMOTE - Injection Pane (594, 168), #ON - Injection Pane (733, 168), #TIMING ON (465, 189), #CONDITIONING (686, 188), #TIMEOUT (511, 210), #IPOC - Injection Pane (690, 210) #IQC ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like there is a error with the Beam 2 Beam Dump.") return print("Everything looks good for the Beam 2 Beam Dump.")
def GetSectorStatus(Sector): """ This function checks the individual cryostats for the sector. It lets the user know if all the cryostats are good or if one is faulty. :param Sector: the Sector to check. :type Sector: Sector:`LHCStatusOperations.Sectors` """ if Sector == "Sector 12": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (100, 100), #CMITR1 (188, 100), #CSITR1 (288, 100), #CMMSR1 (378, 100), #CSMSR1 (478, 100), #CMAR12 (568, 100), #CSAR12 (668, 100), #CMMSL2 (758, 100), #CSMSL2 (858, 100), #CMITL2 (948, 100) #CSITL2 ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 12.") return print("Everything looks good in Sector 12.") elif Sector == "Sector 23": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (100, 140), #CMITR2 (188, 140), #CSITR2 (288, 140), #CMMSR2 (378, 140), #CSMSR2 (478, 140), #CMAML3 (568, 140) #CSAML3 ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 23.") return print("Everything looks good in Sector 23.") elif Sector == "Sector 34": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (478, 175), #CMAML3 (568, 175), #CSAML3 (668, 175), #CMMSL1 (758, 175) #CSMSL1 ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 34.") return print("Everything looks good in Sector 34.") elif Sector == "Sector 45": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (288, 210), #CMMSR4 (378, 210), #CSMSR4 (478, 210), #CMAR45 (568, 210), #CSAR45 (668, 210), #CMMSL5 (758, 210), #CSMSL5 (858, 210), #CMITL6 (948, 210) #CSITL6 ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 45.") return print("Everything looks good in Sector 45.") elif Sector == "Sector 56": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (100, 245), #CMITR5 (188, 245), #CSITR5 (288, 245), #CMMSR5 (378, 245), #CSMSR5 (478, 245), #CMAR56 (568, 245), #CSAR56 (668, 245), #CMMSL6 (758, 245) #CSMSL6 ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 56.") return print("Everything looks good in Sector 56.") elif Sector == "Sector 67": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (288, 280), #CMMSR6 (378, 280), #CSMSR6 (478, 280), #CMAML7 (568, 280) #CSAML7 ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 67.") return print("Everything looks good in Sector 67.") elif Sector == "Sector 78": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (478, 315), #CMAMR7 (568, 315), #CSAMR7 (668, 315), #CMMSL8 (758, 315), #CSMSL8 (858, 315), #CMITL8 (948, 315) #CSITL8 ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 78.") return print("Everything looks good in Sector 78.") elif Sector == "Sector 81": colors = list() img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (100, 350), #CMITR8 (188, 350), #CSITR8 (288, 350), #CMMSR8 (378, 350), #CSMSR8 (478, 350), #CMAR81 (568, 350), #CSAR81 (668, 350), #CMMSL1 (758, 350), #CSMSL1 (858, 350), #CMITL1 (948, 350) #CSITL1 ] colors += [Color(*rgb_img.getpixel((xy))) for xy in coords] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 81.") return print("Everything looks good in Sector 81.")
def GetPCPermitStatusIndividual(Sector): if Sector == "Sector 12": img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') C = Color(*rgb_img.getpixel((108, 403))) #S12 if C.r == 255: print("The PCPermit is down.") return print("The PCPermit is up.") elif Sector == "Sector 23": img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') C = Color(*rgb_img.getpixel((203, 403))) #S23 if C.r == 255: print("The PCPermit is down.") return print("The PCPermit is up.") elif Sector == "Sector 34": img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') C = Color(*rgb_img.getpixel((297, 403))) #S34 if C.r == 255: print("The PCPermit is down.") return print("The PCPermit is up.") elif Sector == "Sector 45": img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') C = Color(*rgb_img.getpixel((392, 402))) #S45 if C.r == 255: print("The PCPermit is down.") return print("The PCPermit is up.") elif Sector == "Sector 56": img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') C = Color(*rgb_img.getpixel((498, 402))) #S56 if C.r == 255: print("The PCPermit is down.") return print("The PCPermit is up.") elif Sector == "Sector 67": img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') C = Color(*rgb_img.getpixel((595, 402))) #S67 if C.r == 255: print("The PCPermit is down.") return print("The PCPermit is up.") elif Sector == "Sector 78": img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') C = Color(*rgb_img.getpixel((688, 403))) #S78 if C.r == 255: print("The PCPermit is down.") return print("The PCPermit is up.") elif Sector == "Sector 81": img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') C = Color(*rgb_img.getpixel((772, 402))) #S81 if C.r == 255: print("The PCPermit is down.") return print("The PCPermit is up.") else: pass
def GetRFStatus(Sector): if Sector == "Sector 1L4": colors = list() img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (100,440), #CM1L4 (188,440) #CS1L4 ] colors += [ Color(*rgb_img.getpixel((xy))) for xy in coords ] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 1L4.") return print("Everything looks good in Sector 1L4.") elif Sector == "Sector 1R4": colors = list() img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (480,440), #CM1R4 (570,440) #CS1R4 ] colors += [ Color(*rgb_img.getpixel((xy))) for xy in coords ] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 1R4.") return print("Everything looks good in Sector 1R4.") elif Sector == "Sector 2L4": colors = list() img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (290,440), #CM2L4 (380,440) #CS2L4 ] colors += [ Color(*rgb_img.getpixel((xy))) for xy in coords ] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 2L4.") return print("Everything looks good in Sector 2L4.") elif Sector == "Sector 2R4": colors = list() img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') coords = [ (670,440), #CM2R4 (760,440) #CS2R4 ] colors += [ Color(*rgb_img.getpixel((xy))) for xy in coords ] for color in colors: if color.r == 255: print("Looks like Cryo is down in Sector 2R4.") return print("Everything looks good in Sector 2R4.")
def GetRFStatusIndividual(CryoStat): if CryoStat == LHCStatusOptions.RFCryo.CM1L4: img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((100,440))).g == 255: print("Everything looks good for {}.".format(CryoStat.name)) else: print("Cryo is down for {}.".format(CryoStat.name)) elif CryoStat == LHCStatusOptions.RFCryo.CS1L4: img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((188,440))).g == 255: print("Everything looks good for {}.".format(CryoStat.name)) else: print("Cryo is down for {}.".format(CryoStat.name)) elif CryoStat == LHCStatusOptions.RFCryo.CM2L4: img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((290,440))).g == 255: print("Everything looks good for {}.".format(CryoStat.name)) else: print("Cryo is down for {}.".format(CryoStat.name)) elif CryoStat == LHCStatusOptions.RFCryo.CS2L4: img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((380,440))).g == 255: print("Everything looks good for {}.".format(CryoStat.name)) else: print("Cryo is down for {}.".format(CryoStat.name)) elif CryoStat == LHCStatusOptions.RFCryo.CM1R4: img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((480,440))).g == 255: print("Everything looks good for {}.".format(CryoStat.name)) else: print("Cryo is down for {}.".format(CryoStat.name)) elif CryoStat == LHCStatusOptions.RFCryo.CS1R4: img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((570,440))).g == 255: print("Everything looks good for {}.".format(CryoStat.name)) else: print("Cryo is down for {}.".format(CryoStat.name)) elif CryoStat == LHCStatusOptions.RFCryo.CM2R4: img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((670,440))).g == 255: print("Everything looks good for {}.".format(CryoStat.name)) else: print("Cryo is down for {}.".format(CryoStat.name)) elif CryoStat == LHCStatusOptions.RFCryo.CS2R4: img = getImage("https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((760,440))).g == 255: print("Everything looks good for {}.".format(CryoStat.name)) else: print("Cryo is down for {}.".format(CryoStat.name)) else: pass
def GetSectorStatusIndividual(sector): if sector == LHCStatusOptions.Sector12Magnets.CMITR1: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((100, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CSITR1: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((188, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CMMSR1: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((288, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CSMSR1: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((378, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CMAR12: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((478, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CSAR12: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((568, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CMMSL2: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((668, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CSMSL2: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((758, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CMITL2: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((858, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector12Magnets.CSITL2: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((948, 100))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) else: pass if sector == LHCStatusOptions.Sector23Magnets.CMITR2: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((100, 140))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector23Magnets.CSITR2: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((188, 140))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector23Magnets.CMMSR2: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((288, 140))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector23Magnets.CSMSR2: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((378, 140))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector23Magnets.CMAML3: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((478, 140))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector23Magnets.CSAML3: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((568, 140))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) else: pass if sector == LHCStatusOptions.Sector34Magnets.CMAMR3: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((478, 175))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector34Magnets.CSAMR3: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((568, 175))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector34Magnets.CMMSL4: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((668, 175))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector34Magnets.CSMSL4: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((758, 175))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) else: pass if sector == LHCStatusOptions.Sector45Magnets.CMMSR4: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((288, 210))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector45Magnets.CSMSR4: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((378, 210))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector45Magnets.CMAR45: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((478, 210))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector45Magnets.CSAR45: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((568, 210))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector45Magnets.CMMSL5: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((668, 210))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector45Magnets.CSMSL5: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((758, 210))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector45Magnets.CMITL5: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((858, 210))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector45Magnets.CSITL5: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((948, 210))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) else: pass if sector == LHCStatusOptions.Sector56Magnets.CMITR5: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((100, 245))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector56Magnets.CSITR5: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((188, 245))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector56Magnets.CMMSR5: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((288, 245))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector56Magnets.CSMSR5: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((378, 245))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector56Magnets.CMAR56: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((478, 245))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector56Magnets.CSAR56: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((568, 245))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector56Magnets.CMMSL6: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((668, 245))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector56Magnets.CSMSL6: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((758, 245))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) else: pass if sector == LHCStatusOptions.Sector67Magnets.CMMSR6: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((288, 280))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector67Magnets.CSMSR6: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((378, 280))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector67Magnets.CMAML7: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((478, 280))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector67Magnets.CSAML7: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((568, 280))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) else: pass if sector == LHCStatusOptions.Sector78Magnets.CMAMR7: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((478, 315))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector78Magnets.CSAMR7: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((568, 315))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector78Magnets.CMMSL8: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((668, 315))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector78Magnets.CSMSL8: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((758, 315))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector78Magnets.CMITL8: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((858, 315))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector78Magnets.CSITL8: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((948, 315))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) else: pass if sector == LHCStatusOptions.Sector81Magnets.CMITR8: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((100, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CSITR8: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((188, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CMMSR8: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((288, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CSMSR8: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((378, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CMAR81: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((478, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CSAR81: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((568, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CMMSL1: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((668, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CSMSL1: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((758, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CMITL1: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((858, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) elif sector == LHCStatusOptions.Sector81Magnets.CSITL1: img = getImage( "https://vistar-capture.web.cern.ch/vistar-capture/lhc2.png") rgb_img = img.convert('RGB') if Color(*rgb_img.getpixel((948, 350))).g == 255: print("Everything looks good for {}.".format(sector.name)) else: print("Cryo is down for {}.".format(sector.name)) else: pass