Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Track Analyzer
track-analyzer
Commits
e56e5a47
Commit
e56e5a47
authored
Dec 17, 2021
by
amichaut
Browse files
bugfix: supports absent plot_on in vector_field config
parent
6414429a
Changes
1
Hide whitespace changes
Inline
Side-by-side
track_analyzer/plotting.py
View file @
e56e5a47
...
...
@@ -389,6 +389,8 @@ def plot_vector_field(data_dir, df, data, field, frame, plot_on_field=None, dim=
no_plot_on_field
=
False
if
plot_on_field
is
not
None
:
if
'plot_on'
not
in
plot_on_field
.
keys
():
plot_on_field
[
'plot_on'
]
=
None
if
plot_on_field
[
'plot_on'
]
is
not
None
:
map_param_
=
map_param
map_param_
[
'cmap'
]
=
plot_on_field
[
'cmap'
]
...
...
@@ -1074,16 +1076,19 @@ def plot_all_vector_fields(data_dir, df, data, field, plot_on_field=None, dim=3,
# get vlim
if
plot_on_field
is
not
None
:
vlim_default
=
tca
.
compute_vlim
(
df
,
data
,
plot_on_field
[
'plot_on'
])
if
plot_on_field
[
'vlim'
]
is
None
:
plot_on_field
[
'vlim'
]
=
vlim_default
else
:
for
i
,
vl
in
enumerate
(
plot_on_field
[
'vlim'
]):
if
vl
is
None
:
plot_on_field
[
'vlim'
][
i
]
=
vlim_default
[
i
]
if
'plot_on'
not
in
plot_on_field
.
keys
():
plot_on_field
[
'plot_on'
]
=
None
if
plot_on_field
[
'plot_on'
]
is
not
None
:
vlim_default
=
tca
.
compute_vlim
(
df
,
data
,
plot_on_field
[
'plot_on'
])
if
plot_on_field
[
'vlim'
]
is
None
:
plot_on_field
[
'vlim'
]
=
vlim_default
else
:
for
i
,
vl
in
enumerate
(
plot_on_field
[
'vlim'
]):
if
vl
is
None
:
plot_on_field
[
'vlim'
][
i
]
=
vlim_default
[
i
]
label
=
tpr
.
make_param_label
(
plot_on_field
[
'plot_on'
],
l_unit
=
info
[
'length_unit'
],
t_unit
=
info
[
'time_unit'
])
plot_cmap
(
plot_dir
,
label
,
plot_on_field
[
'cmap'
],
plot_on_field
[
'vlim'
][
0
],
plot_on_field
[
'vlim'
][
1
],
suffix
=
'_vector_'
+
plot_on_field
[
'plot_on'
])
label
=
tpr
.
make_param_label
(
plot_on_field
[
'plot_on'
],
l_unit
=
info
[
'length_unit'
],
t_unit
=
info
[
'time_unit'
])
plot_cmap
(
plot_dir
,
label
,
plot_on_field
[
'cmap'
],
plot_on_field
[
'vlim'
][
0
],
plot_on_field
[
'vlim'
][
1
],
suffix
=
'_vector_'
+
plot_on_field
[
'plot_on'
])
stack
=
[]
# stack to store images
for
frame
in
df
[
'frame'
].
unique
():
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment