From d754fc6d8caefa702152301a5e222d7a5fafa7ad Mon Sep 17 00:00:00 2001 From: Joachim Wuttke <j.wuttke@fz-juelich.de> Date: Tue, 9 Jul 2024 10:05:19 +0200 Subject: [PATCH] rename oldstyle c'tor -> Detector2Dfw --- Device/Detector/Detector2D.cpp | 8 +- Device/Detector/Detector2D.h | 7 +- Tests/Py/Fit/fitobjective_api.py | 2 +- Tests/Py/Functional/PyFuTestInfrastructure.py | 2 +- Wrap/Python/src/bornagain/std_simulations.py | 2 +- .../fit/scatter2d/consecutive_fitting.py | 2 +- auto/Examples/fit/scatter2d/expfit_galaxi.py | 2 +- auto/Examples/fit/scatter2d/fit2d.py | 2 +- auto/Examples/fit/scatter2d/gisas_model1.py | 2 +- .../fit/scatter2d/minimizer_settings.py | 2 +- .../fit/scatter2d/model1_cylinders.py | 2 +- .../fit/scatter2d/model2_hexlattice.py | 2 +- .../fit/scatter2d/multiple_datasets.py | 2 +- auto/Examples/offspec/OffspecResolved.py | 2 +- auto/Examples/scatter2d/ApproximationDA.py | 2 +- auto/Examples/scatter2d/ApproximationLMA.py | 2 +- auto/Examples/scatter2d/ApproximationSSCA.py | 2 +- auto/Examples/scatter2d/BeamDivergence.py | 2 +- .../Examples/scatter2d/BiMaterialCylinders.py | 2 +- .../scatter2d/BoxesWithSpecularPeak.py | 2 +- auto/Examples/scatter2d/BroadSpecular.py | 2 +- auto/Examples/scatter2d/ConstantBackground.py | 2 +- .../scatter2d/CoreShellNanoparticles.py | 2 +- .../scatter2d/CoreShellNanoparticles2.py | 2 +- .../Examples/scatter2d/CorrelatedRoughness.py | 2 +- .../scatter2d/CosineRipplesAtRectLattice.py | 2 +- auto/Examples/scatter2d/CustomFormFactor.py | 2 +- auto/Examples/scatter2d/Cylinders.py | 2 +- auto/Examples/scatter2d/CylindersAndPrisms.py | 2 +- .../scatter2d/CylindersInAverageLayer.py | 2 +- auto/Examples/scatter2d/CylindersInBA.py | 2 +- auto/Examples/scatter2d/DodecahedraSAS.py | 2 +- auto/Examples/scatter2d/FindPeaks.py | 2 +- .../scatter2d/HalfSpheresInAverageTopLayer.py | 2 +- .../scatter2d/HexagonalLatticesWithBasis.py | 2 +- .../scatter2d/Interference1DLattice.py | 2 +- .../Interference1DRadialParacrystal.py | 2 +- .../Interference2DCenteredSquareLattice.py | 2 +- .../scatter2d/Interference2DParacrystal.py | 2 +- .../Interference2DRotatedSquareLattice.py | 2 +- .../Interference2DSquareFiniteLattice.py | 2 +- .../scatter2d/LargeParticlesFormFactor.py | 2 +- .../LatticeOrientationDistribution.py | 2 +- auto/Examples/scatter2d/MagneticCylinders1.py | 2 +- auto/Examples/scatter2d/MagneticCylinders2.py | 2 +- auto/Examples/scatter2d/MagneticSpheres.py | 2 +- auto/Examples/scatter2d/Mesocrystal.py | 2 +- auto/Examples/scatter2d/Mesocrystal2.py | 2 +- auto/Examples/scatter2d/Mesocrystal3.py | 2 +- auto/Examples/scatter2d/Mesocrystal4.py | 2 +- auto/Examples/scatter2d/ObsoleteSimN.py | 2 +- .../scatter2d/ParticleAcrossInterface.py | 2 +- auto/Examples/scatter2d/PolarizedSANS.py | 2 +- .../scatter2d/PolydisperseCylinders.py | 2 +- auto/Examples/scatter2d/PositionVariance.py | 2 +- auto/Examples/scatter2d/RectangularGrating.py | 2 +- auto/Examples/scatter2d/Resolution.py | 2 +- auto/Examples/scatter2d/RotatedPyramids.py | 2 +- auto/Examples/scatter2d/RoughAndSpecular.py | 2 +- auto/Examples/scatter2d/SlicedLayer.py | 2 +- .../Examples/scatter2d/SpheresAtHexLattice.py | 2 +- auto/Examples/scatter2d/TriangularRipple.py | 2 +- .../fit/scatter2d/consecutive_fitting.py | 2 +- .../fit/scatter2d/expfit_galaxi.py | 2 +- auto/MiniExamples/fit/scatter2d/fit2d.py | 2 +- .../fit/scatter2d/gisas_model1.py | 2 +- .../fit/scatter2d/minimizer_settings.py | 2 +- .../fit/scatter2d/model1_cylinders.py | 2 +- .../fit/scatter2d/model2_hexlattice.py | 2 +- .../fit/scatter2d/multiple_datasets.py | 2 +- auto/MiniExamples/offspec/OffspecResolved.py | 2 +- .../MiniExamples/scatter2d/ApproximationDA.py | 2 +- .../scatter2d/ApproximationLMA.py | 2 +- .../scatter2d/ApproximationSSCA.py | 2 +- auto/MiniExamples/scatter2d/BeamDivergence.py | 2 +- .../scatter2d/BiMaterialCylinders.py | 2 +- .../scatter2d/BoxesWithSpecularPeak.py | 2 +- auto/MiniExamples/scatter2d/BroadSpecular.py | 2 +- .../scatter2d/ConstantBackground.py | 2 +- .../scatter2d/CoreShellNanoparticles.py | 2 +- .../scatter2d/CoreShellNanoparticles2.py | 2 +- .../scatter2d/CorrelatedRoughness.py | 2 +- .../scatter2d/CosineRipplesAtRectLattice.py | 2 +- .../scatter2d/CustomFormFactor.py | 2 +- auto/MiniExamples/scatter2d/Cylinders.py | 2 +- .../scatter2d/CylindersAndPrisms.py | 2 +- .../scatter2d/CylindersInAverageLayer.py | 2 +- auto/MiniExamples/scatter2d/CylindersInBA.py | 2 +- auto/MiniExamples/scatter2d/DodecahedraSAS.py | 2 +- auto/MiniExamples/scatter2d/FindPeaks.py | 2 +- .../scatter2d/HalfSpheresInAverageTopLayer.py | 2 +- .../scatter2d/HexagonalLatticesWithBasis.py | 2 +- .../scatter2d/Interference1DLattice.py | 2 +- .../Interference1DRadialParacrystal.py | 2 +- .../Interference2DCenteredSquareLattice.py | 2 +- .../scatter2d/Interference2DParacrystal.py | 2 +- .../Interference2DRotatedSquareLattice.py | 2 +- .../Interference2DSquareFiniteLattice.py | 2 +- .../scatter2d/LargeParticlesFormFactor.py | 2 +- .../LatticeOrientationDistribution.py | 2 +- .../scatter2d/MagneticCylinders1.py | 2 +- .../scatter2d/MagneticCylinders2.py | 2 +- .../MiniExamples/scatter2d/MagneticSpheres.py | 2 +- auto/MiniExamples/scatter2d/Mesocrystal.py | 2 +- auto/MiniExamples/scatter2d/Mesocrystal2.py | 2 +- auto/MiniExamples/scatter2d/Mesocrystal3.py | 2 +- auto/MiniExamples/scatter2d/Mesocrystal4.py | 2 +- auto/MiniExamples/scatter2d/ObsoleteSimN.py | 2 +- .../scatter2d/ParticleAcrossInterface.py | 2 +- auto/MiniExamples/scatter2d/PolarizedSANS.py | 2 +- .../scatter2d/PolydisperseCylinders.py | 2 +- .../scatter2d/PositionVariance.py | 2 +- .../scatter2d/RectangularGrating.py | 2 +- auto/MiniExamples/scatter2d/Resolution.py | 2 +- .../MiniExamples/scatter2d/RotatedPyramids.py | 2 +- .../scatter2d/RoughAndSpecular.py | 2 +- auto/MiniExamples/scatter2d/SlicedLayer.py | 2 +- .../scatter2d/SpheresAtHexLattice.py | 2 +- .../scatter2d/TriangularRipple.py | 2 +- auto/Wrap/libBornAgainDevice.py | 13 +- auto/Wrap/libBornAgainDevice_wrap.cpp | 254 ++++++------------ rawEx/fit/scatter2d/consecutive_fitting.py | 2 +- rawEx/fit/scatter2d/expfit_galaxi.py | 2 +- rawEx/fit/scatter2d/fit2d.py | 2 +- rawEx/fit/scatter2d/gisas_model1.py | 2 +- rawEx/fit/scatter2d/minimizer_settings.py | 2 +- rawEx/fit/scatter2d/model1_cylinders.py | 2 +- rawEx/fit/scatter2d/model2_hexlattice.py | 2 +- rawEx/fit/scatter2d/multiple_datasets.py | 2 +- rawEx/offspec/OffspecResolved.py | 2 +- rawEx/scatter2d/ApproximationDA.py | 2 +- rawEx/scatter2d/ApproximationLMA.py | 2 +- rawEx/scatter2d/ApproximationSSCA.py | 2 +- rawEx/scatter2d/BeamDivergence.py | 2 +- rawEx/scatter2d/BiMaterialCylinders.py | 2 +- rawEx/scatter2d/BoxesWithSpecularPeak.py | 2 +- rawEx/scatter2d/BroadSpecular.py | 2 +- rawEx/scatter2d/ConstantBackground.py | 2 +- rawEx/scatter2d/CoreShellNanoparticles.py | 2 +- rawEx/scatter2d/CoreShellNanoparticles2.py | 2 +- rawEx/scatter2d/CorrelatedRoughness.py | 2 +- rawEx/scatter2d/CosineRipplesAtRectLattice.py | 2 +- rawEx/scatter2d/CustomFormFactor.py | 2 +- rawEx/scatter2d/Cylinders.py | 2 +- rawEx/scatter2d/CylindersAndPrisms.py | 2 +- rawEx/scatter2d/CylindersInAverageLayer.py | 2 +- rawEx/scatter2d/CylindersInBA.py | 2 +- rawEx/scatter2d/DodecahedraSAS.py | 2 +- rawEx/scatter2d/FindPeaks.py | 2 +- .../scatter2d/HalfSpheresInAverageTopLayer.py | 2 +- rawEx/scatter2d/HexagonalLatticesWithBasis.py | 2 +- rawEx/scatter2d/Interference1DLattice.py | 2 +- .../Interference1DRadialParacrystal.py | 2 +- .../Interference2DCenteredSquareLattice.py | 2 +- rawEx/scatter2d/Interference2DParacrystal.py | 2 +- .../Interference2DRotatedSquareLattice.py | 2 +- .../Interference2DSquareFiniteLattice.py | 2 +- rawEx/scatter2d/LargeParticlesFormFactor.py | 2 +- .../LatticeOrientationDistribution.py | 2 +- rawEx/scatter2d/MagneticCylinders1.py | 2 +- rawEx/scatter2d/MagneticCylinders2.py | 2 +- rawEx/scatter2d/MagneticSpheres.py | 2 +- rawEx/scatter2d/Mesocrystal.py | 2 +- rawEx/scatter2d/Mesocrystal2.py | 2 +- rawEx/scatter2d/Mesocrystal3.py | 2 +- rawEx/scatter2d/Mesocrystal4.py | 2 +- rawEx/scatter2d/ObsoleteSimN.py | 2 +- rawEx/scatter2d/ParticleAcrossInterface.py | 2 +- rawEx/scatter2d/PolarizedSANS.py | 2 +- rawEx/scatter2d/PolydisperseCylinders.py | 2 +- rawEx/scatter2d/PositionVariance.py | 2 +- rawEx/scatter2d/RectangularGrating.py | 2 +- rawEx/scatter2d/Resolution.py | 2 +- rawEx/scatter2d/RotatedPyramids.py | 2 +- rawEx/scatter2d/RoughAndSpecular.py | 2 +- rawEx/scatter2d/SlicedLayer.py | 2 +- rawEx/scatter2d/SpheresAtHexLattice.py | 2 +- rawEx/scatter2d/TriangularRipple.py | 2 +- 178 files changed, 267 insertions(+), 363 deletions(-) diff --git a/Device/Detector/Detector2D.cpp b/Device/Detector/Detector2D.cpp index f4578248186..f049c8756b7 100644 --- a/Device/Detector/Detector2D.cpp +++ b/Device/Detector/Detector2D.cpp @@ -33,11 +33,11 @@ Detector2D::Detector2D(size_t n_phi, double phi_min, double phi_max, size_t n_al ASSERT(-pi / 2 < axis(1).min() && axis(1).max() < +pi / 2); } -Detector2D::Detector2D(double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, - double phi_center, double alpha_center) - : Detector2D(n_phi, phi_center - phi_span / 2, phi_center + phi_span / 2, - n_alpha, alpha_center - alpha_span / 2, alpha_center + alpha_span / 2) +Detector2D* Detector2Dfw(double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, + double phi_center, double alpha_center) { + return new Detector2D(n_phi, phi_center - phi_span / 2, phi_center + phi_span / 2, + n_alpha, alpha_center - alpha_span / 2, alpha_center + alpha_span / 2); } Detector2D* Detector2D::clone() const diff --git a/Device/Detector/Detector2D.h b/Device/Detector/Detector2D.h index cb9f5936ee2..49a66480af2 100644 --- a/Device/Detector/Detector2D.h +++ b/Device/Detector/Detector2D.h @@ -23,9 +23,6 @@ class Detector2D : public IDetector { public: explicit Detector2D(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max); - // TODO rm (unwise API change between v21 and v22) - explicit Detector2D(double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, - double phi_center, double alpha_center); ~Detector2D() override = default; @@ -41,4 +38,8 @@ public: size_t indexOfSpecular(const Beam& beam) const override; }; +//! Creates detector with fixed widths. TODO rm (unwise API change between v21 and v22) +Detector2D* Detector2Dfw(double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, + double phi_center, double alpha_center); + #endif // BORNAGAIN_DEVICE_DETECTOR_DETECTOR2D_H diff --git a/Tests/Py/Fit/fitobjective_api.py b/Tests/Py/Fit/fitobjective_api.py index 75d51d86bcf..82e0a88f586 100644 --- a/Tests/Py/Fit/fitobjective_api.py +++ b/Tests/Py/Fit/fitobjective_api.py @@ -15,7 +15,7 @@ class SimulationBuilder: self.m_nrow = 3 self.m_ncol = 4 self.beam = ba.Beam(1., 1., 0) - self.detector = ba.Detector2D(4*deg, 3*deg, self.m_ncol, self.m_nrow, 0, 1.5*deg) + self.detector = ba.Detector2Dfw(4*deg, 3*deg, self.m_ncol, self.m_nrow, 0, 1.5*deg) def size(self): return self.m_nrow * self.m_ncol diff --git a/Tests/Py/Functional/PyFuTestInfrastructure.py b/Tests/Py/Functional/PyFuTestInfrastructure.py index 4117b5d0b7b..eb482603159 100644 --- a/Tests/Py/Functional/PyFuTestInfrastructure.py +++ b/Tests/Py/Functional/PyFuTestInfrastructure.py @@ -8,7 +8,7 @@ from bornagain import deg #, ba_plot as bp def get_simulation_MiniGISAS(sample, n=25): beam = ba.Beam(1, 0.1, 0.2 * deg) - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, sample, detector) def run_simulation_MiniGISAS(sample): diff --git a/Wrap/Python/src/bornagain/std_simulations.py b/Wrap/Python/src/bornagain/std_simulations.py index 9fc9c6f8b66..9d353970f92 100644 --- a/Wrap/Python/src/bornagain/std_simulations.py +++ b/Wrap/Python/src/bornagain/std_simulations.py @@ -11,5 +11,5 @@ def sas(sample, n): Incident beam is almost horizontal. """ beam = ba.Beam(1, 1*angstrom, 1e-8*deg) - det = ba.Detector2D(9*deg, 9*deg, n, n, 0, 0) + det = ba.Detector2Dfw(9*deg, 9*deg, n, n, 0, 0) return ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/Examples/fit/scatter2d/consecutive_fitting.py b/auto/Examples/fit/scatter2d/consecutive_fitting.py index 7d7c64dba2a..c4acd1199b2 100755 --- a/auto/Examples/fit/scatter2d/consecutive_fitting.py +++ b/auto/Examples/fit/scatter2d/consecutive_fitting.py @@ -45,7 +45,7 @@ def get_simulation(P): """ beam = ba.Beam(1e8, 1*angstrom, 0.2*deg) n = 100 # bp.simargs['n'] - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/auto/Examples/fit/scatter2d/expfit_galaxi.py b/auto/Examples/fit/scatter2d/expfit_galaxi.py index c173661b99d..9227b391f88 100755 --- a/auto/Examples/fit/scatter2d/expfit_galaxi.py +++ b/auto/Examples/fit/scatter2d/expfit_galaxi.py @@ -96,7 +96,7 @@ def create_detector(beam): """ nx = pilatus_npx ny = pilatus_npy - return ba.Detector2D(3.4*deg, 1.84*deg, nx, ny, 0, 0.32*deg) + return ba.Detector2Dfw(3.4*deg, 1.84*deg, nx, ny, 0, 0.32*deg) def create_simulation(P): diff --git a/auto/Examples/fit/scatter2d/fit2d.py b/auto/Examples/fit/scatter2d/fit2d.py index 0eb222a1b5a..18cdadd4c86 100755 --- a/auto/Examples/fit/scatter2d/fit2d.py +++ b/auto/Examples/fit/scatter2d/fit2d.py @@ -22,7 +22,7 @@ def get_simulation(P): n = 100 beam = ba.Beam(1, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/fit/scatter2d/gisas_model1.py b/auto/Examples/fit/scatter2d/gisas_model1.py index 2afa24fd65c..0c2680a1475 100755 --- a/auto/Examples/fit/scatter2d/gisas_model1.py +++ b/auto/Examples/fit/scatter2d/gisas_model1.py @@ -33,7 +33,7 @@ def get_sample(P): def get_simulation(P): beam = ba.Beam(10**P['lg(intensity)'], 0.1*nm, 0.2*deg) n = 100 # bp.simargs['n'] - det = ba.Detector2D(3*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(3*deg, 3*deg, n, n, 0, 1.5*deg) sample = get_sample(P) simulation = ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/Examples/fit/scatter2d/minimizer_settings.py b/auto/Examples/fit/scatter2d/minimizer_settings.py index c462bd4d64d..825b71767de 100755 --- a/auto/Examples/fit/scatter2d/minimizer_settings.py +++ b/auto/Examples/fit/scatter2d/minimizer_settings.py @@ -47,7 +47,7 @@ def get_simulation(P): """ beam = ba.Beam(1e8, 1*angstrom, 0.2*deg) n = 100 # bp.simargs['n'] - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/auto/Examples/fit/scatter2d/model1_cylinders.py b/auto/Examples/fit/scatter2d/model1_cylinders.py index df96b40704f..491503b4943 100755 --- a/auto/Examples/fit/scatter2d/model1_cylinders.py +++ b/auto/Examples/fit/scatter2d/model1_cylinders.py @@ -37,7 +37,7 @@ def get_simulation(P): n = 100 beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) sample = get_sample(P) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/fit/scatter2d/model2_hexlattice.py b/auto/Examples/fit/scatter2d/model2_hexlattice.py index 3b27df3290b..08999271fd5 100755 --- a/auto/Examples/fit/scatter2d/model2_hexlattice.py +++ b/auto/Examples/fit/scatter2d/model2_hexlattice.py @@ -41,7 +41,7 @@ def get_simulation(P): """ n = 100 beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) sample = get_sample(P) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/fit/scatter2d/multiple_datasets.py b/auto/Examples/fit/scatter2d/multiple_datasets.py index 37a3c0963cc..c16bc971f3c 100755 --- a/auto/Examples/fit/scatter2d/multiple_datasets.py +++ b/auto/Examples/fit/scatter2d/multiple_datasets.py @@ -45,7 +45,7 @@ def get_simulation(P): beam = ba.Beam(1e8, 0.1*nm, incident_angle) n = 100 - detector = ba.Detector2D(3*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(3*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/auto/Examples/offspec/OffspecResolved.py b/auto/Examples/offspec/OffspecResolved.py index 694a6c7057d..6cf20b17bd5 100755 --- a/auto/Examples/offspec/OffspecResolved.py +++ b/auto/Examples/offspec/OffspecResolved.py @@ -44,7 +44,7 @@ def get_sample(): def simulate(sample): beam = ba.Beam(1e9, 0.1 * nm, 1.0 * deg) - detector = ba.Detector2D(4*deg, 0.06*deg, 501, 1, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 0.06*deg, 501, 1, 0, 1*deg) sim = ba.ScatteringSimulation(beam, sample, detector) return sim.simulate().flat() diff --git a/auto/Examples/scatter2d/ApproximationDA.py b/auto/Examples/scatter2d/ApproximationDA.py index 6df31a71e53..2d448f5a4ca 100755 --- a/auto/Examples/scatter2d/ApproximationDA.py +++ b/auto/Examples/scatter2d/ApproximationDA.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/ApproximationLMA.py b/auto/Examples/scatter2d/ApproximationLMA.py index 75d01d4eb3f..9da5cd0c551 100755 --- a/auto/Examples/scatter2d/ApproximationLMA.py +++ b/auto/Examples/scatter2d/ApproximationLMA.py @@ -60,7 +60,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/ApproximationSSCA.py b/auto/Examples/scatter2d/ApproximationSSCA.py index e7118b74eab..9c43ffaa831 100755 --- a/auto/Examples/scatter2d/ApproximationSSCA.py +++ b/auto/Examples/scatter2d/ApproximationSSCA.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/BeamDivergence.py b/auto/Examples/scatter2d/BeamDivergence.py index a59f68d87b0..cb1959990ab 100755 --- a/auto/Examples/scatter2d/BeamDivergence.py +++ b/auto/Examples/scatter2d/BeamDivergence.py @@ -14,7 +14,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) distr_1 = ba.DistributionLogNormal(0.1*nm, 0.1, 5, 2) simulation.addParameterDistribution( diff --git a/auto/Examples/scatter2d/BiMaterialCylinders.py b/auto/Examples/scatter2d/BiMaterialCylinders.py index 3c07636e428..196e933cd46 100755 --- a/auto/Examples/scatter2d/BiMaterialCylinders.py +++ b/auto/Examples/scatter2d/BiMaterialCylinders.py @@ -57,7 +57,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/BoxesWithSpecularPeak.py b/auto/Examples/scatter2d/BoxesWithSpecularPeak.py index 5a2849aab83..3e878480cff 100755 --- a/auto/Examples/scatter2d/BoxesWithSpecularPeak.py +++ b/auto/Examples/scatter2d/BoxesWithSpecularPeak.py @@ -48,7 +48,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 101 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) simulation.options().setIncludeSpecular(True) diff --git a/auto/Examples/scatter2d/BroadSpecular.py b/auto/Examples/scatter2d/BroadSpecular.py index 6ca871762c4..11730a846b8 100755 --- a/auto/Examples/scatter2d/BroadSpecular.py +++ b/auto/Examples/scatter2d/BroadSpecular.py @@ -22,7 +22,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.5*deg) n = 200 - detector = ba.Detector2D(1*deg, 1*deg, n, n, 0, 0.5 * deg) + detector = ba.Detector2Dfw(1*deg, 1*deg, n, n, 0, 0.5 * deg) detector.setResolutionFunction( ba.ResolutionFunction2DGaussian(0.04*deg, 0.03*deg)) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/scatter2d/ConstantBackground.py b/auto/Examples/scatter2d/ConstantBackground.py index 8a9d8a56681..f1bffbb675d 100755 --- a/auto/Examples/scatter2d/ConstantBackground.py +++ b/auto/Examples/scatter2d/ConstantBackground.py @@ -14,7 +14,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e6, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) background = ba.ConstantBackground(1e3) simulation.setBackground(background) diff --git a/auto/Examples/scatter2d/CoreShellNanoparticles.py b/auto/Examples/scatter2d/CoreShellNanoparticles.py index cf752d63760..0993407fa17 100755 --- a/auto/Examples/scatter2d/CoreShellNanoparticles.py +++ b/auto/Examples/scatter2d/CoreShellNanoparticles.py @@ -30,7 +30,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CoreShellNanoparticles2.py b/auto/Examples/scatter2d/CoreShellNanoparticles2.py index 0eeff1048c0..0f943ac0da1 100755 --- a/auto/Examples/scatter2d/CoreShellNanoparticles2.py +++ b/auto/Examples/scatter2d/CoreShellNanoparticles2.py @@ -33,7 +33,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CorrelatedRoughness.py b/auto/Examples/scatter2d/CorrelatedRoughness.py index 669a475cda8..37fb83849e5 100755 --- a/auto/Examples/scatter2d/CorrelatedRoughness.py +++ b/auto/Examples/scatter2d/CorrelatedRoughness.py @@ -44,7 +44,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(5e11, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(1*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(1*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py b/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py index c071327ac73..a880569fdd0 100755 --- a/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py +++ b/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.16*nm, 0.3*deg) n = 200 - detector = ba.Detector2D(3*deg, 2.5*deg, n, n, 0, 1.25*deg) + detector = ba.Detector2Dfw(3*deg, 2.5*deg, n, n, 0, 1.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CustomFormFactor.py b/auto/Examples/scatter2d/CustomFormFactor.py index 5f5fe1e56c2..7fcbbf3a729 100755 --- a/auto/Examples/scatter2d/CustomFormFactor.py +++ b/auto/Examples/scatter2d/CustomFormFactor.py @@ -76,7 +76,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 1*angstrom, 0.2*deg) n = 100 - det = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + det = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setNumberOfThreads( 1) # deactivate multithreading (why?) diff --git a/auto/Examples/scatter2d/Cylinders.py b/auto/Examples/scatter2d/Cylinders.py index 15a278cb6ca..bd287bd22a2 100755 --- a/auto/Examples/scatter2d/Cylinders.py +++ b/auto/Examples/scatter2d/Cylinders.py @@ -22,7 +22,7 @@ def get_simulation(sample): # Detector n = 200 - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/scatter2d/CylindersAndPrisms.py b/auto/Examples/scatter2d/CylindersAndPrisms.py index a88d115811f..00a53a0ad12 100755 --- a/auto/Examples/scatter2d/CylindersAndPrisms.py +++ b/auto/Examples/scatter2d/CylindersAndPrisms.py @@ -45,7 +45,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CylindersInAverageLayer.py b/auto/Examples/scatter2d/CylindersInAverageLayer.py index e63e0c90385..514801efb6a 100755 --- a/auto/Examples/scatter2d/CylindersInAverageLayer.py +++ b/auto/Examples/scatter2d/CylindersInAverageLayer.py @@ -44,7 +44,7 @@ def get_sample(cyl_height=5*nm): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/auto/Examples/scatter2d/CylindersInBA.py b/auto/Examples/scatter2d/CylindersInBA.py index e69d799f768..a208fb258b0 100755 --- a/auto/Examples/scatter2d/CylindersInBA.py +++ b/auto/Examples/scatter2d/CylindersInBA.py @@ -41,7 +41,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/DodecahedraSAS.py b/auto/Examples/scatter2d/DodecahedraSAS.py index f09d831f369..71813e3004f 100755 --- a/auto/Examples/scatter2d/DodecahedraSAS.py +++ b/auto/Examples/scatter2d/DodecahedraSAS.py @@ -33,7 +33,7 @@ def get_simulation(sample): # Detector opposite to source: n = 200 # number of pixels per direction - detector = ba.Detector2D(10*deg, 10*deg, n, n, 0, 0) + detector = ba.Detector2Dfw(10*deg, 10*deg, n, n, 0, 0) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/scatter2d/FindPeaks.py b/auto/Examples/scatter2d/FindPeaks.py index e09c77685cc..b57139c6a54 100755 --- a/auto/Examples/scatter2d/FindPeaks.py +++ b/auto/Examples/scatter2d/FindPeaks.py @@ -53,7 +53,7 @@ def get_sample(lattice_rotation_angle=0*deg): def get_simulation(sample): beam = ba.Beam(1e8, 1.34*angstrom, 0.4*deg) n = 401 - detector = ba.Detector2D(1*deg, 0.5*deg, n, n, 0, 0.25*deg) + detector = ba.Detector2Dfw(1*deg, 0.5*deg, n, n, 0, 0.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMonteCarloIntegration(True, 100) return simulation diff --git a/auto/Examples/scatter2d/HalfSpheresInAverageTopLayer.py b/auto/Examples/scatter2d/HalfSpheresInAverageTopLayer.py index 248d4988441..461bf89599b 100755 --- a/auto/Examples/scatter2d/HalfSpheresInAverageTopLayer.py +++ b/auto/Examples/scatter2d/HalfSpheresInAverageTopLayer.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/auto/Examples/scatter2d/HexagonalLatticesWithBasis.py b/auto/Examples/scatter2d/HexagonalLatticesWithBasis.py index 2b77d149269..7e546960410 100755 --- a/auto/Examples/scatter2d/HexagonalLatticesWithBasis.py +++ b/auto/Examples/scatter2d/HexagonalLatticesWithBasis.py @@ -62,7 +62,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(2*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(2*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference1DLattice.py b/auto/Examples/scatter2d/Interference1DLattice.py index 5bf54277882..f95c10496f8 100755 --- a/auto/Examples/scatter2d/Interference1DLattice.py +++ b/auto/Examples/scatter2d/Interference1DLattice.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 1*angstrom, 0.2*deg) n = 100 - det = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + det = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setMonteCarloIntegration(True, 100) if not "__no_terminal__" in globals(): diff --git a/auto/Examples/scatter2d/Interference1DRadialParacrystal.py b/auto/Examples/scatter2d/Interference1DRadialParacrystal.py index 58a12a0c768..cfe7e9c0630 100755 --- a/auto/Examples/scatter2d/Interference1DRadialParacrystal.py +++ b/auto/Examples/scatter2d/Interference1DRadialParacrystal.py @@ -48,7 +48,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py b/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py index 4bbe5f284ab..13ef5d88509 100755 --- a/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py +++ b/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py @@ -61,7 +61,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference2DParacrystal.py b/auto/Examples/scatter2d/Interference2DParacrystal.py index 61726cedbbe..fa5958c9f4f 100755 --- a/auto/Examples/scatter2d/Interference2DParacrystal.py +++ b/auto/Examples/scatter2d/Interference2DParacrystal.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py b/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py index 642d598e017..6fb4d590c8e 100755 --- a/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py +++ b/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py b/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py index fd992333f46..8081be947dc 100755 --- a/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py +++ b/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py @@ -51,7 +51,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/LargeParticlesFormFactor.py b/auto/Examples/scatter2d/LargeParticlesFormFactor.py index 42f66c19eb7..bf85ae38e3b 100755 --- a/auto/Examples/scatter2d/LargeParticlesFormFactor.py +++ b/auto/Examples/scatter2d/LargeParticlesFormFactor.py @@ -46,7 +46,7 @@ def get_simulation(sample, integration_flag): """ beam = ba.Beam(1, 1*angstrom, 0.2*deg) n = 201 - det = ba.Detector2D(3*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(3*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setMonteCarloIntegration(integration_flag, 50) if not "__no_terminal__" in globals(): diff --git a/auto/Examples/scatter2d/LatticeOrientationDistribution.py b/auto/Examples/scatter2d/LatticeOrientationDistribution.py index 6dfe72f851a..bd3d67f91bc 100755 --- a/auto/Examples/scatter2d/LatticeOrientationDistribution.py +++ b/auto/Examples/scatter2d/LatticeOrientationDistribution.py @@ -37,7 +37,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/MagneticCylinders1.py b/auto/Examples/scatter2d/MagneticCylinders1.py index ff00d599a28..fa4f81af8c7 100755 --- a/auto/Examples/scatter2d/MagneticCylinders1.py +++ b/auto/Examples/scatter2d/MagneticCylinders1.py @@ -34,7 +34,7 @@ def get_sample(): def get_simulation(sample): n = 100 beam = ba.Beam(1e2, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/MagneticCylinders2.py b/auto/Examples/scatter2d/MagneticCylinders2.py index faa9151e1b4..72c9a3c2f85 100755 --- a/auto/Examples/scatter2d/MagneticCylinders2.py +++ b/auto/Examples/scatter2d/MagneticCylinders2.py @@ -35,7 +35,7 @@ def get_simulation(sample, pol_dir): z_up = R3(0, 0, 1) n = 100 beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) beam.setPolarization(pol_dir) detector.setAnalyzer(z_up) diff --git a/auto/Examples/scatter2d/MagneticSpheres.py b/auto/Examples/scatter2d/MagneticSpheres.py index 73d16ab2e3e..cb1df1b4de0 100755 --- a/auto/Examples/scatter2d/MagneticSpheres.py +++ b/auto/Examples/scatter2d/MagneticSpheres.py @@ -39,7 +39,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e12, 0.1*nm, 0.5*deg) n = 200 - detector = ba.Detector2D(6*deg, 4*deg, n, n, 0, 2*deg) + detector = ba.Detector2Dfw(6*deg, 4*deg, n, n, 0, 2*deg) polarizer_vec = R3(0, 0, 1) analyzer_vec = R3(0, 0, -1) diff --git a/auto/Examples/scatter2d/Mesocrystal.py b/auto/Examples/scatter2d/Mesocrystal.py index f3c6291d7a9..c8440ea600b 100755 --- a/auto/Examples/scatter2d/Mesocrystal.py +++ b/auto/Examples/scatter2d/Mesocrystal.py @@ -52,7 +52,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Mesocrystal2.py b/auto/Examples/scatter2d/Mesocrystal2.py index 4745fdc085d..0314144f366 100755 --- a/auto/Examples/scatter2d/Mesocrystal2.py +++ b/auto/Examples/scatter2d/Mesocrystal2.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMesoOptions(True, 2.5) return simulation diff --git a/auto/Examples/scatter2d/Mesocrystal3.py b/auto/Examples/scatter2d/Mesocrystal3.py index c8ea6674cae..c0ce6bae532 100755 --- a/auto/Examples/scatter2d/Mesocrystal3.py +++ b/auto/Examples/scatter2d/Mesocrystal3.py @@ -69,7 +69,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Mesocrystal4.py b/auto/Examples/scatter2d/Mesocrystal4.py index d4a25f7c791..f96ba82ab67 100755 --- a/auto/Examples/scatter2d/Mesocrystal4.py +++ b/auto/Examples/scatter2d/Mesocrystal4.py @@ -69,7 +69,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/auto/Examples/scatter2d/ObsoleteSimN.py b/auto/Examples/scatter2d/ObsoleteSimN.py index 0b286f897e0..56a1f2eef9b 100755 --- a/auto/Examples/scatter2d/ObsoleteSimN.py +++ b/auto/Examples/scatter2d/ObsoleteSimN.py @@ -22,7 +22,7 @@ def get_simulation(sample): # Detector n = bp.simargs['n'] - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/scatter2d/ParticleAcrossInterface.py b/auto/Examples/scatter2d/ParticleAcrossInterface.py index d0778a04918..44d6c754e66 100755 --- a/auto/Examples/scatter2d/ParticleAcrossInterface.py +++ b/auto/Examples/scatter2d/ParticleAcrossInterface.py @@ -37,7 +37,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/PolarizedSANS.py b/auto/Examples/scatter2d/PolarizedSANS.py index ed5357e7b7e..95f579e8743 100755 --- a/auto/Examples/scatter2d/PolarizedSANS.py +++ b/auto/Examples/scatter2d/PolarizedSANS.py @@ -57,7 +57,7 @@ def get_simulation(sample): beam = ba.Beam(1e9, 0.4*nm, 0.001*deg) # Detector opposite to source: - detector = ba.Detector2D(14*deg, 14*deg, n, n, 0, 0) + detector = ba.Detector2Dfw(14*deg, 14*deg, n, n, 0, 0) beam.setPolarization(R3(0, 1, 0)) detector.setAnalyzer(R3(0, -1, 0)) diff --git a/auto/Examples/scatter2d/PolydisperseCylinders.py b/auto/Examples/scatter2d/PolydisperseCylinders.py index eb32e988cca..6b34ea538ce 100755 --- a/auto/Examples/scatter2d/PolydisperseCylinders.py +++ b/auto/Examples/scatter2d/PolydisperseCylinders.py @@ -30,7 +30,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/PositionVariance.py b/auto/Examples/scatter2d/PositionVariance.py index 1538fa6b452..8ecb36a6534 100755 --- a/auto/Examples/scatter2d/PositionVariance.py +++ b/auto/Examples/scatter2d/PositionVariance.py @@ -45,7 +45,7 @@ def get_sample(hasVariance, xi): def get_simulation(sample): n = 200 beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) - det = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/Examples/scatter2d/RectangularGrating.py b/auto/Examples/scatter2d/RectangularGrating.py index c5134a9c7fb..f3158303f5b 100755 --- a/auto/Examples/scatter2d/RectangularGrating.py +++ b/auto/Examples/scatter2d/RectangularGrating.py @@ -52,7 +52,7 @@ def get_sample(lattice_rotation_angle=0*deg): def get_simulation(sample): beam = ba.Beam(1e8, 0.134*nm, 0.4*deg) n = 200 - detector = ba.Detector2D(1*deg, 0.5*deg, n, n, 0, 0.25*deg) + detector = ba.Detector2Dfw(1*deg, 0.5*deg, n, n, 0, 0.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMonteCarloIntegration(True, 100) return simulation diff --git a/auto/Examples/scatter2d/Resolution.py b/auto/Examples/scatter2d/Resolution.py index 73920e373f9..02714ca000a 100755 --- a/auto/Examples/scatter2d/Resolution.py +++ b/auto/Examples/scatter2d/Resolution.py @@ -30,7 +30,7 @@ if __name__ == '__main__': # Detector nx = 142 ny = 200 - detector = ba.Detector2D(3*deg, 3*deg, nx, ny, 0, 1.5*deg) + detector = ba.Detector2Dfw(3*deg, 3*deg, nx, ny, 0, 1.5*deg) results = [] diff --git a/auto/Examples/scatter2d/RotatedPyramids.py b/auto/Examples/scatter2d/RotatedPyramids.py index 24458e4e71b..5cfbd3d449f 100755 --- a/auto/Examples/scatter2d/RotatedPyramids.py +++ b/auto/Examples/scatter2d/RotatedPyramids.py @@ -44,7 +44,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/RoughAndSpecular.py b/auto/Examples/scatter2d/RoughAndSpecular.py index 1690fe9871c..644dc1ed86a 100755 --- a/auto/Examples/scatter2d/RoughAndSpecular.py +++ b/auto/Examples/scatter2d/RoughAndSpecular.py @@ -32,7 +32,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.4*deg) n = 200 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, .4*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, .4*deg) detector.setResolutionFunction( ba.ResolutionFunction2DGaussian(0.02*deg, 0.02*deg)) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/scatter2d/SlicedLayer.py b/auto/Examples/scatter2d/SlicedLayer.py index 5b199088289..939226484b8 100755 --- a/auto/Examples/scatter2d/SlicedLayer.py +++ b/auto/Examples/scatter2d/SlicedLayer.py @@ -40,7 +40,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 100 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/auto/Examples/scatter2d/SpheresAtHexLattice.py b/auto/Examples/scatter2d/SpheresAtHexLattice.py index 86135aec7c8..704ddaaf7f9 100755 --- a/auto/Examples/scatter2d/SpheresAtHexLattice.py +++ b/auto/Examples/scatter2d/SpheresAtHexLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 200 - detector = ba.Detector2D(2*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(2*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/TriangularRipple.py b/auto/Examples/scatter2d/TriangularRipple.py index 3b15883d2ad..ac746224265 100755 --- a/auto/Examples/scatter2d/TriangularRipple.py +++ b/auto/Examples/scatter2d/TriangularRipple.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.16*nm, 0.3*deg) n = 200 - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/fit/scatter2d/consecutive_fitting.py b/auto/MiniExamples/fit/scatter2d/consecutive_fitting.py index cd82b1c1048..a828ec86a27 100755 --- a/auto/MiniExamples/fit/scatter2d/consecutive_fitting.py +++ b/auto/MiniExamples/fit/scatter2d/consecutive_fitting.py @@ -45,7 +45,7 @@ def get_simulation(P): """ beam = ba.Beam(1e8, 1*angstrom, 0.2*deg) n = 100 # bp.simargs['n'] - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py b/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py index 5dd586f2101..6f23651c623 100755 --- a/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py +++ b/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py @@ -96,7 +96,7 @@ def create_detector(beam): """ nx = pilatus_npx ny = pilatus_npy - return ba.Detector2D(3.4*deg, 1.84*deg, nx, ny, 0, 0.32*deg) + return ba.Detector2Dfw(3.4*deg, 1.84*deg, nx, ny, 0, 0.32*deg) def create_simulation(P): diff --git a/auto/MiniExamples/fit/scatter2d/fit2d.py b/auto/MiniExamples/fit/scatter2d/fit2d.py index f61b538316f..6621003b90a 100755 --- a/auto/MiniExamples/fit/scatter2d/fit2d.py +++ b/auto/MiniExamples/fit/scatter2d/fit2d.py @@ -22,7 +22,7 @@ def get_simulation(P): n = 11 beam = ba.Beam(1, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/fit/scatter2d/gisas_model1.py b/auto/MiniExamples/fit/scatter2d/gisas_model1.py index 2afa24fd65c..0c2680a1475 100755 --- a/auto/MiniExamples/fit/scatter2d/gisas_model1.py +++ b/auto/MiniExamples/fit/scatter2d/gisas_model1.py @@ -33,7 +33,7 @@ def get_sample(P): def get_simulation(P): beam = ba.Beam(10**P['lg(intensity)'], 0.1*nm, 0.2*deg) n = 100 # bp.simargs['n'] - det = ba.Detector2D(3*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(3*deg, 3*deg, n, n, 0, 1.5*deg) sample = get_sample(P) simulation = ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/MiniExamples/fit/scatter2d/minimizer_settings.py b/auto/MiniExamples/fit/scatter2d/minimizer_settings.py index d0bf6faf5b0..9d3f47df744 100755 --- a/auto/MiniExamples/fit/scatter2d/minimizer_settings.py +++ b/auto/MiniExamples/fit/scatter2d/minimizer_settings.py @@ -47,7 +47,7 @@ def get_simulation(P): """ beam = ba.Beam(1e8, 1*angstrom, 0.2*deg) n = 100 # bp.simargs['n'] - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/auto/MiniExamples/fit/scatter2d/model1_cylinders.py b/auto/MiniExamples/fit/scatter2d/model1_cylinders.py index 7a3125a7e5d..b032dbfa513 100755 --- a/auto/MiniExamples/fit/scatter2d/model1_cylinders.py +++ b/auto/MiniExamples/fit/scatter2d/model1_cylinders.py @@ -37,7 +37,7 @@ def get_simulation(P): n = 11 beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) sample = get_sample(P) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/fit/scatter2d/model2_hexlattice.py b/auto/MiniExamples/fit/scatter2d/model2_hexlattice.py index a95f39e194c..a86a2cada4d 100755 --- a/auto/MiniExamples/fit/scatter2d/model2_hexlattice.py +++ b/auto/MiniExamples/fit/scatter2d/model2_hexlattice.py @@ -41,7 +41,7 @@ def get_simulation(P): """ n = 11 beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) sample = get_sample(P) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/fit/scatter2d/multiple_datasets.py b/auto/MiniExamples/fit/scatter2d/multiple_datasets.py index f3ef4b4e8cf..95de4d56ae9 100755 --- a/auto/MiniExamples/fit/scatter2d/multiple_datasets.py +++ b/auto/MiniExamples/fit/scatter2d/multiple_datasets.py @@ -45,7 +45,7 @@ def get_simulation(P): beam = ba.Beam(1e8, 0.1*nm, incident_angle) n = 11 - detector = ba.Detector2D(3*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(3*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/auto/MiniExamples/offspec/OffspecResolved.py b/auto/MiniExamples/offspec/OffspecResolved.py index 694a6c7057d..6cf20b17bd5 100755 --- a/auto/MiniExamples/offspec/OffspecResolved.py +++ b/auto/MiniExamples/offspec/OffspecResolved.py @@ -44,7 +44,7 @@ def get_sample(): def simulate(sample): beam = ba.Beam(1e9, 0.1 * nm, 1.0 * deg) - detector = ba.Detector2D(4*deg, 0.06*deg, 501, 1, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 0.06*deg, 501, 1, 0, 1*deg) sim = ba.ScatteringSimulation(beam, sample, detector) return sim.simulate().flat() diff --git a/auto/MiniExamples/scatter2d/ApproximationDA.py b/auto/MiniExamples/scatter2d/ApproximationDA.py index 87e8502d85d..2be2e99a8b6 100755 --- a/auto/MiniExamples/scatter2d/ApproximationDA.py +++ b/auto/MiniExamples/scatter2d/ApproximationDA.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/ApproximationLMA.py b/auto/MiniExamples/scatter2d/ApproximationLMA.py index c635a7aaf1f..d54860ebda7 100755 --- a/auto/MiniExamples/scatter2d/ApproximationLMA.py +++ b/auto/MiniExamples/scatter2d/ApproximationLMA.py @@ -60,7 +60,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/ApproximationSSCA.py b/auto/MiniExamples/scatter2d/ApproximationSSCA.py index 61be717b831..2bdd2626098 100755 --- a/auto/MiniExamples/scatter2d/ApproximationSSCA.py +++ b/auto/MiniExamples/scatter2d/ApproximationSSCA.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/BeamDivergence.py b/auto/MiniExamples/scatter2d/BeamDivergence.py index d38bcba30d3..9c41c086100 100755 --- a/auto/MiniExamples/scatter2d/BeamDivergence.py +++ b/auto/MiniExamples/scatter2d/BeamDivergence.py @@ -14,7 +14,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) distr_1 = ba.DistributionLogNormal(0.1*nm, 0.1, 5, 2) simulation.addParameterDistribution( diff --git a/auto/MiniExamples/scatter2d/BiMaterialCylinders.py b/auto/MiniExamples/scatter2d/BiMaterialCylinders.py index 68a9b68151e..9994ba55711 100755 --- a/auto/MiniExamples/scatter2d/BiMaterialCylinders.py +++ b/auto/MiniExamples/scatter2d/BiMaterialCylinders.py @@ -57,7 +57,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py b/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py index 71381b3a02d..5b2df0b832a 100755 --- a/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py +++ b/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py @@ -48,7 +48,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) simulation.options().setIncludeSpecular(True) diff --git a/auto/MiniExamples/scatter2d/BroadSpecular.py b/auto/MiniExamples/scatter2d/BroadSpecular.py index 22dabcf9703..16a7b35ba31 100755 --- a/auto/MiniExamples/scatter2d/BroadSpecular.py +++ b/auto/MiniExamples/scatter2d/BroadSpecular.py @@ -22,7 +22,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.5*deg) n = 11 - detector = ba.Detector2D(1*deg, 1*deg, n, n, 0, 0.5 * deg) + detector = ba.Detector2Dfw(1*deg, 1*deg, n, n, 0, 0.5 * deg) detector.setResolutionFunction( ba.ResolutionFunction2DGaussian(0.04*deg, 0.03*deg)) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/scatter2d/ConstantBackground.py b/auto/MiniExamples/scatter2d/ConstantBackground.py index 5c5b5ad52bb..124c719f472 100755 --- a/auto/MiniExamples/scatter2d/ConstantBackground.py +++ b/auto/MiniExamples/scatter2d/ConstantBackground.py @@ -14,7 +14,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e6, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) background = ba.ConstantBackground(1e3) simulation.setBackground(background) diff --git a/auto/MiniExamples/scatter2d/CoreShellNanoparticles.py b/auto/MiniExamples/scatter2d/CoreShellNanoparticles.py index 607d2325977..712d2265a02 100755 --- a/auto/MiniExamples/scatter2d/CoreShellNanoparticles.py +++ b/auto/MiniExamples/scatter2d/CoreShellNanoparticles.py @@ -30,7 +30,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CoreShellNanoparticles2.py b/auto/MiniExamples/scatter2d/CoreShellNanoparticles2.py index 2dcfe45c10e..75c2f9ae7d7 100755 --- a/auto/MiniExamples/scatter2d/CoreShellNanoparticles2.py +++ b/auto/MiniExamples/scatter2d/CoreShellNanoparticles2.py @@ -33,7 +33,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CorrelatedRoughness.py b/auto/MiniExamples/scatter2d/CorrelatedRoughness.py index fc266b0368b..6e177ec354d 100755 --- a/auto/MiniExamples/scatter2d/CorrelatedRoughness.py +++ b/auto/MiniExamples/scatter2d/CorrelatedRoughness.py @@ -44,7 +44,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(5e11, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(1*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(1*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py b/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py index 122566c74cd..6459af5f601 100755 --- a/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py +++ b/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.16*nm, 0.3*deg) n = 11 - detector = ba.Detector2D(3*deg, 2.5*deg, n, n, 0, 1.25*deg) + detector = ba.Detector2Dfw(3*deg, 2.5*deg, n, n, 0, 1.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CustomFormFactor.py b/auto/MiniExamples/scatter2d/CustomFormFactor.py index 105bcbe4db6..d56445a4e4e 100755 --- a/auto/MiniExamples/scatter2d/CustomFormFactor.py +++ b/auto/MiniExamples/scatter2d/CustomFormFactor.py @@ -76,7 +76,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 1*angstrom, 0.2*deg) n = 11 - det = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + det = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setNumberOfThreads( 1) # deactivate multithreading (why?) diff --git a/auto/MiniExamples/scatter2d/Cylinders.py b/auto/MiniExamples/scatter2d/Cylinders.py index 9749f9cdb61..d0abd2628db 100755 --- a/auto/MiniExamples/scatter2d/Cylinders.py +++ b/auto/MiniExamples/scatter2d/Cylinders.py @@ -22,7 +22,7 @@ def get_simulation(sample): # Detector n = 11 - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/scatter2d/CylindersAndPrisms.py b/auto/MiniExamples/scatter2d/CylindersAndPrisms.py index 80842bd303c..7a02dbefc58 100755 --- a/auto/MiniExamples/scatter2d/CylindersAndPrisms.py +++ b/auto/MiniExamples/scatter2d/CylindersAndPrisms.py @@ -45,7 +45,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py b/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py index a93d92d8309..8774ca1138a 100755 --- a/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py +++ b/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py @@ -44,7 +44,7 @@ def get_sample(cyl_height=5*nm): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/auto/MiniExamples/scatter2d/CylindersInBA.py b/auto/MiniExamples/scatter2d/CylindersInBA.py index 57b345d96c3..aa9ec7023f1 100755 --- a/auto/MiniExamples/scatter2d/CylindersInBA.py +++ b/auto/MiniExamples/scatter2d/CylindersInBA.py @@ -41,7 +41,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/DodecahedraSAS.py b/auto/MiniExamples/scatter2d/DodecahedraSAS.py index a3dc2339e3a..f12d113a18d 100755 --- a/auto/MiniExamples/scatter2d/DodecahedraSAS.py +++ b/auto/MiniExamples/scatter2d/DodecahedraSAS.py @@ -33,7 +33,7 @@ def get_simulation(sample): # Detector opposite to source: n = 11 # number of pixels per direction - detector = ba.Detector2D(10*deg, 10*deg, n, n, 0, 0) + detector = ba.Detector2Dfw(10*deg, 10*deg, n, n, 0, 0) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/scatter2d/FindPeaks.py b/auto/MiniExamples/scatter2d/FindPeaks.py index 9cb10f4fd4f..00bc6a2a899 100755 --- a/auto/MiniExamples/scatter2d/FindPeaks.py +++ b/auto/MiniExamples/scatter2d/FindPeaks.py @@ -53,7 +53,7 @@ def get_sample(lattice_rotation_angle=0*deg): def get_simulation(sample): beam = ba.Beam(1e8, 1.34*angstrom, 0.4*deg) n = 11 - detector = ba.Detector2D(1*deg, 0.5*deg, n, n, 0, 0.25*deg) + detector = ba.Detector2Dfw(1*deg, 0.5*deg, n, n, 0, 0.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMonteCarloIntegration(True, 100) return simulation diff --git a/auto/MiniExamples/scatter2d/HalfSpheresInAverageTopLayer.py b/auto/MiniExamples/scatter2d/HalfSpheresInAverageTopLayer.py index 8c0c5d83451..54b6b5100ff 100755 --- a/auto/MiniExamples/scatter2d/HalfSpheresInAverageTopLayer.py +++ b/auto/MiniExamples/scatter2d/HalfSpheresInAverageTopLayer.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/auto/MiniExamples/scatter2d/HexagonalLatticesWithBasis.py b/auto/MiniExamples/scatter2d/HexagonalLatticesWithBasis.py index 02670dfbb30..4fc5c6efa8e 100755 --- a/auto/MiniExamples/scatter2d/HexagonalLatticesWithBasis.py +++ b/auto/MiniExamples/scatter2d/HexagonalLatticesWithBasis.py @@ -62,7 +62,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(2*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference1DLattice.py b/auto/MiniExamples/scatter2d/Interference1DLattice.py index 76da758800c..4b5e1c493d1 100755 --- a/auto/MiniExamples/scatter2d/Interference1DLattice.py +++ b/auto/MiniExamples/scatter2d/Interference1DLattice.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 1*angstrom, 0.2*deg) n = 11 - det = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + det = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setMonteCarloIntegration(True, 100) if not "__no_terminal__" in globals(): diff --git a/auto/MiniExamples/scatter2d/Interference1DRadialParacrystal.py b/auto/MiniExamples/scatter2d/Interference1DRadialParacrystal.py index 3773f8d72f7..c96e351881c 100755 --- a/auto/MiniExamples/scatter2d/Interference1DRadialParacrystal.py +++ b/auto/MiniExamples/scatter2d/Interference1DRadialParacrystal.py @@ -48,7 +48,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py b/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py index 962b2c87357..d4fcf8a4d14 100755 --- a/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py +++ b/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py @@ -61,7 +61,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference2DParacrystal.py b/auto/MiniExamples/scatter2d/Interference2DParacrystal.py index d241eb2e0aa..7f9b0f37115 100755 --- a/auto/MiniExamples/scatter2d/Interference2DParacrystal.py +++ b/auto/MiniExamples/scatter2d/Interference2DParacrystal.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py b/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py index fbd0cb00e9d..8d11f9bd9c7 100755 --- a/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py +++ b/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py b/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py index 68a86b2c415..413e989803f 100755 --- a/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py +++ b/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py @@ -51,7 +51,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py b/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py index 050f63e6bec..ea55ee2a5b0 100755 --- a/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py +++ b/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py @@ -46,7 +46,7 @@ def get_simulation(sample, integration_flag): """ beam = ba.Beam(1, 1*angstrom, 0.2*deg) n = 11 - det = ba.Detector2D(3*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(3*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setMonteCarloIntegration(integration_flag, 50) if not "__no_terminal__" in globals(): diff --git a/auto/MiniExamples/scatter2d/LatticeOrientationDistribution.py b/auto/MiniExamples/scatter2d/LatticeOrientationDistribution.py index 358cac47c8b..902b6e8a71c 100755 --- a/auto/MiniExamples/scatter2d/LatticeOrientationDistribution.py +++ b/auto/MiniExamples/scatter2d/LatticeOrientationDistribution.py @@ -37,7 +37,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/MagneticCylinders1.py b/auto/MiniExamples/scatter2d/MagneticCylinders1.py index d985ca71e0a..9716c153861 100755 --- a/auto/MiniExamples/scatter2d/MagneticCylinders1.py +++ b/auto/MiniExamples/scatter2d/MagneticCylinders1.py @@ -34,7 +34,7 @@ def get_sample(): def get_simulation(sample): n = 11 beam = ba.Beam(1e2, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/MagneticCylinders2.py b/auto/MiniExamples/scatter2d/MagneticCylinders2.py index 756fe97c44e..091ba009a29 100755 --- a/auto/MiniExamples/scatter2d/MagneticCylinders2.py +++ b/auto/MiniExamples/scatter2d/MagneticCylinders2.py @@ -35,7 +35,7 @@ def get_simulation(sample, pol_dir): z_up = R3(0, 0, 1) n = 11 beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) beam.setPolarization(pol_dir) detector.setAnalyzer(z_up) diff --git a/auto/MiniExamples/scatter2d/MagneticSpheres.py b/auto/MiniExamples/scatter2d/MagneticSpheres.py index e2faf59a973..387a5b55202 100755 --- a/auto/MiniExamples/scatter2d/MagneticSpheres.py +++ b/auto/MiniExamples/scatter2d/MagneticSpheres.py @@ -39,7 +39,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e12, 0.1*nm, 0.5*deg) n = 11 - detector = ba.Detector2D(6*deg, 4*deg, n, n, 0, 2*deg) + detector = ba.Detector2Dfw(6*deg, 4*deg, n, n, 0, 2*deg) polarizer_vec = R3(0, 0, 1) analyzer_vec = R3(0, 0, -1) diff --git a/auto/MiniExamples/scatter2d/Mesocrystal.py b/auto/MiniExamples/scatter2d/Mesocrystal.py index b96da66f0a3..770701171dc 100755 --- a/auto/MiniExamples/scatter2d/Mesocrystal.py +++ b/auto/MiniExamples/scatter2d/Mesocrystal.py @@ -52,7 +52,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Mesocrystal2.py b/auto/MiniExamples/scatter2d/Mesocrystal2.py index 11f8811adf0..a0e4cf17aee 100755 --- a/auto/MiniExamples/scatter2d/Mesocrystal2.py +++ b/auto/MiniExamples/scatter2d/Mesocrystal2.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMesoOptions(True, 2.5) return simulation diff --git a/auto/MiniExamples/scatter2d/Mesocrystal3.py b/auto/MiniExamples/scatter2d/Mesocrystal3.py index 75b9151378c..08fd15789c6 100755 --- a/auto/MiniExamples/scatter2d/Mesocrystal3.py +++ b/auto/MiniExamples/scatter2d/Mesocrystal3.py @@ -69,7 +69,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Mesocrystal4.py b/auto/MiniExamples/scatter2d/Mesocrystal4.py index 5bbad52b86f..d1e826a1cc3 100755 --- a/auto/MiniExamples/scatter2d/Mesocrystal4.py +++ b/auto/MiniExamples/scatter2d/Mesocrystal4.py @@ -69,7 +69,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/auto/MiniExamples/scatter2d/ObsoleteSimN.py b/auto/MiniExamples/scatter2d/ObsoleteSimN.py index 0b286f897e0..56a1f2eef9b 100755 --- a/auto/MiniExamples/scatter2d/ObsoleteSimN.py +++ b/auto/MiniExamples/scatter2d/ObsoleteSimN.py @@ -22,7 +22,7 @@ def get_simulation(sample): # Detector n = bp.simargs['n'] - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py b/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py index b0ccbb2af3f..c5eddb217e0 100755 --- a/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py +++ b/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py @@ -37,7 +37,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/PolarizedSANS.py b/auto/MiniExamples/scatter2d/PolarizedSANS.py index 66828bb900b..088a9ad50e8 100755 --- a/auto/MiniExamples/scatter2d/PolarizedSANS.py +++ b/auto/MiniExamples/scatter2d/PolarizedSANS.py @@ -57,7 +57,7 @@ def get_simulation(sample): beam = ba.Beam(1e9, 0.4*nm, 0.001*deg) # Detector opposite to source: - detector = ba.Detector2D(14*deg, 14*deg, n, n, 0, 0) + detector = ba.Detector2Dfw(14*deg, 14*deg, n, n, 0, 0) beam.setPolarization(R3(0, 1, 0)) detector.setAnalyzer(R3(0, -1, 0)) diff --git a/auto/MiniExamples/scatter2d/PolydisperseCylinders.py b/auto/MiniExamples/scatter2d/PolydisperseCylinders.py index 273f1266013..39b7dbd0d91 100755 --- a/auto/MiniExamples/scatter2d/PolydisperseCylinders.py +++ b/auto/MiniExamples/scatter2d/PolydisperseCylinders.py @@ -30,7 +30,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/PositionVariance.py b/auto/MiniExamples/scatter2d/PositionVariance.py index 0a24ee8caff..6a11f58b42c 100755 --- a/auto/MiniExamples/scatter2d/PositionVariance.py +++ b/auto/MiniExamples/scatter2d/PositionVariance.py @@ -45,7 +45,7 @@ def get_sample(hasVariance, xi): def get_simulation(sample): n = 11 beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) - det = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/MiniExamples/scatter2d/RectangularGrating.py b/auto/MiniExamples/scatter2d/RectangularGrating.py index a68ff75d158..4941e61f739 100755 --- a/auto/MiniExamples/scatter2d/RectangularGrating.py +++ b/auto/MiniExamples/scatter2d/RectangularGrating.py @@ -52,7 +52,7 @@ def get_sample(lattice_rotation_angle=0*deg): def get_simulation(sample): beam = ba.Beam(1e8, 0.134*nm, 0.4*deg) n = 11 - detector = ba.Detector2D(1*deg, 0.5*deg, n, n, 0, 0.25*deg) + detector = ba.Detector2Dfw(1*deg, 0.5*deg, n, n, 0, 0.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMonteCarloIntegration(True, 100) return simulation diff --git a/auto/MiniExamples/scatter2d/Resolution.py b/auto/MiniExamples/scatter2d/Resolution.py index 0a4576bd79c..a80e53dd8fd 100755 --- a/auto/MiniExamples/scatter2d/Resolution.py +++ b/auto/MiniExamples/scatter2d/Resolution.py @@ -30,7 +30,7 @@ if __name__ == '__main__': # Detector nx = 7 ny = 11 - detector = ba.Detector2D(3*deg, 3*deg, nx, ny, 0, 1.5*deg) + detector = ba.Detector2Dfw(3*deg, 3*deg, nx, ny, 0, 1.5*deg) results = [] diff --git a/auto/MiniExamples/scatter2d/RotatedPyramids.py b/auto/MiniExamples/scatter2d/RotatedPyramids.py index 77ed0100a44..08c69f39dc4 100755 --- a/auto/MiniExamples/scatter2d/RotatedPyramids.py +++ b/auto/MiniExamples/scatter2d/RotatedPyramids.py @@ -44,7 +44,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/RoughAndSpecular.py b/auto/MiniExamples/scatter2d/RoughAndSpecular.py index f9c1a73cbd2..a394c825711 100755 --- a/auto/MiniExamples/scatter2d/RoughAndSpecular.py +++ b/auto/MiniExamples/scatter2d/RoughAndSpecular.py @@ -32,7 +32,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.4*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, .4*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, .4*deg) detector.setResolutionFunction( ba.ResolutionFunction2DGaussian(0.02*deg, 0.02*deg)) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/scatter2d/SlicedLayer.py b/auto/MiniExamples/scatter2d/SlicedLayer.py index 0ece88e3839..3fb823345bd 100755 --- a/auto/MiniExamples/scatter2d/SlicedLayer.py +++ b/auto/MiniExamples/scatter2d/SlicedLayer.py @@ -40,7 +40,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/auto/MiniExamples/scatter2d/SpheresAtHexLattice.py b/auto/MiniExamples/scatter2d/SpheresAtHexLattice.py index efa41d164ee..b8fc58322d2 100755 --- a/auto/MiniExamples/scatter2d/SpheresAtHexLattice.py +++ b/auto/MiniExamples/scatter2d/SpheresAtHexLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = 11 - detector = ba.Detector2D(2*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(2*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/TriangularRipple.py b/auto/MiniExamples/scatter2d/TriangularRipple.py index 1726da1cbd9..95e144a6b89 100755 --- a/auto/MiniExamples/scatter2d/TriangularRipple.py +++ b/auto/MiniExamples/scatter2d/TriangularRipple.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.16*nm, 0.3*deg) n = 11 - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index 85433a21a07..2a13dc4c3e4 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2716,12 +2716,9 @@ class Detector2D(IDetector): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, *args): - r""" - __init__(Detector2D self, double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, double phi_center, double alpha_center) -> Detector2D - __init__(Detector2D self, size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) -> Detector2D - """ - _libBornAgainDevice.Detector2D_swiginit(self, _libBornAgainDevice.new_Detector2D(*args)) + def __init__(self, n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max): + r"""__init__(Detector2D self, size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) -> Detector2D""" + _libBornAgainDevice.Detector2D_swiginit(self, _libBornAgainDevice.new_Detector2D(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max)) __swig_destroy__ = _libBornAgainDevice.delete_Detector2D def clone(self): @@ -2742,6 +2739,10 @@ class Detector2D(IDetector): # Register Detector2D in _libBornAgainDevice: _libBornAgainDevice.Detector2D_swigregister(Detector2D) + +def Detector2Dfw(phi_span, alpha_span, n_phi, n_alpha, phi_center, alpha_center): + r"""Detector2Dfw(double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, double phi_center, double alpha_center) -> Detector2D""" + return _libBornAgainDevice.Detector2Dfw(phi_span, alpha_span, n_phi, n_alpha, phi_center, alpha_center) class OffspecDetector(libBornAgainParam.INode): r"""Proxy of C++ OffspecDetector class.""" diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index f4558226c0d..4f6672a3e91 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -37031,79 +37031,7 @@ SWIGINTERN PyObject *IDetector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyOb return SWIG_Py_Void(); } -SWIGINTERN PyObject *_wrap_new_Detector2D__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - double arg1 ; - double arg2 ; - size_t arg3 ; - size_t arg4 ; - double arg5 ; - double arg6 ; - double val1 ; - int ecode1 = 0 ; - double val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - double val5 ; - int ecode5 = 0 ; - double val6 ; - int ecode6 = 0 ; - Detector2D *result = 0 ; - - (void)self; - if ((nobjs < 6) || (nobjs > 6)) SWIG_fail; - ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Detector2D" "', argument " "1"" of type '" "double""'"); - } - arg1 = static_cast< double >(val1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Detector2D" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Detector2D" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_Detector2D" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_double(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_Detector2D" "', argument " "5"" of type '" "double""'"); - } - arg5 = static_cast< double >(val5); - ecode6 = SWIG_AsVal_double(swig_obj[5], &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_Detector2D" "', argument " "6"" of type '" "double""'"); - } - arg6 = static_cast< double >(val6); - { - try { - result = (Detector2D *)new Detector2D(arg1,arg2,arg3,arg4,arg5,arg6); - } catch (const std::exception& ex) { - // message shown in the Python interpreter - const std::string msg { - "BornAgain C++ Exception: " + std::string(ex.what()) - }; - SWIG_exception(SWIG_RuntimeError, msg.c_str()); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Detector2D, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Detector2D__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_Detector2D(PyObject *self, PyObject *args) { PyObject *resultobj = 0; size_t arg1 ; double arg2 ; @@ -37123,10 +37051,11 @@ SWIGINTERN PyObject *_wrap_new_Detector2D__SWIG_1(PyObject *self, Py_ssize_t nob int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; + PyObject *swig_obj[6] ; Detector2D *result = 0 ; (void)self; - if ((nobjs < 6) || (nobjs > 6)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_Detector2D", 6, 6, swig_obj)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Detector2D" "', argument " "1"" of type '" "size_t""'"); @@ -37175,104 +37104,6 @@ fail: } -SWIGINTERN PyObject *_wrap_new_Detector2D(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "new_Detector2D", 0, 6, argv))) SWIG_fail; - --argc; - if (argc == 6) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Detector2D__SWIG_1(self, argc, argv); - } - } - } - } - } - } - } - if (argc == 6) { - int _v = 0; - { - int res = SWIG_AsVal_double(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Detector2D__SWIG_0(self, argc, argv); - } - } - } - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_Detector2D'.\n" - " Possible C/C++ prototypes are:\n" - " Detector2D::Detector2D(double,double,size_t,size_t,double,double)\n" - " Detector2D::Detector2D(size_t,double,double,size_t,double,double)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_delete_Detector2D(PyObject *self, PyObject *args) { PyObject *resultobj = 0; Detector2D *arg1 = (Detector2D *) 0 ; @@ -37470,6 +37301,79 @@ SWIGINTERN PyObject *Detector2D_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObjec return SWIG_Python_InitShadowInstance(args); } +SWIGINTERN PyObject *_wrap_Detector2Dfw(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + double arg1 ; + double arg2 ; + size_t arg3 ; + size_t arg4 ; + double arg5 ; + double arg6 ; + double val1 ; + int ecode1 = 0 ; + double val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + double val5 ; + int ecode5 = 0 ; + double val6 ; + int ecode6 = 0 ; + PyObject *swig_obj[6] ; + Detector2D *result = 0 ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "Detector2Dfw", 6, 6, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Detector2Dfw" "', argument " "1"" of type '" "double""'"); + } + arg1 = static_cast< double >(val1); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Detector2Dfw" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Detector2Dfw" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Detector2Dfw" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + ecode5 = SWIG_AsVal_double(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Detector2Dfw" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_double(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Detector2Dfw" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + { + try { + result = (Detector2D *)Detector2Dfw(arg1,arg2,SWIG_STD_MOVE(arg3),SWIG_STD_MOVE(arg4),arg5,arg6); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Detector2D, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_new_OffspecDetector__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; size_t arg1 ; @@ -44762,10 +44666,7 @@ static PyMethodDef SwigMethods[] = { { "IDetector_setRegionOfInterest", _wrap_IDetector_setRegionOfInterest, METH_VARARGS, "IDetector_setRegionOfInterest(IDetector self, double xlow, double ylow, double xup, double yup)"}, { "IDetector_clippedFrame", _wrap_IDetector_clippedFrame, METH_O, "IDetector_clippedFrame(IDetector self) -> Frame"}, { "IDetector_swigregister", IDetector_swigregister, METH_O, NULL}, - { "new_Detector2D", _wrap_new_Detector2D, METH_VARARGS, "\n" - "Detector2D(double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, double phi_center, double alpha_center)\n" - "new_Detector2D(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) -> Detector2D\n" - ""}, + { "new_Detector2D", _wrap_new_Detector2D, METH_VARARGS, "new_Detector2D(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) -> Detector2D"}, { "delete_Detector2D", _wrap_delete_Detector2D, METH_O, "delete_Detector2D(Detector2D self)"}, { "Detector2D_clone", _wrap_Detector2D_clone, METH_O, "Detector2D_clone(Detector2D self) -> Detector2D"}, { "Detector2D_className", _wrap_Detector2D_className, METH_O, "Detector2D_className(Detector2D self) -> std::string"}, @@ -44773,6 +44674,7 @@ static PyMethodDef SwigMethods[] = { { "Detector2D_indexOfSpecular", _wrap_Detector2D_indexOfSpecular, METH_VARARGS, "Detector2D_indexOfSpecular(Detector2D self, Beam beam) -> size_t"}, { "Detector2D_swigregister", Detector2D_swigregister, METH_O, NULL}, { "Detector2D_swiginit", Detector2D_swiginit, METH_VARARGS, NULL}, + { "Detector2Dfw", _wrap_Detector2Dfw, METH_VARARGS, "Detector2Dfw(double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, double phi_center, double alpha_center) -> Detector2D"}, { "new_OffspecDetector", _wrap_new_OffspecDetector, METH_VARARGS, "\n" "OffspecDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max)\n" "new_OffspecDetector(OffspecDetector other) -> OffspecDetector\n" diff --git a/rawEx/fit/scatter2d/consecutive_fitting.py b/rawEx/fit/scatter2d/consecutive_fitting.py index 87e4363c163..ac3ef2c3b80 100755 --- a/rawEx/fit/scatter2d/consecutive_fitting.py +++ b/rawEx/fit/scatter2d/consecutive_fitting.py @@ -45,7 +45,7 @@ def get_simulation(P): """ beam = ba.Beam(1e8, 1*angstrom, 0.2*deg) n = 100 # bp.simargs['n'] - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/rawEx/fit/scatter2d/expfit_galaxi.py b/rawEx/fit/scatter2d/expfit_galaxi.py index d08afe016ed..b85db72663b 100755 --- a/rawEx/fit/scatter2d/expfit_galaxi.py +++ b/rawEx/fit/scatter2d/expfit_galaxi.py @@ -96,7 +96,7 @@ def create_detector(beam): """ nx = pilatus_npx ny = pilatus_npy - return ba.Detector2D(3.4*deg, 1.84*deg, nx, ny, 0, 0.32*deg) + return ba.Detector2Dfw(3.4*deg, 1.84*deg, nx, ny, 0, 0.32*deg) def create_simulation(P): diff --git a/rawEx/fit/scatter2d/fit2d.py b/rawEx/fit/scatter2d/fit2d.py index e51a4d94b84..66ea75bcdb7 100755 --- a/rawEx/fit/scatter2d/fit2d.py +++ b/rawEx/fit/scatter2d/fit2d.py @@ -22,7 +22,7 @@ def get_simulation(P): n = <%= sm ? 11 : 100 %> beam = ba.Beam(1, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/fit/scatter2d/gisas_model1.py b/rawEx/fit/scatter2d/gisas_model1.py index 2afa24fd65c..0c2680a1475 100644 --- a/rawEx/fit/scatter2d/gisas_model1.py +++ b/rawEx/fit/scatter2d/gisas_model1.py @@ -33,7 +33,7 @@ def get_sample(P): def get_simulation(P): beam = ba.Beam(10**P['lg(intensity)'], 0.1*nm, 0.2*deg) n = 100 # bp.simargs['n'] - det = ba.Detector2D(3*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(3*deg, 3*deg, n, n, 0, 1.5*deg) sample = get_sample(P) simulation = ba.ScatteringSimulation(beam, sample, det) diff --git a/rawEx/fit/scatter2d/minimizer_settings.py b/rawEx/fit/scatter2d/minimizer_settings.py index e6e852eec1b..88afe8c5b3f 100755 --- a/rawEx/fit/scatter2d/minimizer_settings.py +++ b/rawEx/fit/scatter2d/minimizer_settings.py @@ -47,7 +47,7 @@ def get_simulation(P): """ beam = ba.Beam(1e8, 1*angstrom, 0.2*deg) n = 100 # bp.simargs['n'] - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/rawEx/fit/scatter2d/model1_cylinders.py b/rawEx/fit/scatter2d/model1_cylinders.py index bc7ca07dac7..6bc702ec01b 100644 --- a/rawEx/fit/scatter2d/model1_cylinders.py +++ b/rawEx/fit/scatter2d/model1_cylinders.py @@ -37,7 +37,7 @@ def get_simulation(P): n = <%= sm ? 11 : 100 %> beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) sample = get_sample(P) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/fit/scatter2d/model2_hexlattice.py b/rawEx/fit/scatter2d/model2_hexlattice.py index 9b1c49fbc43..3f62e593a11 100644 --- a/rawEx/fit/scatter2d/model2_hexlattice.py +++ b/rawEx/fit/scatter2d/model2_hexlattice.py @@ -41,7 +41,7 @@ def get_simulation(P): """ n = <%= sm ? 11 : 100 %> beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) sample = get_sample(P) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/fit/scatter2d/multiple_datasets.py b/rawEx/fit/scatter2d/multiple_datasets.py index c36fd9fbb18..2e094ecd996 100755 --- a/rawEx/fit/scatter2d/multiple_datasets.py +++ b/rawEx/fit/scatter2d/multiple_datasets.py @@ -45,7 +45,7 @@ def get_simulation(P): beam = ba.Beam(1e8, 0.1*nm, incident_angle) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(3*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(3*deg, 2*deg, n, n, 0, 1*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/rawEx/offspec/OffspecResolved.py b/rawEx/offspec/OffspecResolved.py index 694a6c7057d..6cf20b17bd5 100755 --- a/rawEx/offspec/OffspecResolved.py +++ b/rawEx/offspec/OffspecResolved.py @@ -44,7 +44,7 @@ def get_sample(): def simulate(sample): beam = ba.Beam(1e9, 0.1 * nm, 1.0 * deg) - detector = ba.Detector2D(4*deg, 0.06*deg, 501, 1, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 0.06*deg, 501, 1, 0, 1*deg) sim = ba.ScatteringSimulation(beam, sample, detector) return sim.simulate().flat() diff --git a/rawEx/scatter2d/ApproximationDA.py b/rawEx/scatter2d/ApproximationDA.py index aa52dbd3bf1..9bd3541b7f9 100755 --- a/rawEx/scatter2d/ApproximationDA.py +++ b/rawEx/scatter2d/ApproximationDA.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/ApproximationLMA.py b/rawEx/scatter2d/ApproximationLMA.py index db63ca2aff5..a0a68f6abd1 100755 --- a/rawEx/scatter2d/ApproximationLMA.py +++ b/rawEx/scatter2d/ApproximationLMA.py @@ -60,7 +60,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/ApproximationSSCA.py b/rawEx/scatter2d/ApproximationSSCA.py index 9e497c70d3c..3793a94269a 100755 --- a/rawEx/scatter2d/ApproximationSSCA.py +++ b/rawEx/scatter2d/ApproximationSSCA.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/BeamDivergence.py b/rawEx/scatter2d/BeamDivergence.py index 8546aab8b1d..394e17555a0 100755 --- a/rawEx/scatter2d/BeamDivergence.py +++ b/rawEx/scatter2d/BeamDivergence.py @@ -14,7 +14,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) distr_1 = ba.DistributionLogNormal(0.1*nm, 0.1, 5, 2) simulation.addParameterDistribution( diff --git a/rawEx/scatter2d/BiMaterialCylinders.py b/rawEx/scatter2d/BiMaterialCylinders.py index c95a7a5ff1f..d0c586a343f 100755 --- a/rawEx/scatter2d/BiMaterialCylinders.py +++ b/rawEx/scatter2d/BiMaterialCylinders.py @@ -57,7 +57,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/BoxesWithSpecularPeak.py b/rawEx/scatter2d/BoxesWithSpecularPeak.py index cbd6d53dbda..aaaf9f262fa 100755 --- a/rawEx/scatter2d/BoxesWithSpecularPeak.py +++ b/rawEx/scatter2d/BoxesWithSpecularPeak.py @@ -48,7 +48,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 101 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) simulation.options().setIncludeSpecular(True) diff --git a/rawEx/scatter2d/BroadSpecular.py b/rawEx/scatter2d/BroadSpecular.py index 51f68a7ac38..36365ce364f 100755 --- a/rawEx/scatter2d/BroadSpecular.py +++ b/rawEx/scatter2d/BroadSpecular.py @@ -22,7 +22,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.5*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(1*deg, 1*deg, n, n, 0, 0.5 * deg) + detector = ba.Detector2Dfw(1*deg, 1*deg, n, n, 0, 0.5 * deg) detector.setResolutionFunction( ba.ResolutionFunction2DGaussian(0.04*deg, 0.03*deg)) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/scatter2d/ConstantBackground.py b/rawEx/scatter2d/ConstantBackground.py index 0d2490ba205..fc831b4d05f 100755 --- a/rawEx/scatter2d/ConstantBackground.py +++ b/rawEx/scatter2d/ConstantBackground.py @@ -14,7 +14,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e6, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) background = ba.ConstantBackground(1e3) simulation.setBackground(background) diff --git a/rawEx/scatter2d/CoreShellNanoparticles.py b/rawEx/scatter2d/CoreShellNanoparticles.py index 3e9b21d1b05..33206a34d4e 100755 --- a/rawEx/scatter2d/CoreShellNanoparticles.py +++ b/rawEx/scatter2d/CoreShellNanoparticles.py @@ -30,7 +30,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CoreShellNanoparticles2.py b/rawEx/scatter2d/CoreShellNanoparticles2.py index e6b9df99337..08c16bb0c6e 100755 --- a/rawEx/scatter2d/CoreShellNanoparticles2.py +++ b/rawEx/scatter2d/CoreShellNanoparticles2.py @@ -33,7 +33,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CorrelatedRoughness.py b/rawEx/scatter2d/CorrelatedRoughness.py index 3262175f219..86097a30168 100755 --- a/rawEx/scatter2d/CorrelatedRoughness.py +++ b/rawEx/scatter2d/CorrelatedRoughness.py @@ -44,7 +44,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(5e11, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(1*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(1*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CosineRipplesAtRectLattice.py b/rawEx/scatter2d/CosineRipplesAtRectLattice.py index 511d142e6f6..5e073e4b5d8 100755 --- a/rawEx/scatter2d/CosineRipplesAtRectLattice.py +++ b/rawEx/scatter2d/CosineRipplesAtRectLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.16*nm, 0.3*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(3*deg, 2.5*deg, n, n, 0, 1.25*deg) + detector = ba.Detector2Dfw(3*deg, 2.5*deg, n, n, 0, 1.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CustomFormFactor.py b/rawEx/scatter2d/CustomFormFactor.py index 50bbdf2f92f..b033f530d98 100755 --- a/rawEx/scatter2d/CustomFormFactor.py +++ b/rawEx/scatter2d/CustomFormFactor.py @@ -76,7 +76,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 1*angstrom, 0.2*deg) n = <%= sm ? 11 : 100 %> - det = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + det = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setNumberOfThreads( 1) # deactivate multithreading (why?) diff --git a/rawEx/scatter2d/Cylinders.py b/rawEx/scatter2d/Cylinders.py index ce0eb52ff92..23416e8d68d 100755 --- a/rawEx/scatter2d/Cylinders.py +++ b/rawEx/scatter2d/Cylinders.py @@ -22,7 +22,7 @@ def get_simulation(sample): # Detector n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/scatter2d/CylindersAndPrisms.py b/rawEx/scatter2d/CylindersAndPrisms.py index 24deabeb390..caa06fbbc0b 100755 --- a/rawEx/scatter2d/CylindersAndPrisms.py +++ b/rawEx/scatter2d/CylindersAndPrisms.py @@ -45,7 +45,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CylindersInAverageLayer.py b/rawEx/scatter2d/CylindersInAverageLayer.py index 86809867683..a31551b82db 100755 --- a/rawEx/scatter2d/CylindersInAverageLayer.py +++ b/rawEx/scatter2d/CylindersInAverageLayer.py @@ -44,7 +44,7 @@ def get_sample(cyl_height=5*nm): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/rawEx/scatter2d/CylindersInBA.py b/rawEx/scatter2d/CylindersInBA.py index 9c14bf97c81..5a9d1b5afdb 100755 --- a/rawEx/scatter2d/CylindersInBA.py +++ b/rawEx/scatter2d/CylindersInBA.py @@ -41,7 +41,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/DodecahedraSAS.py b/rawEx/scatter2d/DodecahedraSAS.py index 18a17f001d4..fcb2cd12644 100755 --- a/rawEx/scatter2d/DodecahedraSAS.py +++ b/rawEx/scatter2d/DodecahedraSAS.py @@ -33,7 +33,7 @@ def get_simulation(sample): # Detector opposite to source: n = <%= sm ? 11 : 200 %> # number of pixels per direction - detector = ba.Detector2D(10*deg, 10*deg, n, n, 0, 0) + detector = ba.Detector2Dfw(10*deg, 10*deg, n, n, 0, 0) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/scatter2d/FindPeaks.py b/rawEx/scatter2d/FindPeaks.py index c349048b1d5..7390a5c28a4 100755 --- a/rawEx/scatter2d/FindPeaks.py +++ b/rawEx/scatter2d/FindPeaks.py @@ -53,7 +53,7 @@ def get_sample(lattice_rotation_angle=0*deg): def get_simulation(sample): beam = ba.Beam(1e8, 1.34*angstrom, 0.4*deg) n = <%= sm ? 11 : 401 %> - detector = ba.Detector2D(1*deg, 0.5*deg, n, n, 0, 0.25*deg) + detector = ba.Detector2Dfw(1*deg, 0.5*deg, n, n, 0, 0.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMonteCarloIntegration(True, 100) return simulation diff --git a/rawEx/scatter2d/HalfSpheresInAverageTopLayer.py b/rawEx/scatter2d/HalfSpheresInAverageTopLayer.py index 1fad3a771b4..d989fb997d6 100755 --- a/rawEx/scatter2d/HalfSpheresInAverageTopLayer.py +++ b/rawEx/scatter2d/HalfSpheresInAverageTopLayer.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/rawEx/scatter2d/HexagonalLatticesWithBasis.py b/rawEx/scatter2d/HexagonalLatticesWithBasis.py index 287ffefe395..7878f40633f 100755 --- a/rawEx/scatter2d/HexagonalLatticesWithBasis.py +++ b/rawEx/scatter2d/HexagonalLatticesWithBasis.py @@ -62,7 +62,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(2*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(2*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference1DLattice.py b/rawEx/scatter2d/Interference1DLattice.py index db3e2b63c86..409415410a9 100755 --- a/rawEx/scatter2d/Interference1DLattice.py +++ b/rawEx/scatter2d/Interference1DLattice.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 1*angstrom, 0.2*deg) n = <%= sm ? 11 : 100 %> - det = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + det = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setMonteCarloIntegration(True, 100) if not "__no_terminal__" in globals(): diff --git a/rawEx/scatter2d/Interference1DRadialParacrystal.py b/rawEx/scatter2d/Interference1DRadialParacrystal.py index 8ebb4375e41..94cf0014184 100755 --- a/rawEx/scatter2d/Interference1DRadialParacrystal.py +++ b/rawEx/scatter2d/Interference1DRadialParacrystal.py @@ -48,7 +48,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference2DCenteredSquareLattice.py b/rawEx/scatter2d/Interference2DCenteredSquareLattice.py index da9015b24a7..7da4506446a 100755 --- a/rawEx/scatter2d/Interference2DCenteredSquareLattice.py +++ b/rawEx/scatter2d/Interference2DCenteredSquareLattice.py @@ -61,7 +61,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference2DParacrystal.py b/rawEx/scatter2d/Interference2DParacrystal.py index 54f29df97c7..5b856c3b490 100755 --- a/rawEx/scatter2d/Interference2DParacrystal.py +++ b/rawEx/scatter2d/Interference2DParacrystal.py @@ -54,7 +54,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference2DRotatedSquareLattice.py b/rawEx/scatter2d/Interference2DRotatedSquareLattice.py index e9a80a442db..cdf1f70b255 100755 --- a/rawEx/scatter2d/Interference2DRotatedSquareLattice.py +++ b/rawEx/scatter2d/Interference2DRotatedSquareLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference2DSquareFiniteLattice.py b/rawEx/scatter2d/Interference2DSquareFiniteLattice.py index 0085a772054..10f5920cfe2 100755 --- a/rawEx/scatter2d/Interference2DSquareFiniteLattice.py +++ b/rawEx/scatter2d/Interference2DSquareFiniteLattice.py @@ -51,7 +51,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/LargeParticlesFormFactor.py b/rawEx/scatter2d/LargeParticlesFormFactor.py index 73d5b3e4d7e..54799d0cac5 100755 --- a/rawEx/scatter2d/LargeParticlesFormFactor.py +++ b/rawEx/scatter2d/LargeParticlesFormFactor.py @@ -46,7 +46,7 @@ def get_simulation(sample, integration_flag): """ beam = ba.Beam(1, 1*angstrom, 0.2*deg) n = <%= sm ? 11 : 201 %> - det = ba.Detector2D(3*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(3*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, det) simulation.options().setMonteCarloIntegration(integration_flag, 50) if not "__no_terminal__" in globals(): diff --git a/rawEx/scatter2d/LatticeOrientationDistribution.py b/rawEx/scatter2d/LatticeOrientationDistribution.py index 03c6f50fc13..93588af4fd2 100755 --- a/rawEx/scatter2d/LatticeOrientationDistribution.py +++ b/rawEx/scatter2d/LatticeOrientationDistribution.py @@ -37,7 +37,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/MagneticCylinders1.py b/rawEx/scatter2d/MagneticCylinders1.py index 760ce6f4ca4..5d755a84dbc 100755 --- a/rawEx/scatter2d/MagneticCylinders1.py +++ b/rawEx/scatter2d/MagneticCylinders1.py @@ -34,7 +34,7 @@ def get_sample(): def get_simulation(sample): n = <%= sm ? 11 : 100 %> beam = ba.Beam(1e2, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 1*deg, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 1*deg, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/MagneticCylinders2.py b/rawEx/scatter2d/MagneticCylinders2.py index c37f9ecfcb6..99b672d75a1 100755 --- a/rawEx/scatter2d/MagneticCylinders2.py +++ b/rawEx/scatter2d/MagneticCylinders2.py @@ -35,7 +35,7 @@ def get_simulation(sample, pol_dir): z_up = R3(0, 0, 1) n = <%= sm ? 11 : 100 %> beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) beam.setPolarization(pol_dir) detector.setAnalyzer(z_up) diff --git a/rawEx/scatter2d/MagneticSpheres.py b/rawEx/scatter2d/MagneticSpheres.py index f41f70b9910..ba28e02b4bf 100755 --- a/rawEx/scatter2d/MagneticSpheres.py +++ b/rawEx/scatter2d/MagneticSpheres.py @@ -39,7 +39,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e12, 0.1*nm, 0.5*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(6*deg, 4*deg, n, n, 0, 2*deg) + detector = ba.Detector2Dfw(6*deg, 4*deg, n, n, 0, 2*deg) polarizer_vec = R3(0, 0, 1) analyzer_vec = R3(0, 0, -1) diff --git a/rawEx/scatter2d/Mesocrystal.py b/rawEx/scatter2d/Mesocrystal.py index 30d8e64316a..427ba2153a0 100755 --- a/rawEx/scatter2d/Mesocrystal.py +++ b/rawEx/scatter2d/Mesocrystal.py @@ -52,7 +52,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Mesocrystal2.py b/rawEx/scatter2d/Mesocrystal2.py index 19f3435e37f..75632fcd55f 100755 --- a/rawEx/scatter2d/Mesocrystal2.py +++ b/rawEx/scatter2d/Mesocrystal2.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMesoOptions(True, 2.5) return simulation diff --git a/rawEx/scatter2d/Mesocrystal3.py b/rawEx/scatter2d/Mesocrystal3.py index c8e3176485c..82079860041 100755 --- a/rawEx/scatter2d/Mesocrystal3.py +++ b/rawEx/scatter2d/Mesocrystal3.py @@ -69,7 +69,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Mesocrystal4.py b/rawEx/scatter2d/Mesocrystal4.py index 7eb68df7fe8..b257ba05f4a 100755 --- a/rawEx/scatter2d/Mesocrystal4.py +++ b/rawEx/scatter2d/Mesocrystal4.py @@ -69,7 +69,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/rawEx/scatter2d/ObsoleteSimN.py b/rawEx/scatter2d/ObsoleteSimN.py index 0b286f897e0..56a1f2eef9b 100755 --- a/rawEx/scatter2d/ObsoleteSimN.py +++ b/rawEx/scatter2d/ObsoleteSimN.py @@ -22,7 +22,7 @@ def get_simulation(sample): # Detector n = bp.simargs['n'] - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/scatter2d/ParticleAcrossInterface.py b/rawEx/scatter2d/ParticleAcrossInterface.py index 718ab903fd4..379694cdff3 100755 --- a/rawEx/scatter2d/ParticleAcrossInterface.py +++ b/rawEx/scatter2d/ParticleAcrossInterface.py @@ -37,7 +37,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/PolarizedSANS.py b/rawEx/scatter2d/PolarizedSANS.py index d6e06ddbcef..919246ad83a 100755 --- a/rawEx/scatter2d/PolarizedSANS.py +++ b/rawEx/scatter2d/PolarizedSANS.py @@ -57,7 +57,7 @@ def get_simulation(sample): beam = ba.Beam(1e9, 0.4*nm, 0.001*deg) # Detector opposite to source: - detector = ba.Detector2D(14*deg, 14*deg, n, n, 0, 0) + detector = ba.Detector2Dfw(14*deg, 14*deg, n, n, 0, 0) beam.setPolarization(R3(0, 1, 0)) detector.setAnalyzer(R3(0, -1, 0)) diff --git a/rawEx/scatter2d/PolydisperseCylinders.py b/rawEx/scatter2d/PolydisperseCylinders.py index 7d7401de31c..1bc60021a8e 100755 --- a/rawEx/scatter2d/PolydisperseCylinders.py +++ b/rawEx/scatter2d/PolydisperseCylinders.py @@ -30,7 +30,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(2*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(2*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/PositionVariance.py b/rawEx/scatter2d/PositionVariance.py index c3a381ffb3a..84714d108a0 100755 --- a/rawEx/scatter2d/PositionVariance.py +++ b/rawEx/scatter2d/PositionVariance.py @@ -45,7 +45,7 @@ def get_sample(hasVariance, xi): def get_simulation(sample): n = <%= sm ? 11 : 200 %> beam = ba.Beam(1e8, 0.1*nm, 0.2*deg) - det = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + det = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) return ba.ScatteringSimulation(beam, sample, det) diff --git a/rawEx/scatter2d/RectangularGrating.py b/rawEx/scatter2d/RectangularGrating.py index f570fa2bc9f..3e42aa04818 100755 --- a/rawEx/scatter2d/RectangularGrating.py +++ b/rawEx/scatter2d/RectangularGrating.py @@ -52,7 +52,7 @@ def get_sample(lattice_rotation_angle=0*deg): def get_simulation(sample): beam = ba.Beam(1e8, 0.134*nm, 0.4*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(1*deg, 0.5*deg, n, n, 0, 0.25*deg) + detector = ba.Detector2Dfw(1*deg, 0.5*deg, n, n, 0, 0.25*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setMonteCarloIntegration(True, 100) return simulation diff --git a/rawEx/scatter2d/Resolution.py b/rawEx/scatter2d/Resolution.py index ef3fa919913..d6779c8e3f3 100755 --- a/rawEx/scatter2d/Resolution.py +++ b/rawEx/scatter2d/Resolution.py @@ -30,7 +30,7 @@ if __name__ == '__main__': # Detector nx = <%= sm ? 7 : 142 %> ny = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(3*deg, 3*deg, nx, ny, 0, 1.5*deg) + detector = ba.Detector2Dfw(3*deg, 3*deg, nx, ny, 0, 1.5*deg) results = [] diff --git a/rawEx/scatter2d/RotatedPyramids.py b/rawEx/scatter2d/RotatedPyramids.py index 256fbcc1ef6..979a8710563 100755 --- a/rawEx/scatter2d/RotatedPyramids.py +++ b/rawEx/scatter2d/RotatedPyramids.py @@ -44,7 +44,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/RoughAndSpecular.py b/rawEx/scatter2d/RoughAndSpecular.py index 4b2b1b41dc6..16f29001154 100755 --- a/rawEx/scatter2d/RoughAndSpecular.py +++ b/rawEx/scatter2d/RoughAndSpecular.py @@ -32,7 +32,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.4*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, .4*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, .4*deg) detector.setResolutionFunction( ba.ResolutionFunction2DGaussian(0.02*deg, 0.02*deg)) simulation = ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/scatter2d/SlicedLayer.py b/rawEx/scatter2d/SlicedLayer.py index e13fc40fe4b..ddf74af638e 100755 --- a/rawEx/scatter2d/SlicedLayer.py +++ b/rawEx/scatter2d/SlicedLayer.py @@ -40,7 +40,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 100 %> - detector = ba.Detector2D(4*deg, 2*deg, n, n, 0, 1*deg) + detector = ba.Detector2Dfw(4*deg, 2*deg, n, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) return simulation diff --git a/rawEx/scatter2d/SpheresAtHexLattice.py b/rawEx/scatter2d/SpheresAtHexLattice.py index 41db2b31ad1..0a9ac098e8a 100755 --- a/rawEx/scatter2d/SpheresAtHexLattice.py +++ b/rawEx/scatter2d/SpheresAtHexLattice.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.1*nm, 0.2*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(2*deg, 1*deg, n, n, 0, 0.5*deg) + detector = ba.Detector2Dfw(2*deg, 1*deg, n, n, 0, 0.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/TriangularRipple.py b/rawEx/scatter2d/TriangularRipple.py index 191297493e5..be7f8eaaf29 100755 --- a/rawEx/scatter2d/TriangularRipple.py +++ b/rawEx/scatter2d/TriangularRipple.py @@ -53,7 +53,7 @@ def get_sample(): def get_simulation(sample): beam = ba.Beam(1e9, 0.16*nm, 0.3*deg) n = <%= sm ? 11 : 200 %> - detector = ba.Detector2D(4*deg, 3*deg, n, n, 0, 1.5*deg) + detector = ba.Detector2Dfw(4*deg, 3*deg, n, n, 0, 1.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation -- GitLab