Skip to content

Latest commit

 

History

History
145 lines (133 loc) · 10.2 KB

todo.org

File metadata and controls

145 lines (133 loc) · 10.2 KB

User interface [11/15]

  • [X] Setting for amount of time the beam is down before a message is sent
  • [X] Setting for how much the intesity has to increase/decrease before a message is sent
  • [X] Setting for how much the dose rate per hour has to change before a message is sent
  • [X] Update text view with last X messages
  • [X] Connect the GUI to the rest of the program
  • [X] Load data base settings on startup
  • [ ] Option to set when a day starts and ends, for example 1400 to 0200
  • [ ] option for maximum number of sms sent.
  • [X] The program should keep sending notifications until the user accepts the reply
  • [X] Automatic resize of admin interface
  • [X] Look into removing set shifter functions and only use insert_shifter instad
  • [X] Automatically load the check box values
  • [ ] add setting for bpm references
  • [ ] add password
  • [X] make it possible to launch the admin interface from the webpage
  • [ ] Include BPM reference values in the user interface
  • [ ] Look into javascript bootstrap

Message Contents [8/9]

  • [ ] How long has the beam been down
  • [X] Mean intensity of the BPM
  • [X] Mean intensity of the MWPC
  • [X] FWHM of the BPM
  • [X] FWHM of the MWPC
  • [X] Intensity of beam, from SEC 1
  • [X] Check centering of the beam for BPM and MWPC
  • [X] Should be checking beam intensity first, but it doesn’t
  • [X] Response is not set to 0 when beam goes down, fix it.

Data retrival [9/10]

  • [X] Write code to download BPM data from https://ps-irrad.web.cern.ch/irrad/bpm.php
  • [X] Write regex to extract data from the html downloaded in the point above.
  • [X] Write a class for getting data from MWPC, can be based on adams code.
  • [X] Write a class for getting data from the SEC.
  • [X] Implement the method for finding the fwhm of the MWPC that adam used, and compare it to the one currentyl in use
  • [X] Fix the checking of the BPM using 3 indexes, also currently only checking the x-axis
  • [X] Fix the check for SEC 1 as is currently saying there is no beam even when there is
  • [X] Fix that the MWPC class crashes when there is no beam.
  • [ ] Instead of just looking at the maximum BPM value, look at the maximum of the gaussian fit to avoid errors with max peaks outside the gaussian peak.
  • [X] Check that there is a sec sample at least 80% of the last minutes, for example 8 samples in the last 10 minutes. This is done to avoid the FWHM warning and Centre warinng being sent before the beam down warning.

Messaging [7/8]

  • [X] Find a way to avoid sending an error message several times for discrepancies in the same varible. As an example if the FHWM of BPM4 decreases to under 70% of the reference, send an email, but don’t send a new email about it before after it has gone back to normal.
  • [X] Use a third number for the last column in the messages, to allow sending a beam down email after a beam off centre email has been sent.
  • There is a response table in the database. it has three rows, beam, fwhm, and centre.
  • [X] Set them to 0 when their respective statuses goes down, for example if the intensity is too low, set beam to 0.
  • [X] Then set them to 1 after a user responds.
  • [X] Consider using only one respond button.
  • [X] Send an email when beam is centered/fwhm is ok again
  • [ ] Resending works when beam is down, not tested for centering and fwhm. Do the test.
  • [X] Add all shifters from google doc that do not exist in the database every loop of charm_shift_tool

Extract shifter [4/4]

Database for strong references and settings [6/6]

  • [X] Setup SQLITE3 database
  • [X] Write functions for opening and closing the database
  • [X] Write functions for inserting data to tables
  • [X] Write functions for changing values of settings and references
  • [X] Create a table for storing user info.
  • [X] Implement the __del__(self) function so that the database connection is closed when the python destructor is called on the object.

Testing [0/1]

  • [ ] Design a test to run on the alert part, right now it is very messy and needs testing.

Guide

  • [ ] Write howto extract data from sheets including how to generate oauth keys and sharing the sheet with that account.

Other [2/3]

  • [X] Ask Maurice Glaser how to obtain data from th BPM. Email sent, waiting for reply. 2015-07-03 Fri 10:23. Wrote function for extracting the data from https://ps-irrad.web.cern.ch/irrad/bpm.php, making this unnesseary.
  • [ ] Cross check with spills per cycle Contact Rende Streerenberg for spills per super cycle from the PS to the east area. Inform the user if there is more than 3 spills or less than 2 in a super cycle.
  • [X] Currently for the intensity reading on the SEC the last hour of data is downloaded and summed up and an average energy over the hour is found. This is not good enough for a few reasons. The energy might fall a lot in one half an hour, but that wount affect the average intensity enough to cause problems. This can be solved by downloading a shorter set of data, say half an hour or even 15 minutes. The reference energy would have to be adjusted accordingly. The second more serious isssue is that if the beam goes down, and there has not been any samples for the last > 15 min, an alert will not be sent because the average intensity is still high enough. To fix this it should be checked that there has been at least 8 samples in the last 10 minutes. It took an hour after the beam went down for the average to go low enough. If we just use fifteen samples the average count should be around 240000, and even if two of the last fifeen samples are 0 the average will not drop lower than 70% of 240000. This should be a setting in the
  • [ ] Angle problem. Should send message if bpms are off for more than 10 to 20 spills. do 10 to 20 spills because the bpms are often off for a couple off spills, depending on what experiment that gets beam before a spill is sent to charm the delta time for changing magnets settings can be too large.
  • [ ] Catch database not found error

CHRASH OUTPUT

Traceback (most recent call last): File “charm_shift_tool.py”, line 255, in <module> running() File “charm_shift_tool.py”, line 159, in running shifter = get_shifter() File “G:\Users\e\eoltedal\charm\charm_shift_tool\shifter.py”, line 38, in get_shifter current_row = worksheet.row_values(row) File “C:\Python34\lib\site-packages\gspread\models.py”, line 404, in row_values lambda cell: cell.row == row) File “C:\Python34\lib\site-packages\gspread\models.py”, line 381, in _list_values cells_list = self._fetch_cells() File “C:\Python34\lib\site-packages\gspread\models.py”, line 226, in _fetch_cells feed = self.client.get_cells_feed(self) File “C:\Python34\lib\site-packages\gspread\client.py”, line 250, in get_cells_feed r = self.session.get(url) File “C:\Python34\lib\site-packages\gspread\httpsession.py”, line 79, in get return self.request(‘GET’, url, **kwargs) File “C:\Python34\lib\site-packages\gspread\httpsession.py”, line 75, in request raise HTTPError(“%s: %s” % (response.status, response.read())) gspread.exceptions.HTTPError: 500: b’<!DOCTYPE html><html lang=”de” ><head><meta name=”description” content=”Textverarbeitung, Pr\xc3\xa4sentationen und Tabellen im Web”><link rel= “shortcut icon” href=”//ssl.gstatic.com/docs/common/drive_favicon1.ico”><title>Fehler in Google Drive</title><link href=”//fonts.googleapis.com/css?family=Open+Sans:300” rel=”style sheet” type=”text/css”><style>/* Copyright 2015 Google Inc. All Rights Reserved. /\n.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block} html .goog- inline-block{display:inline}*:first-child+html .goog-inline-block{display:inline}#drive-logo{color:#91959c;font-family:”Open Sans”,Arial,sans-serif;font-size:27px;font-weight:300;p osition:absolute;text-shadow:0 1px 1px white;white-space:nowrap}#drive-logo img{padding:0 0.4em 0 0;position:relative;top:2px;vertical-align:middle}#drive-logo a{color:#91959c;text -decoration:none}#drive-logo span.goog-inline-block{margin-top:2px;vertical-align:top}</style><style type=”text/css”>body {background-color: #fff; font-family: Arial,sans-serif; fo nt-size: 13px; margin: 0; padding: 0;}a, a:link, a:visited {color: #112ABB;}</style><style type=”text/css”>.errorMessage {font-size: 12pt; font-weight: bold; line-height: 150%;}</s tyle></head><body><div style=”margin: auto; max-width: 750px;”><div style=”margin: 80px 40px 20px 40px; position:relative; “><div style=”position: absolute; top: -80px;”><h1 id=”dr ive-logo”><a href=”“><img src=”//www.google.com/images/logos/google_logo_41.png” width=”116” height=”41” alt=”Google logo” ><span class=”goog-inline-block”>Drive</span></a></h1>< div><p style=”padding-top: 15px”>In Google Docs ist ein Fehler aufgetreten. Bitten versuchen Sie, die Seite neu zu laden. Falls das nichts hilft, warten Sie bitte ein paar Minuten. </p><p><a href=”https://support.google.com/docs/?hl=de_CH&p=error_help” target=”_blank”>Weitere Informationen zu den Google Docs-Editors finden Sie in der Google Docs-Hilfe.</a></p ><p><br><b>Wir bitten Sie, die Unannehmlichkeiten zu entschuldigen.</b><br><i>- Ihr Google Docs-Team</i></p></div></div></body></html>’

Notes

  • Intensity can be gathered from SEC 1
  • The BPM and MWPC show beam profile with mean and FWHM
  • SEC 2 is affected too much by objects in the beamline and is therefore not used
  • Check data every 10 minutes.
  • In order to know how long the beam has been down, store the time that downtime was detected
  • The timbre data is updated every 10 minutes.