From 22f72c53c7fcdd881db3047a4bef9a67543a5d26 Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Wed, 14 Feb 2024 09:17:57 +0100 Subject: [PATCH] Fix issue on npt1_rad not taken into account --- plugins/id02/single_detector.py | 38 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/plugins/id02/single_detector.py b/plugins/id02/single_detector.py index 316e26c..ed7aca3 100644 --- a/plugins/id02/single_detector.py +++ b/plugins/id02/single_detector.py @@ -8,7 +8,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "12/04/2022" +__date__ = "14/02/2024" __status__ = "development" __version__ = "0.9.3" @@ -709,26 +709,30 @@ def grpdeepcopy(name, obj): grp.visititems(grpdeepcopy) shape = self.in_shape[:] - if self.npt1_rad is None and "npt1_rad" in self.input: - self.npt1_rad = int(self.input["npt1_rad"]) - else: - qmax = self.ai.qArray(self.in_shape[-2:]).max() - dqmin = self.ai.deltaQ(self.in_shape[-2:]).min() * 2.0 - self.npt1_rad = int(qmax / dqmin) - - if ext == "azim": - if "npt2_rad" in self.input: - self.npt2_rad = int(self.input["npt2_rad"]) + #self.log_warning(f"in create HDF5 self.npt1_rad={self.npt1_rad} and self.input={self.input.get('npt1_rad')}") + if self.npt1_rad is None: + if "npt1_rad" in self.input: + self.npt1_rad = int(self.input["npt1_rad"]) else: qmax = self.ai.qArray(self.in_shape[-2:]).max() dqmin = self.ai.deltaQ(self.in_shape[-2:]).min() * 2.0 - self.npt2_rad = int(qmax / dqmin) + self.npt1_rad = int(qmax / dqmin) - if "npt2_azim" in self.input: - self.npt2_azim = int(self.input["npt2_azim"]) - else: - chi = self.ai.chiArray(self.in_shape[-2:]) - self.npt2_azim = int(numpy.degrees(chi.max() - chi.min())) + if ext == "azim": + if self.npt2_rad is None: + if "npt2_rad" in self.input: + self.npt2_rad = int(self.input["npt2_rad"]) + else: + qmax = self.ai.qArray(self.in_shape[-2:]).max() + dqmin = self.ai.deltaQ(self.in_shape[-2:]).min() * 2.0 + self.npt2_rad = int(qmax / dqmin) + + if self.npt2_azim is None: + if "npt2_azim" in self.input: + self.npt2_azim = int(self.input["npt2_azim"]) + else: + chi = self.ai.chiArray(self.in_shape[-2:]) + self.npt2_azim = int(numpy.degrees(chi.max() - chi.min())) shape = (self.in_shape[0], self.npt2_azim, self.npt2_rad) ai = self.ai.__copy__()