Commit 33860619 authored by syz's avatar syz
Browse files

Removed figure output from plot_2d_spectrogram and title is now optional

parent f5e61756
......@@ -493,7 +493,8 @@ def generatePlotGroups(h5_main, hdf, mean_resp, folder_path, basename, max_resp=
path_2d = path.join(folder_path, basename + '_Mean_Spec_' + fig_title + '.png')
path_hist = path.join(folder_path, basename + '_Histograms_' + fig_title + '.png')
plot_1d_spectrum(step_averaged_vec, freq_vec, fig_title, figure_path=path_1d)
plot_2d_spectrogram(mean_spec, freq_vec, fig_title, figure_path=path_2d)
fig_2d, axes_2d = plot_2d_spectrogram(mean_spec, freq_vec, title=fig_title)
fig_2d.savefig(path_2d, format='png', dpi=300)
if do_histogram:
plot_histgrams(hist_mat, hist_indices, grp.name, figure_path=path_hist)
......@@ -560,7 +561,8 @@ def visualize_plot_groups(h5_filepath):
plt_grp = grp[plt_grp_name]
if expt_type == 'BEPSData':
spect_data = plt_grp['Mean_Spectrogram'].value
plot_2d_spectrogram(spect_data, plt_grp['Bin_Frequencies'].value, plt_grp.attrs['Name'])
_ = plot_2d_spectrogram(spect_data, plt_grp['Bin_Frequencies'].value,
title=plt_grp.attrs['Name'])
step_avg_data = plt_grp['Step_Averaged_Response']
plot_1d_spectrum(step_avg_data, plt_grp['Bin_Frequencies'].value, plt_grp.attrs['Name'])
try:
......
......@@ -1290,7 +1290,7 @@ def plot_1d_spectrum(data_vec, freq, title, figure_path=None):
###############################################################################
def plot_2d_spectrogram(mean_spectrogram, freq, title, figure_path=None, **kwargs):
def plot_2d_spectrogram(mean_spectrogram, freq, title=None, **kwargs):
"""
Plots the position averaged spectrogram
......@@ -1300,10 +1300,8 @@ def plot_2d_spectrogram(mean_spectrogram, freq, title, figure_path=None, **kwarg
Means spectrogram arranged as [frequency, UDVS step]
freq : 1D numpy float array
BE frequency that serves as the X axes of the plot
title : String
title : str, optional
Plot group name
figure_path : String / Unicode
Absolute path of the file to write the figure to
Returns
---------
......@@ -1325,8 +1323,6 @@ def plot_2d_spectrogram(mean_spectrogram, freq, title, figure_path=None, **kwarg
extent=[freq[0], freq[-1], 0, mean_spectrogram.shape[0]],
figsize=(5, 3), origin='lower', stdevs=None, amp_units='V',
**kwargs)
if figure_path:
plt.savefig(figure_path, format='png', dpi=300)
return fig, axes
......
Markdown is supported
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