corrected scaling default value and scaling behavior

This commit is contained in:
Sinq User Console Account
2026-05-29 15:09:55 +02:00
parent 855c23b0ee
commit 0d615715b1
3 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -434,7 +434,7 @@ class ReflectivityReductionConfig(ArgParsable):
'group': 'input data',
'help': 'apply convolution on lambda axes to smooth the normalization data, useful for low statistics'})
scale: List[float] = field(
default_factory=lambda: [1.],
default_factory=lambda: [],
metadata={
'short': 's',
'group': 'data manicure',
+3 -3
View File
@@ -248,9 +248,9 @@ class LZProjection(ProjectionInterface):
def scale(self, factor: float):
if not self.is_normalized:
raise ValueError("Dataset needs to be normalized, first")
self.data.ref *= factor
self.data.err *= factor
self.norm_monitor /= factor
self.data.ref /= factor
self.data.err /= factor
self.norm_monitor *= factor
def project_on_qz(self):
if not self.is_normalized:
+6 -5
View File
@@ -204,11 +204,12 @@ class ReflectivityReduction:
logging.info(f' monitor = {self.monitor:8.2f} {MONITOR_UNITS[self.config.experiment.monitorType]}')
proj:LZProjection = self.project_on_lz()
try:
scale = self.config.reduction.scale[i]
except IndexError:
scale = self.config.reduction.scale[-1]
proj.scale(scale)
if not self.config.reduction.is_default('scale'):
try:
scale = self.config.reduction.scale[i]
except IndexError:
scale = self.config.reduction.scale[-1]
proj.scale(scale)
if 'Rqz.ort' in self.config.output.outputFormats:
headerRqz = self.header.orso_header()