expanded the use of qzRange

This commit is contained in:
2024-05-31 08:30:10 +02:00
parent 21259acda4
commit 965e5125c8
4 changed files with 16 additions and 11 deletions
+1
View File
@@ -181,6 +181,7 @@ def command_line_options():
)
reduction_config = ReductionConfig(
qResolution = clas.qResolution,
qzRange = clas.qzRange,
autoscale = clas.autoscale,
thetaRange = clas.thetaRange,
thetaRangeR = clas.thetaRangeR,
+4 -2
View File
@@ -20,10 +20,11 @@ class Detector:
class Grid:
def __init__(self, qResolution):
def __init__(self, qResolution, qzRange):
self.lamdaCut = const.lamdaCut
self.dldl = 0.005 # Delta lambda / lambda
self.qResolution = qResolution
self.qzRange = qzRange
def q(self):
resolutions = [0.005, 0.01, 0.02, 0.025, 0.04, 0.05, 0.1, 1]
@@ -35,7 +36,8 @@ class Grid:
# linear up to qq
q_grid = np.arange(0, qq, qq*dqdq)
# exponential from qq on
q_grid = np.append(q_grid, qq*(1.+dqdq)**np.arange(int(np.log(0.3/qq)/np.log(1+dqdq))))
q_grid = np.append(q_grid, qq*(1.+dqdq)**np.arange(int(np.log(self.qzRange[1]/qq)/np.log(1+dqdq))))
q_grid = q_grid[q_grid>=self.qzRange[0]]
return q_grid
def lamda(self):
+2 -1
View File
@@ -58,6 +58,7 @@ class ExperimentConfig:
@dataclass
class ReductionConfig:
qResolution: float
qzRange: Tuple[float, float]
thetaRange: Tuple[float, float]
thetaRangeR: Tuple[float, float]
@@ -178,4 +179,4 @@ class EOSConfig:
return mlst
+9 -8
View File
@@ -17,7 +17,7 @@ class AmorReduction:
self.reader_config = config.reader
self.reduction_config = config.reduction
self.output_config = config.output
self.grid = Grid(config.reduction.qResolution)
self.grid = Grid(config.reduction.qResolution, config.experiment.qzRange)
self.header = Header()
self.header.reduction.call = EOSConfig.call_string(self)
@@ -87,15 +87,16 @@ class AmorReduction:
headerRqz = self.header.orso_header()
headerRqz.data_set = f'Nr {i} : mu = {self.file_reader.mu:6.3f} deg'
# projection on q-grid
# projection on qz-grid
q_q, R_q, dR_q, dq_q = self.project_on_qz(qz_lz, ref_lz, err_lz, res_lz, self.norm_lz, self.mask_lz)
filter_q = np.where((self.experiment_config.qzRange[0]>q_q) & (q_q>self.experiment_config.qzRange[1]),
False, True)
q_q = q_q[filter_q]
R_q = R_q[filter_q]
dR_q = dR_q[filter_q]
dq_q = dq_q[filter_q]
# The filtering is now done by restricting the qz-grid
#filter_q = np.where((self.experiment_config.qzRange[0]>q_q) & (q_q>self.experiment_config.qzRange[1]),
# False, True)
#q_q = q_q[filter_q]
#R_q = R_q[filter_q]
#dR_q = dR_q[filter_q]
#dq_q = dq_q[filter_q]
if self.reduction_config.autoscale:
if i==0: