Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nephelometer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
nephelometer
Commits
4ad43a26
Commit
4ad43a26
authored
8 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted selections, allow selection of adjacent groups
parent
f0a525b5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
OP1.select
+3
-1
3 additions, 1 deletion
OP1.select
OP3.select
+3
-1
3 additions, 1 deletion
OP3.select
OP5.select
+3
-1
3 additions, 1 deletion
OP5.select
OP6.select
+3
-1
3 additions, 1 deletion
OP6.select
OP7.select
+3
-1
3 additions, 1 deletion
OP7.select
data_select.py
+33
-35
33 additions, 35 deletions
data_select.py
with
48 additions
and
40 deletions
OP1.select
+
3
−
1
View file @
4ad43a26
2016-10-17:12:44:00,2016-10-17:12:47:00
2016-10-17:12:44:00,2016-10-17:12:47:00
2016-10-18:11:33:00,2016-10-18:11:37:00
2016-10-18:11:33:00,2016-10-18:11:37:00
2016-10-24:13:05:00,2016-10-24:13:10:00
2016-10-24:13:05:00,2016-10-24:13:10:00
2016-11-01:12:43:00,2016-11-01:12:58:00
2016-11-01:12:43:30,2016-11-01:12:48:30
2016-11-01:12:48:30,2016-11-01:12:53:30
2016-11-01:12:53:30,2016-11-01:12:58:20
2016-11-28:12:17:30,2016-11-28:12:21:00
2016-11-28:12:17:30,2016-11-28:12:21:00
2016-11-30:11:12:00,2016-11-30:11:17:00
2016-11-30:11:12:00,2016-11-30:11:17:00
This diff is collapsed.
Click to expand it.
OP3.select
+
3
−
1
View file @
4ad43a26
2016-10-17:12:31:00,2016-10-17:12:35:00
2016-10-17:12:31:00,2016-10-17:12:35:00
2016-10-18:11:18:00,2016-10-18:11:23:00
2016-10-18:11:18:00,2016-10-18:11:23:00
2016-10-24:12:26:00,2016-10-24:12:42:00
2016-10-24:12:26:00,2016-10-24:12:42:00
2016-11-01:12:27:00,2016-11-01:12:42:00
2016-11-01:12:28:00,2016-11-01:12:32:00
2016-11-01:12:32:00,2016-11-01:12:37:00
2016-11-01:12:37:00,2016-11-01:12:42:00
2016-11-28:12:09:00,2016-11-28:12:13:30
2016-11-28:12:09:00,2016-11-28:12:13:30
2016-11-30:10:56:30,2016-11-30:11:03:00
2016-11-30:10:56:30,2016-11-30:11:03:00
This diff is collapsed.
Click to expand it.
OP5.select
+
3
−
1
View file @
4ad43a26
2016-10-17:12:19:00,2016-10-17:12:20:00
2016-10-17:12:19:00,2016-10-17:12:20:00
2016-10-18:11:03:00,2016-10-18:11:09:00
2016-10-18:11:03:00,2016-10-18:11:09:00
2016-10-24:11:56:00,2016-10-24:12:10:00
2016-10-24:11:56:00,2016-10-24:12:10:00
2016-11-01:12:09:00,2016-11-01:12:24:00
2016-11-01:12:10:20,2016-11-01:12:15:00
2016-11-01:12:15:00,2016-11-01:12:20:00
2016-11-01:12:20:00,2016-11-01:12:24:00
2016-11-28:11:58:00,2016-11-28:12:03:00
2016-11-28:11:58:00,2016-11-28:12:03:00
2016-11-30:10:43:00,2016-11-30:10:48:00
2016-11-30:10:43:00,2016-11-30:10:48:00
This diff is collapsed.
Click to expand it.
OP6.select
+
3
−
1
View file @
4ad43a26
2016-10-18:10:48:00,2016-10-18:10:55:00
2016-10-18:10:48:00,2016-10-18:10:55:00
2016-10-24:11:34:00,2016-10-24:11:43:00
2016-10-24:11:34:00,2016-10-24:11:43:00
2016-11-01:11:51:00,2016-11-01:12:07:00
2016-11-01:11:51:20,2016-11-01:11:57:20
2016-11-01:11:57:20,2016-11-01:12:02:00
2016-11-01:12:02:00,2016-11-01:12:07:00
2016-11-28:11:47:00,2016-11-28:11:53:00
2016-11-28:11:47:00,2016-11-28:11:53:00
2016-11-30:10:32:30,2016-11-30:10:39:00
2016-11-30:10:32:30,2016-11-30:10:39:00
This diff is collapsed.
Click to expand it.
OP7.select
+
3
−
1
View file @
4ad43a26
2016-10-17:11:57:00,2016-10-17:12:04:00
2016-10-17:11:57:00,2016-10-17:12:04:00
2016-10-18:10:29:00,2016-10-18:10:30:00
2016-10-18:10:29:00,2016-10-18:10:30:00
2016-10-24:11:18:00,2016-10-24:11:26:00
2016-10-24:11:18:00,2016-10-24:11:26:00
2016-11-01:11:31:00,2016-11-01:11:48:00
2016-11-01:11:32:00,2016-11-01:11:38:30
2016-11-01:11:38:30,2016-11-01:11:44:00
2016-11-01:11:44:00,2016-11-01:11:48:00
2016-11-28:11:39:00,2016-11-28:11:44:00
2016-11-28:11:39:00,2016-11-28:11:44:00
2016-11-30:10:20:50,2016-11-30:10:26:00
2016-11-30:10:20:50,2016-11-30:10:26:00
This diff is collapsed.
Click to expand it.
data_select.py
+
33
−
35
View file @
4ad43a26
...
@@ -8,7 +8,7 @@ import calendar
...
@@ -8,7 +8,7 @@ import calendar
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
op
=
os
.
path
.
basename
(
sys
.
argv
[
1
]).
split
(
'
.
'
)[
0
]
op
=
os
.
path
.
basename
(
sys
.
argv
[
1
]).
split
(
'
.
'
)[
0
]
Y2K
=
time
.
mktime
(
time
.
gmtime
(
calendar
.
timegm
([
2000
,
1
,
1
,
0
,
0
,
0
])))
Y2K
=
time
.
mktime
(
time
.
gmtime
(
calendar
.
timegm
([
2000
,
1
,
1
,
0
,
0
,
0
])))
data
=
{}
segment
=
[]
for
l
in
open
(
sys
.
argv
[
1
]):
for
l
in
open
(
sys
.
argv
[
1
]):
# print(l)
# print(l)
t1
,
t2
=
l
.
strip
().
split
(
'
,
'
)
t1
,
t2
=
l
.
strip
().
split
(
'
,
'
)
...
@@ -16,55 +16,53 @@ if __name__ == '__main__':
...
@@ -16,55 +16,53 @@ if __name__ == '__main__':
# Get selection interval
# Get selection interval
s1
=
time
.
mktime
(
time
.
strptime
(
t1
,
'
%Y-%m-%d:%H:%M:%S
'
))
-
Y2K
s1
=
time
.
mktime
(
time
.
strptime
(
t1
,
'
%Y-%m-%d:%H:%M:%S
'
))
-
Y2K
s2
=
time
.
mktime
(
time
.
strptime
(
t2
,
'
%Y-%m-%d:%H:%M:%S
'
))
-
Y2K
s2
=
time
.
mktime
(
time
.
strptime
(
t2
,
'
%Y-%m-%d:%H:%M:%S
'
))
-
Y2K
for
filename
in
sys
.
argv
[
2
:]:
# Select interval from data files
# Select interval from data files
interval
=
{}
for
filename
in
sys
.
argv
[
2
:]:
for
l2
in
open
(
filename
):
for
l2
in
open
(
filename
):
# Match on field with seconds from Y2K
s3
=
int
(
l2
.
strip
().
split
(
'
,
'
)[
1
])
s3
=
int
(
l2
.
strip
().
split
(
'
,
'
)[
1
])
if
s1
<=
s3
and
s3
<=
s2
:
if
s1
<=
s3
and
s3
<=
s2
:
data
[
s3
]
=
l2
.
strip
().
split
(
'
,
'
)
interval
[
s3
]
=
l2
.
strip
().
split
(
'
,
'
)
pass
pass
pass
pass
pass
if
len
(
interval
)
==
0
:
print
(
'
No data in %s - %s
'
%
(
t1
,
t2
))
pass
pass
else
:
segment
.
append
([
[
k
]
+
interval
[
k
]
for
k
in
sorted
(
interval
.
keys
())
])
pass
pass
# Find number of segments and total data timespan
# Find total data timespan
t_first
=
0
t_last
=
0
t_total
=
0
t_total
=
0
segments
=
0
for
s
in
segment
:
for
t
in
sorted
(
data
.
keys
()):
t_total
+=
s
[
-
1
][
0
]
-
s
[
0
][
0
]
if
t
>
t_last
+
120
:
time_jump
=
int
(
t_total
*
0.2
/
len
(
segment
))
# New segment
segments
+=
1
t_total
+=
t_last
-
t_first
t_first
=
t
t_last
=
t
print
(
segments
,
t_total
)
time_jump
=
t_total
*
0.2
/
segments
# Output selection
outfile
=
open
(
'
selected/%s
'
%
op
,
'
w
'
)
outfile
=
open
(
'
selected/%s
'
%
op
,
'
w
'
)
t_last
=
0
# Empty space at start of plot
print
(
"
*,%d,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan
"
%
0
,
file
=
outfile
)
t_last
=
time_jump
t_offset
=
0
t_offset
=
0
for
t
in
sorted
(
data
.
keys
()):
for
s
in
segment
:
if
t
>
t_last
+
120
:
t_offset
=
s
[
0
][
0
]
-
t_last
# New segment
print
(
"
*,%d,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan
"
%
# print("*,%s,0,0,0,0,0,0,0,0,300,300,0,1013" %
(
s
[
0
][
0
]
-
t_offset
-
1
),
print
(
"
*,%s,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan
"
%
(
t_last
-
t_offset
+
1
),
file
=
outfile
)
file
=
outfile
)
last_valid
=
t_last
-
t_offset
for
row
in
s
:
t_offset
=
t
-
last_valid
-
time_jump
t_new
=
row
[
0
]
-
t_offset
# print("*,%s,0,0,0,0,0,0,0,0,300,300,0,1013" %
print
(
"
%s,%s,%s
"
%
(
row
[
1
],
t_new
,
"
,
"
.
join
(
row
[
3
:])),
print
(
"
*,%s,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan
"
%
(
t
-
t_offset
-
1
),
file
=
outfile
)
file
=
outfile
)
pass
pass
t_last
=
t
print
(
"
*,%d,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan
"
%
t_new
=
t_last
-
t_offset
(
s
[
-
1
][
0
]
-
t_offset
+
1
),
print
(
"
%s,%s,%s
"
%
(
data
[
t
][
0
],
t_new
,
"
,
"
.
join
(
data
[
t
][
2
:])),
file
=
outfile
)
file
=
outfile
)
t_last
=
s
[
-
1
][
0
]
-
t_offset
+
time_jump
pass
pass
pass
pass
...
...
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