I am working with a large dataset so I am using NetCDF file to load my data. When I load my data is Xarrays I get the shape of (26666, 257, 55). Here 26666 is the number of total windows of a spectrogram, and (257, 55) represents the frequencies and time stamps for that window. When I plot my spectrogram right now I select the window that I want to plot and Holoviews plots that particular window for me. But now I want to plot the spectrogram of whole data(ie all the 26666 windows together). How do I change the shape of my array that can help me plot this?
Code I am working with right now that works for 1 window -
no2 = xr.open_dataarray(path)
plotting_data = no2.isel(slices = 120) # selecting the window number
final_freqs = np.linspace(0, 125000, 257)
# some here to calculate an array of shape(1, 55) to represent time called time_displayed
xr_spec = xr.DataArray(plotting_data, dims = ('freq','time') ,coords = {'freq':final_freqs,'time':time_displayed})
# naming the spectrogram
xr_spec.name = 'Spectrogram'
# Plotting interactive plots -
import holoviews as hv
from holoviews import opts
hv.extension('bokeh', 'matplotlib')
import os
os.environ['HV_DOC_HTML'] = 'true'
#%env HV_DOC_HTML=true
import numpy as np
from bokeh.plotting import figure, show
from bokeh.io import output_notebook
hv.extension('bokeh')
output_notebook()
import imp
imp.reload(hv)
hv_spec = hv.Dataset(plotting_data)
hv.extension('bokeh')
hv_spec.to(hv.Image, ['time', 'freq'])