Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ecotronData
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kr69sugu
ecotronData
Commits
6e19aa1a
Commit
6e19aa1a
authored
3 years ago
by
am0ebe
Browse files
Options
Downloads
Patches
Plain Diff
add time_of_day col to ecolux
parent
9c6a38f1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
conf.json
+1
-1
1 addition, 1 deletion
conf.json
dataSync.py
+21
-15
21 additions, 15 deletions
dataSync.py
skyglow
+1
-1
1 addition, 1 deletion
skyglow
with
23 additions
and
17 deletions
conf.json
+
1
−
1
View file @
6e19aa1a
...
...
@@ -7,7 +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"
,
"./blatrack"
,
"2019-10-12"
,
"2019-10-1
5
"
],
[
"ecotrack"
,
"./ecotrack/in"
,
"./blatrack"
,
"2019-10-12"
,
"2019-10-1
3
"
],
[
"ecolux"
,
"./ecolux/I/01-raw"
,
"./blalux"
,
"2020-09-01"
,
"2020-09-02"
]
],
"blox"
:
...
...
This diff is collapsed.
Click to expand it.
dataSync.py
+
21
−
15
View file @
6e19aa1a
...
...
@@ -5,7 +5,7 @@
# output one huge table with all necessary fields for further processing/vizualization
#
############################
# TODO / MISC
# TODO / MISC
/ Q
############################
# rewrite conf.json structure to reflect projects > [conf, blox]
# > ecotrack time is in CEST (both track and temp) => UTC+2 => C'est une problème?
...
...
@@ -30,8 +30,8 @@ from pprint import pp as p
from
datetime
import
datetime
as
dt
import
dataFilter
try
:
scriptpath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
sys
.
path
.
append
(
scriptpath
+
os
.
sep
+
"
skyglow
"
)
scriptpath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
sys
.
path
.
append
(
scriptpath
+
os
.
sep
+
"
skyglow
"
)
from
skyglow
import
moon
as
moonMap
from
skyglow
import
skyglowDict
except
ModuleNotFoundError
as
e
:
...
...
@@ -50,7 +50,7 @@ NO_MERGE=False
# month, sunrise, sunset
# sa: https://www.laenderdaten.info/Europa/Deutschland/sonnenuntergang.php
suntimes
=
[
(
datetime
.
time
(
8
,
7
),
datetime
.
time
(
16
,
24
)
),
(
datetime
.
time
(
8
,
7
),
datetime
.
time
(
16
,
24
)
),
#january
(
datetime
.
time
(
7
,
20
),
datetime
.
time
(
17
,
20
)
),
(
datetime
.
time
(
6
,
18
),
datetime
.
time
(
18
,
12
)
),
(
datetime
.
time
(
6
,
5
),
datetime
.
time
(
20
,
6
)
),
...
...
@@ -61,7 +61,7 @@ suntimes = [
(
datetime
.
time
(
6
,
39
),
datetime
.
time
(
19
,
23
)
),
(
datetime
.
time
(
7
,
30
),
datetime
.
time
(
18
,
13
)
),
(
datetime
.
time
(
7
,
26
),
datetime
.
time
(
16
,
15
)
),
(
datetime
.
time
(
8
,
8
),
datetime
.
time
(
15
,
54
)
),
(
datetime
.
time
(
8
,
8
),
datetime
.
time
(
15
,
54
)
),
#december
]
def
isDay
(
cur
):
...
...
@@ -358,7 +358,7 @@ class Data:
for
daynight
in
[
0
,
1
]:
for
uid
in
range
(
N_UNITS
):
for
block
,
temps
in
self
.
meanTemps
[
daynight
][
uid
].
items
():
#
Assert
: temps is a
list
of floats
#
Note
: temps is a
tuple
of floats
# -> all temp-values for uid and block
tmin
=
min
(
temps
)
tmax
=
max
(
temps
)
...
...
@@ -366,6 +366,7 @@ class Data:
self
.
meanTemps
[
daynight
][
uid
][
block
]
=
tmean
,
tmin
,
tmax
#replace list with tuple of mean, min, max
#add (night,day)*(mean,min,max) to tempData
for
uid
in
range
(
N_UNITS
):
for
idx
,
lst
in
enumerate
(
self
.
tempData
[
uid
]
):
time
=
lst
[
0
]
...
...
@@ -375,14 +376,13 @@ 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
)
if
isDay
(
time
):
self
.
tempData
[
uid
][
idx
].
append
(
"
day
"
)
else
:
self
.
tempData
[
uid
][
idx
].
append
(
"
night
"
)
def
calc_mean_for_sensor_values_for_uid_and_time
(
self
,
uid
,
prev_time
):
# 4 sensor-values (usually)
mean
=
calc_mean
(
self
.
tempData
[
uid
][
-
1
][
1
:])
...
...
@@ -556,8 +556,14 @@ class Data:
temp_indices
[
uid
]
+=
1
# add cols (temp,mean_day_temp, mean_night_temp)
for
temp
in
self
.
tempData
[
uid
][
temp_indices
[
uid
]][
1
:]:
trackLine
+=
DELIM
+
f
"
%.
{
temp_precision
}
f
"
%
temp
#fill up to temp_precision digits after comma
for
temp
in
self
.
tempData
[
uid
][
temp_indices
[
uid
]][
1
:
-
1
]:
#fill up to temp_precision digits after comma
trackLine
+=
DELIM
+
f
"
%.
{
temp_precision
}
f
"
%
temp
# add daynight col
trackLine
+=
DELIM
+
self
.
tempData
[
uid
][
temp_indices
[
uid
]][
-
1
]
self
.
trackData
[
track_idx
]
=
trackLine
track_idx
+=
1
...
...
@@ -616,7 +622,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°],
is
_day
'
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°],
time_of
_day
'
h
+=
"
\n
"
+
RULER
+
"
\n
"
return
h
...
...
This diff is collapsed.
Click to expand it.
skyglow
@
04c1d615
Compare
40761891
...
04c1d615
Subproject commit
4076189110e3cbd75146a335c8954923e3959d2
7
Subproject commit
04c1d61535d26a4590b37d0e5d888e83ac20a56
7
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment