Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IPI_annot
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Maxence Ferrari
IPI_annot
Commits
63511b45
Commit
63511b45
authored
4 years ago
by
ferrari
Browse files
Options
Downloads
Patches
Plain Diff
Add onaxis button
parent
bc2c50b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ipi_extract.py
+21
-0
21 additions, 0 deletions
ipi_extract.py
with
21 additions
and
0 deletions
ipi_extract.py
+
21
−
0
View file @
63511b45
...
@@ -263,6 +263,7 @@ class Callback(object):
...
@@ -263,6 +263,7 @@ class Callback(object):
self
.
reset_b
=
None
self
.
reset_b
=
None
self
.
r_button
=
None
self
.
r_button
=
None
self
.
ind_b
=
None
self
.
ind_b
=
None
self
.
onaxis_b
=
None
self
.
spec_b
=
None
self
.
spec_b
=
None
self
.
nfft
=
128
self
.
nfft
=
128
self
.
ind_select
=
False
self
.
ind_select
=
False
...
@@ -456,6 +457,15 @@ class Callback(object):
...
@@ -456,6 +457,15 @@ class Callback(object):
plt
.
pause
(
0.2
)
plt
.
pause
(
0.2
)
self
.
fax
.
get_figure
().
set_constrained_layout
(
False
)
self
.
fax
.
get_figure
().
set_constrained_layout
(
False
)
def
onaxis
(
self
,
event
):
if
self
.
df
[
self
.
offset
[
self
.
curr_ind
[
self
.
curr
],
0
]][
'
onaxis
'
]
==
-
1
:
self
.
df
[
self
.
offset
[
self
.
curr_ind
[
self
.
curr
],
0
]][
'
onaxis
'
]
=
1
else
:
self
.
df
[
self
.
offset
[
self
.
curr_ind
[
self
.
curr
],
0
]][
'
onaxis
'
]
^=
1
self
.
onaxis_b
.
label
.
set_text
(
'
On-axis
'
if
self
.
df
[
self
.
offset
[
self
.
curr_ind
[
self
.
curr
],
0
]][
'
onaxis
'
]
else
'
Off-axis
'
)
plt
.
draw
()
def
increase_freq
(
self
,
event
):
def
increase_freq
(
self
,
event
):
self
.
view_ax
[
self
.
curr
][
1
].
set_ylim
(
0
,
self
.
view_ax
[
self
.
curr
][
1
].
get_ylim
()[
1
]
+
1e3
)
self
.
view_ax
[
self
.
curr
][
1
].
set_ylim
(
0
,
self
.
view_ax
[
self
.
curr
][
1
].
get_ylim
()[
1
]
+
1e3
)
plt
.
draw
()
plt
.
draw
()
...
@@ -504,6 +514,9 @@ class Callback(object):
...
@@ -504,6 +514,9 @@ class Callback(object):
self
.
view_ax
[
ind
][
0
].
set_xlabel
(
f
'
Sig man:
{
dic
[
"
ipi_sig
"
]
:
.
3
f
}
'
)
self
.
view_ax
[
ind
][
0
].
set_xlabel
(
f
'
Sig man:
{
dic
[
"
ipi_sig
"
]
:
.
3
f
}
'
)
self
.
view_ax
[
ind
][
2
].
set_xlabel
(
f
'
Corr man:
{
dic
[
"
ipi_corr_man
"
]
:
.
3
f
}
auto:
{
dic
[
"
ipi_corr_auto
"
]
:
.
3
f
}
'
)
self
.
view_ax
[
ind
][
2
].
set_xlabel
(
f
'
Corr man:
{
dic
[
"
ipi_corr_man
"
]
:
.
3
f
}
auto:
{
dic
[
"
ipi_corr_auto
"
]
:
.
3
f
}
'
)
self
.
view_ax
[
ind
][
3
].
set_xlabel
(
f
'
Ceps man:
{
dic
[
"
ipi_ceps_man
"
]
:
.
3
f
}
auto:
{
dic
[
"
ipi_ceps_auto
"
]
:
.
3
f
}
'
)
self
.
view_ax
[
ind
][
3
].
set_xlabel
(
f
'
Ceps man:
{
dic
[
"
ipi_ceps_man
"
]
:
.
3
f
}
auto:
{
dic
[
"
ipi_ceps_auto
"
]
:
.
3
f
}
'
)
self
.
ind_b
.
label
.
set_text
(
f
'
Current individual:
\n
{
dic
[
"
ind_number
"
]
}
'
)
if
self
.
onaxis_b
is
not
None
:
self
.
onaxis_b
.
label
.
set_text
([
'
Off
'
,
'
On
'
,
'
?
'
][
dic
[
'
onaxis
'
]]
+
'
-axis
'
)
def
_set_visible
(
self
,
ind
=
None
,
state
=
False
):
def
_set_visible
(
self
,
ind
=
None
,
state
=
False
):
if
ind
is
None
:
if
ind
is
None
:
...
@@ -720,9 +733,12 @@ def main(args):
...
@@ -720,9 +733,12 @@ def main(args):
print
(
f
'
Out file
{
outpath
}
does not already exist and resume option is set.
'
)
print
(
f
'
Out file
{
outpath
}
does not already exist and resume option is set.
'
)
return
1
return
1
EMLN
[
'
onaxis
'
]
=
-
1
ref_dict
=
init
(
args
.
input
,
args
.
channel
)
ref_dict
=
init
(
args
.
input
,
args
.
channel
)
if
args
.
resume
:
if
args
.
resume
:
df
=
pd
.
read_hdf
(
outpath
)
df
=
pd
.
read_hdf
(
outpath
)
if
'
onaxis
'
not
in
df
.
columns
:
df
[
'
onaxis
'
]
=
-
1
ref_dict
[
'
callback
'
].
df
=
df
.
to_dict
(
orient
=
'
index
'
)
ref_dict
[
'
callback
'
].
df
=
df
.
to_dict
(
orient
=
'
index
'
)
ref_dict
[
'
callback
'
].
offset
=
np
.
tile
(
np
.
array
(
list
(
ref_dict
[
'
callback
'
].
df
.
keys
()))[:,
np
.
newaxis
],
(
1
,
2
))
ref_dict
[
'
callback
'
].
offset
=
np
.
tile
(
np
.
array
(
list
(
ref_dict
[
'
callback
'
].
df
.
keys
()))[:,
np
.
newaxis
],
(
1
,
2
))
ref_dict
[
'
callback
'
].
offset
[:,
1
]
=
ref_dict
[
'
callback
'
].
song_resample
[(
ref_dict
[
'
callback
'
].
offset
[:,
1
]
*
FSSR
).
astype
(
int
)]
ref_dict
[
'
callback
'
].
offset
[:,
1
]
=
ref_dict
[
'
callback
'
].
song_resample
[(
ref_dict
[
'
callback
'
].
offset
[:,
1
]
*
FSSR
).
astype
(
int
)]
...
@@ -732,6 +748,11 @@ def main(args):
...
@@ -732,6 +748,11 @@ def main(args):
if
not
np
.
all
(
pd
.
isnull
(
list
(
ref_dict
[
'
callback
'
].
df
[
p
].
values
()))):
if
not
np
.
all
(
pd
.
isnull
(
list
(
ref_dict
[
'
callback
'
].
df
[
p
].
values
()))):
colors
[
i
]
=
[
0
,
0
,
0
,
1
]
colors
[
i
]
=
[
0
,
0
,
0
,
1
]
ref_dict
[
'
callback
'
].
scat
.
set_color
(
colors
)
ref_dict
[
'
callback
'
].
scat
.
set_color
(
colors
)
onaxis_b_ax
=
plt
.
subplot
(
ref_dict
[
'
gridspec
'
][
-
1
,
8
:
10
])
onaxis_b
=
Button
(
onaxis_b_ax
,
'
?-axis
'
)
onaxis_b
.
on_clicked
(
ref_dict
[
'
callback
'
].
onaxis
)
ref_dict
[
'
callback
'
].
onaxis_b
=
onaxis_b
plt
.
draw
()
plt
.
draw
()
plt
.
pause
(
0.2
)
plt
.
pause
(
0.2
)
ref_dict
[
'
fig
'
].
set_constrained_layout
(
False
)
ref_dict
[
'
fig
'
].
set_constrained_layout
(
False
)
...
...
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