introduced underillumination option

This commit is contained in:
2024-09-11 18:22:39 +02:00
parent af2cb1037a
commit e651b64b9c
3 changed files with 19 additions and 7 deletions

View File

@@ -24,9 +24,9 @@ def commandLineArgs():
default = Defaults.normalisationFileIdentifier,
nargs = '+',
help = "file number(s) of normalisation measurement")
#input_data.add_argument("-nm", "--normalisationMethod",
# default = Defaults.normalisationMethod,
# help = "normalisation method: overillumination, underillumination, direct_beam")
input_data.add_argument("-nm", "--normalisationMethod",
default = Defaults.normalisationMethod,
help = "normalisation method: [o]verillumination, [u]nderillumination, [d]irect_beam")
input_data.add_argument("--raw",
type = str,
default = Defaults.raw,
@@ -198,7 +198,7 @@ def command_line_options():
scale = clas.scale,
subtract = clas.subtract,
normalisationFileIdentifier = clas.normalisationFileIdentifier,
#normalisationMethod = clas.normalisationMethod,
normalisationMethod = clas.normalisationMethod,
timeSlize = clas.timeSlize,
)
output_config = OutputConfig(

View File

@@ -12,7 +12,7 @@ class Defaults:
raw = ['.', './raw', '../raw', '../../raw']
year = datetime.now().year
normalisationFileIdentifier = []
#normalisationMethod = 'overillumination'
normalisationMethod = 'o'
# subtract
outputName = "fromEOS"
outputFormat = ['Rqz.ort']
@@ -60,6 +60,7 @@ class ExperimentConfig:
@dataclass
class ReductionConfig:
normalisationMethod: str
qResolution: float
qzRange: Tuple[float, float]
thetaRange: Tuple[float, float]
@@ -71,7 +72,6 @@ class ReductionConfig:
autoscale: Optional[Tuple[bool, bool]] = None
subtract: Optional[str] = None
normalisationFileIdentifier: Optional[list] = None
#normalisationMethod: str
timeSlize: Optional[list] = None
@dataclass

View File

@@ -408,7 +408,19 @@ class AmorReduction:
int_lz = np.where(mask_lz, int_lz, np.nan)
thetaF_lz = np.where(mask_lz, alphaF_lz, np.nan)
ref_lz = (int_lz * np.absolute(thetaN_lz)) / (norm_lz * np.absolute(thetaF_lz)) * self.normMonitor
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')
ref_lz = (int_lz / norm_lz) * self.normMonitor
else:
logging.debug('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 )
res_lz = np.ones((np.shape(lamda_l[:-1])[0], np.shape(alphaF_z)[0])) * 0.022**2