pymodaq_data 5.0.3__tar.gz → 5.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/.gitignore +2 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/PKG-INFO +1 -1
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/_version.py +2 -2
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/data.py +43 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/LICENSE +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/README.rst +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/pyproject.toml +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/__init__.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/__init__.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/backends.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/browsing.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/data_saving.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/exporter.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/saving.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/h5modules/utils.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/icon.ico +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/numpy_func.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/plotting/__init__.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/plotting/plotter/plotter.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/post_treatment/__init__.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/slicing.py +0 -0
- {pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/splash.png +0 -0
|
@@ -678,6 +678,49 @@ class DataBase(DataLowLevel, NDArrayOperatorsMixin):
|
|
|
678
678
|
""" Change immediately the units to whatever else. Use this with care!"""
|
|
679
679
|
self._units = units
|
|
680
680
|
|
|
681
|
+
def value(self, units: str = None) -> float:
|
|
682
|
+
"""Returns the underlying float value (of the first elt in the data list) if this data
|
|
683
|
+
holds only a float otherwise returns a mean of the underlying data
|
|
684
|
+
|
|
685
|
+
Parameters
|
|
686
|
+
----------
|
|
687
|
+
|
|
688
|
+
units: str
|
|
689
|
+
if unit is compatible with self.units, convert the data to these new units before
|
|
690
|
+
getting the value
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
"""
|
|
694
|
+
if self.length == 1 and self.size == 1:
|
|
695
|
+
if units is not None:
|
|
696
|
+
data = Q_(float(self.data[0][0]), self.units)
|
|
697
|
+
return data.m_as(units)
|
|
698
|
+
else:
|
|
699
|
+
return float(self.data[0][0])
|
|
700
|
+
else:
|
|
701
|
+
if units is not None:
|
|
702
|
+
data = Q_(float(np.mean(self.data[0])), self.units)
|
|
703
|
+
return data.m_as(units)
|
|
704
|
+
else:
|
|
705
|
+
return float(np.mean(self.data[0]))
|
|
706
|
+
|
|
707
|
+
def values(self, units: str = None) -> List[float]:
|
|
708
|
+
"""Returns the underlying float value (for each data array in the data list) if this data
|
|
709
|
+
holds only a float otherwise returns a mean of the underlying data"""
|
|
710
|
+
if self.length == 1 and self.size == 1:
|
|
711
|
+
if units is not None:
|
|
712
|
+
return [float(Q_(data_array[0], self.units).m_as(units))
|
|
713
|
+
for data_array in self.data]
|
|
714
|
+
else:
|
|
715
|
+
return [float(data_array[0])
|
|
716
|
+
for data_array in self.data]
|
|
717
|
+
else:
|
|
718
|
+
if units is not None:
|
|
719
|
+
return [float(Q_(np.mean(data_array), self.units).m_as(units))
|
|
720
|
+
for data_array in self.data]
|
|
721
|
+
else:
|
|
722
|
+
return [float(np.mean(data_array)) for data_array in self.data]
|
|
723
|
+
|
|
681
724
|
def as_dte(self, name: str = 'mydte') -> DataToExport:
|
|
682
725
|
"""Convenience method to wrap the DataWithAxes object into a DataToExport"""
|
|
683
726
|
return DataToExport(name, data=[self])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/plotting/plotter/plotters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.0.3 → pymodaq_data-5.0.4}/src/pymodaq_data/post_treatment/process_to_scalar.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|