Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lorenz Halt
ilc
Commits
b238f15d
Commit
b238f15d
authored
Feb 15, 2021
by
victor
Browse files
change ilc_shift()
parent
7eadc0c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/ilc_lib/ilc_lib.py
View file @
b238f15d
...
...
@@ -112,21 +112,13 @@ def pad_data(a, b, val=0):
a
[:,
0
]
=
b
[:,
0
]
# restore timestamp
return
a
,
b
def
ilc_shift
(
data
,
timestep
,
T
):
out
=
[]
for
i
,
num
in
enumerate
(
data
[:,
0
]
):
l
=
[]
if
i
+
timestep
<
len
(
data
[:,
0
]):
l
.
append
(
num
)
for
n
,
val
in
enumerate
(
data
[
i
+
timestep
,
1
:
len
(
data
[
0
])]):
l
.
insert
(
n
+
1
,
val
)
#elif i + timestep >= len(data[:,0]):
# l.append( (i + timestep)*T )
# for n, val in enumerate(data[0,1:len(data[0])]):
# l.insert(n+1,0)
out
.
append
(
l
)
out
=
np
.
array
(
out
)
return
out
data_out
=
data
[
timestep
:,:
]
for
i
,
val
in
enumerate
(
data_out
):
data_out
[
i
,
0
]
=
i
*
T
return
data_out
def
reshape
(
data
,
last_duration
,
new_duration
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment