From e0d08b7af24fca03db89a9841b2b9ed85ec14c12 Mon Sep 17 00:00:00 2001 From: jochenstahn Date: Fri, 13 Sep 2024 08:06:30 +0200 Subject: [PATCH] more info in orso header, fixed typos --- libeos/file_reader.py | 4 ++++ libeos/reduction.py | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libeos/file_reader.py b/libeos/file_reader.py index 9a24ccf..a860a6f 100644 --- a/libeos/file_reader.py +++ b/libeos/file_reader.py @@ -163,6 +163,10 @@ class AmorData: ) self.header.measurement_instrument_settings.mu = fileio.Value(round(self.mu, 3), 'deg', comment='sample angle to horizon') self.header.measurement_instrument_settings.nu = fileio.Value(round(self.nu, 3), 'deg', comment='detector angle to horizon') + self.header.measurement_instrument_settings.div = fileio.Value(round(self.div, 3), 'deg', comment='incoming beam divergence') + self.header.measurement_instrument_settings.kap = fileio.Value(round(self.kap, 3), 'deg', comment='incoming beam inclination') + if abs(self.kad)>0.02: + self.header.measurement_instrument_settings.kad = fileio.Value(round(self.kad, 3), 'deg', comment='incoming beam angular offset') if norm: self.header.measurement_additional_files.append(fileio.File(file=fileName.split('/')[-1], timestamp=self.fileDate)) else: diff --git a/libeos/reduction.py b/libeos/reduction.py index 6025b78..4b8a3c2 100644 --- a/libeos/reduction.py +++ b/libeos/reduction.py @@ -408,18 +408,18 @@ class AmorReduction: int_lz = np.where(mask_lz, int_lz, np.nan) thetaF_lz = np.where(mask_lz, alphaF_lz, np.nan) - print(self.reduction_config.normalisationMethod) if self.reduction_config.normalisationMethod == 'o': logging.debug(' assuming an overilluminated sample and correcting for the angle of incidence') ref_lz = (int_lz * np.absolute(thetaN_lz)) / (norm_lz * np.absolute(thetaF_lz)) * self.normMonitor elif self.reduction_config.normalisationMethod == 'u': logging.debug(' assuming an underilluminated sample and ignoring the angle of incidence') ref_lz = (int_lz / norm_lz) * self.normMonitor - elif self.reduction_config.normalisationMethod == 'u': - logging.debug(' assuming direct beam for normalisation an underilluminated sample and ignoring the angle of incidence') + elif self.reduction_config.normalisationMethod == 'd': + logging.debug(' assuming direct beam for normalisation and ignoring the angle of incidence') + norm_lz = np.flip(norm_lz,1) ref_lz = (int_lz / norm_lz) * self.normMonitor else: - logging.debug('unknown normalisation method! Use [u], [o] or [d]') + logging.error('unknown normalisation method! Use [u], [o] or [d]') ref_lz = (int_lz * np.absolute(thetaN_lz)) / (norm_lz * np.absolute(thetaF_lz)) * self.normMonitor err_lz = ref_lz * np.sqrt( 1/(int_lz+.1) + 1/norm_lz )