def humchop(): hum = Humidity.main() if len(hum) > 1: try: f = open(credentialsPi.get_path("humchop"), 'a+') time = pd.Timestamp.now() #time = '{:%y-%d-%m %H:%M:%S}'.format(datetime.datetime.now()) #data = str(time+', '+hum) data = str(hum) f.write(str(time)) f.write(data+'\n') upload_to_drive_rawdata.main() x = hum[:-8] HumList.append(float(x)) except: humchop()
def irrchop(): irr = Irradiance.main() if len(irr)>1: try: f = open(credentialsPi.get_path("irrchop"), 'a+') #time = '{:%y-%d-%m %H:%M:%S}'.format(datetime.datetime.now()) time = pd.Timestamp.now() #data = str(time+', '+irr) data = str(irr) f.write(str(time)) f.write(data+'\n') upload_to_drive_rawdata.main() irrchopped = irr[:-10] IrrList.append(float(irrchopped)) except Exception: irrchop()
def voltchop(): vt = VoltTemp.main() if len(vt) > 1: try: f = open(credentialsPi.get_path("voltchop"), 'a+') #time = '{:%y-%d-%m %H:%M:%S}'.format(datetime.datetime.now()) time = pd.Timestamp.now() #data = str(time+', '+vt) f.write(str(time)) f.write(vt+'\n') upload_to_drive_rawdata.main() x, y, w, z, t= vt.split(',') Cell1List.append(float(x)) Cell2List.append(float(y)) Cell3List.append(float(w)) Cell4List.append(float(z)) TempList.append(float(t)) except: voltchop()