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
32ae5a70
Commit
32ae5a70
authored
4 years ago
by
am0ebe
Browse files
Options
Downloads
Patches
Plain Diff
dataSync: filter out tags only consisting of digits. Assert: tag always contain at least 1 letter
parent
e1b28eda
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dataFilter.py
+0
-1
0 additions, 1 deletion
dataFilter.py
dataSync.py
+5
-4
5 additions, 4 deletions
dataSync.py
unknown-tags.sh
+2
-1
2 additions, 1 deletion
unknown-tags.sh
with
7 additions
and
6 deletions
dataFilter.py
+
0
−
1
View file @
32ae5a70
...
@@ -256,4 +256,3 @@ if __name__ == "__main__" :
...
@@ -256,4 +256,3 @@ if __name__ == "__main__" :
cutOff
=
False
cutOff
=
False
main
(
sys
.
argv
[
1
])
main
(
sys
.
argv
[
1
])
This diff is collapsed.
Click to expand it.
dataSync.py
+
5
−
4
View file @
32ae5a70
...
@@ -39,7 +39,7 @@ blox=[
...
@@ -39,7 +39,7 @@ blox=[
(
"
ecolux
"
,
"
./block-I/01-raw
"
,
"
./block-I/02-inspect
"
,
"
2020-07-21 00:00:00
"
,
"
2020-08-18 23:59:00
"
),
# Block1: 21.7 - 18.8
(
"
ecolux
"
,
"
./block-I/01-raw
"
,
"
./block-I/02-inspect
"
,
"
2020-07-21 00:00:00
"
,
"
2020-08-18 23:59:00
"
),
# Block1: 21.7 - 18.8
(
"
ecolux
"
,
"
./block-II/01-raw
"
,
"
./block-II/02-inspect
"
,
"
2020-09-15 00:00:00
"
,
"
2020-10-13 23:59:00
"
),
# Block2: 15.9 - 13.10
(
"
ecolux
"
,
"
./block-II/01-raw
"
,
"
./block-II/02-inspect
"
,
"
2020-09-15 00:00:00
"
,
"
2020-10-13 23:59:00
"
),
# Block2: 15.9 - 13.10
(
"
ecotrack
"
,
"
/opt/virtualBoxVMs/share/block-I/01-raw
"
,
"
/opt/virtualBoxVMs/share/block-I/02-inspect
"
,
"
2019-10-14 00:00:00
"
,
"
2019-10-16 23:59:00
"
),
(
"
ecotrack
"
,
"
/opt/virtualBoxVMs/share/block-I/01-raw
"
,
"
/opt/virtualBoxVMs/share/block-I/02-inspect
"
,
"
2019-10-14 00:00:00
"
,
"
2019-10-16 23:59:00
"
),
(
"
ecolux
"
,
"
./test
"
,
"
./test
"
,
"
20
20
-09-14 00:00:00
"
,
"
202
0
-09-16 23:59:00
"
),
(
"
ecolux
"
,
"
./test
"
,
"
./test
"
,
"
20
19
-09-14 00:00:00
"
,
"
202
1
-09-16 23:59:00
"
),
## -- add here -- ##
## -- add here -- ##
]
]
...
@@ -238,6 +238,7 @@ class Data:
...
@@ -238,6 +238,7 @@ class Data:
lines
=
f
.
readlines
()
lines
=
f
.
readlines
()
lines
=
self
.
clean
(
lines
,
T_MINLEN
,
T_MAXLEN
,
T_NCOLS
,
T_DELIM
,
self
.
getTrackTime
)
lines
=
self
.
clean
(
lines
,
T_MINLEN
,
T_MAXLEN
,
T_NCOLS
,
T_DELIM
,
self
.
getTrackTime
)
lines
=
[
l
for
l
in
lines
if
not
l
.
split
(
DELIM
)[
T_COL_TAG
].
isdigit
()]
if
not
lines
:
if
not
lines
:
pp
(
"
-> empty // non-usable
"
)
pp
(
"
-> empty // non-usable
"
)
...
@@ -306,12 +307,12 @@ class Data:
...
@@ -306,12 +307,12 @@ class Data:
return
lines
return
lines
def
clean
(
self
,
lines
,
minLen
,
maxLen
,
nCols
,
sep
,
timeFunc
=
None
):
def
clean
(
self
,
lines
,
minLen
,
maxLen
,
nCols
,
sep
,
timeFunc
=
None
):
"""
remove trailing newline, empty
and
comments and remove lines before startTime or after endTime
"""
"""
remove trailing newline, empty
,
comments and
all-digits and
remove lines before startTime or after endTime
"""
lines
=
[
l
.
strip
()
for
l
in
lines
]
lines
=
[
l
.
strip
()
for
l
in
lines
]
lines
=
[
l
for
l
in
lines
if
minLen
<=
len
(
l
)
<=
maxLen
]
# ecolux: ms are variable in length (0-999), SchrebaTron: ms is padded with zeros
lines
=
[
l
for
l
in
lines
if
minLen
<=
len
(
l
)
<=
maxLen
]
# ecolux: ms are variable in length (0-999), SchrebaTron: ms is padded with zeros
lines
=
list
(
filter
(
lambda
q
:
q
and
q
[
0
]
!=
'
#
'
,
lines
))
lines
=
[
l
for
l
in
lines
if
len
(
l
.
split
(
sep
))
==
nCols
]
lines
=
[
l
for
l
in
lines
if
len
(
l
.
split
(
sep
))
==
nCols
]
lines
=
[
l
.
replace
(
sep
,
DELIM
)
for
l
in
lines
]
lines
=
[
l
.
replace
(
sep
,
DELIM
)
for
l
in
lines
]
lines
=
list
(
filter
(
lambda
q
:
q
and
q
[
0
]
!=
'
#
'
,
lines
))
if
timeFunc
:
if
timeFunc
:
lines
=
list
(
filter
(
lambda
q
:
startTime
<=
timeFunc
(
q
)
<
endTime
,
lines
))
#only between start and endTime
lines
=
list
(
filter
(
lambda
q
:
startTime
<=
timeFunc
(
q
)
<
endTime
,
lines
))
#only between start and endTime
...
@@ -342,7 +343,7 @@ class Data:
...
@@ -342,7 +343,7 @@ class Data:
def
merge_animals
(
self
):
def
merge_animals
(
self
):
"""
merge AnimalData into TrackData on TagID
"""
"""
merge AnimalData into TrackData on TagID
"""
pp
(
"
merging animal data into track data. This might take a while.
Go grab a Coffee or do some pushups!
"
)
pp
(
"
merging animal data into track data. This might take a while.
Time to move around. Or grab a Coffee.
"
)
#TODO SPEED UP!!!
#TODO SPEED UP!!!
...
...
This diff is collapsed.
Click to expand it.
unknown-tags.sh
+
2
−
1
View file @
32ae5a70
...
@@ -14,7 +14,6 @@ if (( $# < 1 )); then
...
@@ -14,7 +14,6 @@ if (( $# < 1 )); then
exit
exit
fi
fi
in
=
`
ls
${
scriptdir
}
/block-
${
1
}
/02-inspect/ecolux-data-
*
-filtered
|
head
-1
`
# filename_suffix=`basename "$1" | cut -d'-' -f5-`
# filename_suffix=`basename "$1" | cut -d'-' -f5-`
# if [ "$filename_suffix" == "" ]; then
# if [ "$filename_suffix" == "" ]; then
# #before
# #before
...
@@ -25,6 +24,8 @@ in=`ls ${scriptdir}/block-${1}/02-inspect/ecolux-data-*-filtered | head -1`
...
@@ -25,6 +24,8 @@ in=`ls ${scriptdir}/block-${1}/02-inspect/ecolux-data-*-filtered | head -1`
COL_TAG
=
12
COL_TAG
=
12
HEADER_SIZE
=
1
HEADER_SIZE
=
1
# fi
# fi
in
=
`
ls
${
scriptdir
}
/block-
${
1
}
/02-inspect/ecolux-data-
*
-filtered
|
head
-1
`
LEN_W_HEADER
=
`
wc
-l
"
$in
"
|
cut
-d
" "
-f1
`
LEN_W_HEADER
=
`
wc
-l
"
$in
"
|
cut
-d
" "
-f1
`
LEN
=
$((
$LEN_W_HEADER
-
$HEADER_SIZE
))
LEN
=
$((
$LEN_W_HEADER
-
$HEADER_SIZE
))
...
...
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