Commit e56e5a47 authored by amichaut's avatar amichaut
Browse files

bugfix: supports absent plot_on in vector_field config

parent 6414429a
......@@ -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():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment