diff --git a/Software/Monitoring/Monitoring.py b/Software/Monitoring/Monitoring.py index 38cbc58..ab1d064 100644 --- a/Software/Monitoring/Monitoring.py +++ b/Software/Monitoring/Monitoring.py @@ -6,7 +6,9 @@ Monitoring of the environmental variables. Temperature, relative humidity, and dew point are measured at regular time intervals and are saved into one or several text files. When the maximum number of measurements per text file is reached, a new text file is opened. -The text files are saved in "/disk/groups/hep/flionett/TestStand/Data//Monitoring according to the name "Monitoring--.dat", with determined according to the number of rows and the maximum number of rows. +The text files are saved in "/disk/data1/hep/LHCbUT/TestStand/Data//Monitoring according to the name "Monitoring--.dat", with determined according to the number of rows and the maximum number of rows. +If the difference between the measured temperature and the dew point is less than 2 degrees Celsius, a warning e-mail is sent to someone nearby the lab. +If it is less than 1 degree Celsius, an emergency e-mail is sent (and the cooling system is switched off remotely, this one still to be implemented). Parameters: - , the type of sensor; @@ -27,6 +29,9 @@ import sys import time +sys.path.insert(0,'../Tools') +from SendEmail import * + parser = argparse.ArgumentParser(description='Define the parameters of the monitoring of the environmental variables.') parser.add_argument('--s',help='type of sensor',required=True) @@ -128,6 +133,23 @@ H = (math.log10(RH)-2)/0.4343 + (17.62*T)/(243.12+T) DP = 243.12*H/(17.62-H) + # If the difference between the measured temperature and the dew point is less than 2 degrees Celsius, a warning e-mail is sent to someone nearby the lab. + #If it is less than 1 degree Celsius, an emergency e-mail is sent (and the cooling system is switched off remotely, this one still to be implemented). + warningDeltaT = 2. + emergencyDeltaT = 1. + # Send email. + sender = 'federica.lionetto@cern.ch' + receiver = 'federica.lionetto@cern.ch' + warningMessage = 'Condensation warning! \n The measured temperature is less than two degrees Celsius far from the dew point. Consider switching off the cooling system to avoid condensation on cold surfaces and damage to detector and electronics...' + warningSubject = 'Condensation warning' + emergencyMessage = 'Condensation emergency! \n Switch off the cooling system immediately!' + emergencySubject = 'Condensation emergency' + + if (T-DP