loading data from files does not work using real measurement files
Inside of SteeleLab Jupyerhub:
import datacube
import glob
dat_files = glob.glob("/home/jovyan/steelelab/measurement_data/Triton/Edouard"+\
"/LS261/RF_meas/Third_cooldown/RF_vs_Vg_vs_Temp/**/*.dat")
file = dat_files[-1]
D2 = datacube.Dashboard()
D2.load_data_from_file(file)
gives error
---------------------------------------------------------------------------
MissingDimensionsError Traceback (most recent call last)
<ipython-input-1-0afb8ab6f496> in <module>
6 file = dat_files[-1]
7 D2 = datacube.Dashboard()
----> 8 D2.load_data_from_file(file)
/opt/conda/lib/python3.8/site-packages/datacube/Data.py in load_data_from_file(self, datafile)
47 """
48 if datafile:
---> 49 self.datafile = datafile
50 data_set = load_dat_meta_xarray(self.datafile)
51 else:
/opt/conda/lib/python3.8/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
602 raise TraitError('The "%s" trait is read-only.' % self.name)
603 else:
--> 604 self.set(obj, value)
605
606 def _validate(self, obj, value):
/opt/conda/lib/python3.8/site-packages/traitlets/traitlets.py in set(self, obj, value)
591 # we explicitly compare silent to True just in case the equality
592 # comparison above returns something other than True/False
--> 593 obj._notify_trait(self.name, old_value, new_value)
594
595 def __set__(self, obj, value):
/opt/conda/lib/python3.8/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
1215
1216 def _notify_trait(self, name, old_value, new_value):
-> 1217 self.notify_change(Bunch(
1218 name=name,
1219 old=old_value,
/opt/conda/lib/python3.8/site-packages/traitlets/traitlets.py in notify_change(self, change)
1225 def notify_change(self, change):
1226 """Notify observers of a change event"""
-> 1227 return self._notify_observers(change)
1228
1229 def _notify_observers(self, event):
/opt/conda/lib/python3.8/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
1262 c = getattr(self, c.name)
1263
-> 1264 c(event)
1265
1266 def _add_notifiers(self, handler, name, type):
/opt/conda/lib/python3.8/site-packages/datacube/Data.py in update_data_from_file(self, change)
179 """
180 if self.datafile:
--> 181 self.data_set = self.load_data_from_file(self.datafile)
182
183 @observe("data_set")
/opt/conda/lib/python3.8/site-packages/datacube/Data.py in load_data_from_file(self, datafile)
48 if datafile:
49 self.datafile = datafile
---> 50 data_set = load_dat_meta_xarray(self.datafile)
51 else:
52 data_set = []
/opt/conda/lib/python3.8/site-packages/datacube/importing/load_dat_meta_xarray.py in load_dat_meta_xarray(datfile, delimiter)
61 for i, name in enumerate(columnNames):
62 array = xr.DataArray(data[:, :, :, i], dims=coords.keys(), coords=coords)
---> 63 dataSet[name] = array
64
65 dataSet.attrs["datafile"] = datfile
/opt/conda/lib/python3.8/site-packages/xarray/core/dataset.py in __setitem__(self, key, value)
1523
1524 else:
-> 1525 self.update({key: value})
1526
1527 def __delitem__(self, key: Hashable) -> None:
/opt/conda/lib/python3.8/site-packages/xarray/core/dataset.py in update(self, other)
4095 Dataset.assign
4096 """
-> 4097 merge_result = dataset_update_method(self, other)
4098 return self._replace(inplace=True, **merge_result._asdict())
4099
/opt/conda/lib/python3.8/site-packages/xarray/core/merge.py in dataset_update_method(dataset, other)
967 # TODO: benbovy - flexible indexes: fix this (it only works with pandas indexes)
968 indexes = {key: PandasIndex(dataset.coords[key]) for key in dataset.xindexes.keys()}
--> 969 return merge_core(
970 [dataset, other],
971 priority_arg=1,
/opt/conda/lib/python3.8/site-packages/xarray/core/merge.py in merge_core(objects, compat, join, combine_attrs, priority_arg, explicit_coords, indexes, fill_value)
621 coerced, join=join, copy=False, indexes=indexes, fill_value=fill_value
622 )
--> 623 collected = collect_variables_and_indexes(aligned)
624
625 prioritized = _get_priority_vars_and_indexes(aligned, priority_arg, compat=compat)
/opt/conda/lib/python3.8/site-packages/xarray/core/merge.py in collect_variables_and_indexes(list_of_mappings)
285 append_all(coords, indexes)
286
--> 287 variable = as_variable(variable, name=name)
288 if variable.dims == (name,):
289 variable = variable.to_index_variable()
/opt/conda/lib/python3.8/site-packages/xarray/core/variable.py in as_variable(obj, name)
159 # convert the Variable into an Index
160 if obj.ndim != 1:
--> 161 raise MissingDimensionsError(
162 f"{name!r} has more than 1-dimension and the same name as one of its "
163 f"dimensions {obj.dims!r}. xarray disallows such variables because they "
MissingDimensionsError: 'Frequency (Hz)' has more than 1-dimension and the same name as one of its dimensions ('Frequency (Hz)', 'Vgate (V)', 'Nothing'). xarray disallows such variables because they conflict with the coordinates used to label dimensions.