cut_index bug: limits not set properly
Loading a "real" dataset via numpy => xarray => datacube dashboard:
import datacube
import glob
import numpy as np
import xarray
%matplotlib widget
dat_files = glob.glob("/home/jovyan/steelelab/measurement_data/Triton/Edouard"+\
"/LS261/RF_meas/Third_cooldown/RF_vs_Vg_vs_Temp/**/*.dat")
data = np.loadtxt(file, delimiter=",")
print(data.shape)
#with open(file.strip(".dat")+".meta.txt") as f:
# print(f.read())
# Manaully hacking the outer loop out of the meta.txt file, I see it has 81 points...
data2 = np.reshape(data, (81,data.shape[0]//81,8))
D2.load_xarray(xarray.DataArray(data2, name='Z'))
D2.show_dashboard()
The limits of the are not updated properly when adjusting cut_axis
. The array I loaded has size of only 8 in the 3rd dimension. However, when cut_axis
is set to "2" (ie third index of numpy array), the limit setting of cut_index
is still set to 80 (the value associated with cut_index = 0
).
This triggers an exception:
IndexError: index 80 is out of bounds for axis 2 with size 8