From f5260f04a54a628c5816d2bf4f4c679949aeaaa9 Mon Sep 17 00:00:00 2001 From: am0ebe <am0ebe@gmx.de> Date: Tue, 8 Jun 2021 12:12:20 +0200 Subject: [PATCH] gitignore 'temp' file --- .gitignore | 3 +-- conf.json | 3 ++- dataSync.py | 12 ++++++++++-- update-gitignore.sh | 3 +++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 264fff9..6ec99f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ -ecotrack/out/all/ecotrack-data-20190629-20191016 -ecotrack/out/I/ecotrack-data-20190629-20190804 *.csv *.txt test/* *# *skyglow.log __pycache__ +temp diff --git a/conf.json b/conf.json index c7ccbc8..7a1b354 100644 --- a/conf.json +++ b/conf.json @@ -7,6 +7,7 @@ ["ecotrack","./ecotrack/in","./ecotrack/out/II","2019-08-05","2019-09-27"], ["ecotrack","./ecotrack/in","./ecotrack/out/III","2019-09-27","2019-11-20"], ["ecotrack","./ecotrack/in","./ecotrack/out/all","2019-06-29","2019-11-01"], + ["ecotrack","./ecotrack/in","./ecotrack/out/test","2019-09-17","2019-09-30"] ], "blox" : { @@ -26,4 +27,4 @@ ], "schrebatron": [] } -} \ No newline at end of file +} diff --git a/dataSync.py b/dataSync.py index 790527d..690193e 100755 --- a/dataSync.py +++ b/dataSync.py @@ -37,7 +37,7 @@ TAG_LEN=len("04B94A7F7288588022") RULER=f"{'#'*100}" N_UNITS=12 confFileName="./conf.json" -COMPRESSION=True +COMPRESSION=False NO_MERGE=False # month, sunrise, sunset @@ -379,6 +379,8 @@ class Data: lines = self.clean(lines, C_MIN_LEN, C_MAX_LEN, C_NCOLS, C_DELIM, self.getTempTime, datetime.timedelta(minutes=10)) lines.sort() + assert len(lines), "No Temperatures left after cleaning. >> too narrow time window?" + self.startTemp = self.getTempTime( lines[0] ) self.endTemp = self.getTempTime( lines[-1] ) self.lenTemp = len(lines) @@ -443,6 +445,12 @@ class Data: else: temps = self.meanTemps[0][uid][block] + self.meanTemps[1][uid][block] + if isDay(time): + temps += "day" + else: + temps += "night" + + self.tempData[uid][idx].extend( temps ) def calc_mean_for_sensor_values_for_uid_and_time(self,uid,prev_time): @@ -671,7 +679,7 @@ class Data: if hasLight(): h+=', moon_real[mLux], moon_eco[mLux], skyglow[Lux]' if hasTemp(): - h+=', temp[C°], mean_night_temp[C°], min_night_temp[C°], max_night_temp[C°], mean_day_temp[C°], min_day_temp[C°], max_day_temp[C°]' + h+=', temp[C°], mean_night_temp[C°], min_night_temp[C°], max_night_temp[C°], mean_day_temp[C°], min_day_temp[C°], max_day_temp[C°], is_day' h +="\n" h += RULER + "\n" return h diff --git a/update-gitignore.sh b/update-gitignore.sh index 1eec0c4..ea79a4f 100755 --- a/update-gitignore.sh +++ b/update-gitignore.sh @@ -1,5 +1,7 @@ #!/bin/bash +#TODO: if theres a .tgz dont include unzipped, regardless of size... + maxSize=111 #largest was all/data*tgz ignore=( @@ -9,6 +11,7 @@ ignore=( "*#" #ods-tmp-files *skyglow.log __pycache__ +temp ) projdir=`git rev-parse --show-toplevel` -- GitLab