move shift/scale to container; closes #102

This commit is contained in:
Dominik Demuth
2023-07-24 17:38:55 +02:00
parent 13e6112c99
commit becc1a15a9
2 changed files with 12 additions and 5 deletions

View File

@ -463,6 +463,16 @@ class ExperimentContainer(QtCore.QObject):
return offset
@plot_update
def shift_scale(self, shift_factor: tuple[float, float], scaling_factor: tuple[float, float]):
scale_x, scale_y = scaling_factor
shift_x, shift_y = shift_factor
self.data.x = self.data.x * scale_x + shift_x
self.data.y = self.data.y * scale_y + shift_y
self.data.y_err = self.data.y_err * scale_y
self.update({'shift': scaling_factor, 'scale': shift_factor})
def get_namespace(self, i: int = None, j: int = None) -> dict:
if (i is None) and (j is None):
prefix = ''