From 7c498aaeeef8194fe446c712f6f38964b39af07e Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Fri, 1 Dec 2023 09:40:43 +0100 Subject: [PATCH] Old|NewDetec2D replace Detector2D --- Device/Detector/Detector2D.cpp | 46 +- Device/Detector/Detector2D.h | 29 +- Device/Detector/IDetector.h | 2 +- Device/Detector/SphericalDetector.cpp | 2 +- GUI/Model/Detector/DetectorItem.cpp | 2 +- Sim/Export/SimulationToPython.cpp | 4 +- Tests/Functional/Fitting/FitTests.cpp | 2 +- Tests/Py/Fit/fitobjective_api.py | 2 +- Tests/Py/Functional/PyFuTestInfrastructure.py | 4 +- Tests/SimFactory/MakeSimulations.cpp | 26 +- Tests/Unit/Device/Detector2DTest.cpp | 22 +- Tests/Unit/Device/RegionOfInterestTest.cpp | 8 +- Tests/Unit/Sim/FittingTestHelper.h | 2 +- Wrap/Python/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/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/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/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 +- .../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/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 +- auto/MiniExamples/scatter2d/SlicedLayer.py | 2 +- .../scatter2d/SpheresAtHexLattice.py | 2 +- .../scatter2d/TriangularRipple.py | 2 +- auto/Wrap/libBornAgainDevice.py | 64 +- auto/Wrap/libBornAgainDevice_wrap.cpp | 649 +++++++++++------- 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/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/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/SlicedLayer.py | 2 +- rawEx/scatter2d/SpheresAtHexLattice.py | 2 +- rawEx/scatter2d/TriangularRipple.py | 2 +- 178 files changed, 691 insertions(+), 499 deletions(-) diff --git a/Device/Detector/Detector2D.cpp b/Device/Detector/Detector2D.cpp index f7f0d622e7f..2f70115a63f 100644 --- a/Device/Detector/Detector2D.cpp +++ b/Device/Detector/Detector2D.cpp @@ -24,7 +24,7 @@ using std::numbers::pi; -Detector2D::Detector2D(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, +OldDetec2D::OldDetec2D(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) : IDetector(new Frame(newEquiDivision("phi_f (rad)", n_phi, phi_min, phi_max), newEquiDivision("alpha_f (rad)", n_alpha, alpha_min, alpha_max))) @@ -35,7 +35,41 @@ Detector2D::Detector2D(size_t n_phi, double phi_min, double phi_max, size_t n_al ASSERT(-pi / 2 < alpha_max && alpha_max < +pi / 2); } -Detector2D::Detector2D(double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, +OldDetec2D* OldDetec2D::clone() const +{ + return new OldDetec2D(*this); +} + +Pixel* OldDetec2D::createPixel(size_t index) const +{ + const size_t ix = axisBinIndex(index, 0); + const size_t iy = axisBinIndex(index, 1); + + const Bin1D& phi_in = axis(0).bin(ix); + const Bin1D phi_out = Bin1D::FromTo(atan(phi_in.min()), atan(phi_in.max())); + + const double ru = hypot(1., pow(phi_in.center(), 2)); + const Bin1D& alpha_in = axis(1).bin(iy); + const Bin1D alpha_out = Bin1D::FromTo(atan(alpha_in.min() / ru), atan(alpha_in.max() / ru)); + + return new Pixel(phi_out, alpha_out); +} + +size_t OldDetec2D::indexOfSpecular(const Beam& beam) const +{ + const double alpha = beam.alpha_i(); + const double phi = beam.phi_i(); + + const double u = tan(phi); + const double v = hypot(1., u * u) * tan(alpha); + + if (axis(0).rangeComprises(u) && axis(1).rangeComprises(v)) + return getGlobalIndex(axis(0).closestIndex(u), axis(1).closestIndex(v)); + return totalSize(); +} + + +NewDetec2D::NewDetec2D(double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, double center_phi, double center_alpha) : IDetector( new Frame(newEquiDivision("phi_f (rad)", n_phi, center_phi - phi_full_width / 2, @@ -47,12 +81,12 @@ Detector2D::Detector2D(double phi_full_width, double alpha_full_width, size_t n_ ASSERT(-pi / 2 < axis(1).min() && axis(1).max() < +pi / 2); } -Detector2D* Detector2D::clone() const +NewDetec2D* NewDetec2D::clone() const { - return new Detector2D(*this); + return new NewDetec2D(*this); } -Pixel* Detector2D::createPixel(size_t index) const +Pixel* NewDetec2D::createPixel(size_t index) const { const size_t ix = axisBinIndex(index, 0); const size_t iy = axisBinIndex(index, 1); @@ -67,7 +101,7 @@ Pixel* Detector2D::createPixel(size_t index) const return new Pixel(phi_out, alpha_out); } -size_t Detector2D::indexOfSpecular(const Beam& beam) const +size_t NewDetec2D::indexOfSpecular(const Beam& beam) const { const double alpha = beam.alpha_i(); const double phi = beam.phi_i(); diff --git a/Device/Detector/Detector2D.h b/Device/Detector/Detector2D.h index f20e5035de0..855fe4dcac2 100644 --- a/Device/Detector/Detector2D.h +++ b/Device/Detector/Detector2D.h @@ -22,17 +22,34 @@ class Pixel; //! A flat detector with equidistant pixels and cached true scattering angles along the phi and //! alpha axes. -class Detector2D : public IDetector { +class OldDetec2D : public IDetector { public: - Detector2D(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, + OldDetec2D(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max); - Detector2D(double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, + + ~OldDetec2D() override = default; + + OldDetec2D* clone() const override; + std::string className() const override { return "OldDetec2D"; } + + //! Creates an Pixel for the given Datafield object and index + Pixel* createPixel(size_t index) const override; + + //! Returns index of pixel that contains the specular wavevector. + //! If no pixel contains this specular wavevector, the number of pixels is + //! returned. This corresponds to an overflow index. + size_t indexOfSpecular(const Beam& beam) const override; +}; + +class NewDetec2D : public IDetector { +public: + NewDetec2D(double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, double center_phi, double center_alpha); - ~Detector2D() override = default; + ~NewDetec2D() override = default; - Detector2D* clone() const override; - std::string className() const override { return "Detector2D"; } + NewDetec2D* clone() const override; + std::string className() const override { return "NewDetec2D"; } //! Creates an Pixel for the given Datafield object and index Pixel* createPixel(size_t index) const override; diff --git a/Device/Detector/IDetector.h b/Device/Detector/IDetector.h index 22e137ee3b6..5667a9f06ee 100644 --- a/Device/Detector/IDetector.h +++ b/Device/Detector/IDetector.h @@ -29,7 +29,7 @@ class Pixel; class Scale; struct RoiOfAxis; -//! Abstract base for 2D detectors, realized by Detector2D. +//! Abstract base for 2D detectors, realized by OldDetec2D. //! //! Handles also "region of interest" (ROI). In general, the ROI is the whole //! detector, and all methods related to ROI work on the whole detector. diff --git a/Device/Detector/SphericalDetector.cpp b/Device/Detector/SphericalDetector.cpp index 1ca703021df..5a6590ec2e5 100644 --- a/Device/Detector/SphericalDetector.cpp +++ b/Device/Detector/SphericalDetector.cpp @@ -26,7 +26,7 @@ SphericalDetector::SphericalDetector(size_t n_phi, double phi_min, double phi_ma : IDetector(new Frame(newEquiDivision("phi_f (rad)", n_phi, phi_min, phi_max), newEquiDivision("alpha_f (rad)", n_alpha, alpha_min, alpha_max))) { - throw std::runtime_error("In BornAgain 22, SphericalDetector has been replaced by Detector2D"); + throw std::runtime_error("In BornAgain 22, SphericalDetector has been replaced by OldDetec2D"); } SphericalDetector::SphericalDetector(size_t n_bin, double width, double phi, double alpha) diff --git a/GUI/Model/Detector/DetectorItem.cpp b/GUI/Model/Detector/DetectorItem.cpp index b770e55dfd8..f328138cf94 100644 --- a/GUI/Model/Detector/DetectorItem.cpp +++ b/GUI/Model/Detector/DetectorItem.cpp @@ -64,7 +64,7 @@ std::unique_ptr<IDetector> DetectorItem::createDetector() const const double y_min = Units::deg2rad(m_alphaAxis.min()); const double y_max = Units::deg2rad(m_alphaAxis.max()); - auto result = std::make_unique<Detector2D>(n_x, x_min, x_max, n_y, y_min, y_max); + auto result = std::make_unique<OldDetec2D>(n_x, x_min, x_max, n_y, y_min, y_max); if (m_maskContainerItem) { const QVector<MaskItem*> maskItems = m_maskContainerItem->maskItems(); diff --git a/Sim/Export/SimulationToPython.cpp b/Sim/Export/SimulationToPython.cpp index 748b7f2f7ea..b814c0eace7 100644 --- a/Sim/Export/SimulationToPython.cpp +++ b/Sim/Export/SimulationToPython.cpp @@ -113,9 +113,9 @@ std::string defineDetector(const IDetector& detector) std::function<std::string(double)> printFunc = Py::Fmt::printDouble; - if (const auto* const det = dynamic_cast<const Detector2D*>(&detector)) { + if (const auto* const det = dynamic_cast<const OldDetec2D*>(&detector)) { result << "\n"; - result << indent() << "detector = ba.Detector2D(" << det->axis(0).size() << ", " + result << indent() << "detector = ba.OldDetec2D(" << det->axis(0).size() << ", " << det->axis(0).min() << ", " << det->axis(0).max() << ", " << det->axis(1).size() << ", " << det->axis(1).min() << ", " << det->axis(1).max() << ")\n"; } else diff --git a/Tests/Functional/Fitting/FitTests.cpp b/Tests/Functional/Fitting/FitTests.cpp index 4252a2cd23a..2102488e07c 100644 --- a/Tests/Functional/Fitting/FitTests.cpp +++ b/Tests/Functional/Fitting/FitTests.cpp @@ -71,7 +71,7 @@ const auto build_CylBA_Masked = [](const mumufit::Parameters& params) -> std::unique_ptr<ISimulation> { Beam beam(Beam(1, 1.0 * Units::angstrom, 0.2 * deg)); - Detector2D detector(20u, -1.2 * deg, +1.2 * deg, 18u, -1 * deg, +1 * deg); + OldDetec2D detector(20u, -1.2 * deg, +1.2 * deg, 18u, -1 * deg, +1 * deg); // TODO restore detector.setRegionOfInterest(5.0, 6.0, 15.0, 12.0); detector.addMask(Rectangle(0.0, 0.0, 2.0, 2.0), true); diff --git a/Tests/Py/Fit/fitobjective_api.py b/Tests/Py/Fit/fitobjective_api.py index 3e89f433b6b..ee08d35887c 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(self.m_ncol, -2*deg, 2*deg, self.m_nrow, 0, 3*deg) + self.detector = ba.OldDetec2D(self.m_ncol, -2*deg, 2*deg, self.m_nrow, 0, 3*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 20e16e69794..28988cf5e6f 100644 --- a/Tests/Py/Functional/PyFuTestInfrastructure.py +++ b/Tests/Py/Functional/PyFuTestInfrastructure.py @@ -9,7 +9,7 @@ from bornagain import deg #, ba_plot as bp def get_simulation_MiniGISAS(sample): beam = ba.Beam(1, 0.1, 0.2 * deg) n = 25 - detector = ba.Detector2D(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) return ba.ScatteringSimulation(beam, sample, detector) def diff_MiniGISAS(sample1, sample2): @@ -18,7 +18,7 @@ def diff_MiniGISAS(sample1, sample2): """ beam = ba.Beam(1, 0.1, 0.2 * deg) n = 11 - detector = ba.Detector2D(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) data1 = ba.ScatteringSimulation(beam, sample1, detector).simulate() data2 = ba.ScatteringSimulation(beam, sample2, detector).simulate() diff --git a/Tests/SimFactory/MakeSimulations.cpp b/Tests/SimFactory/MakeSimulations.cpp index 6d37620c2c5..e1109d4a72e 100644 --- a/Tests/SimFactory/MakeSimulations.cpp +++ b/Tests/SimFactory/MakeSimulations.cpp @@ -72,7 +72,7 @@ const Beam powerBeam(1e7, 1 * angstrom, 0.2 * deg); std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISAS(const MultiLayer& sample) { - Detector2D detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg); + OldDetec2D detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg); return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector); } @@ -81,7 +81,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISAS(const Mult std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISAS_v2(const MultiLayer& sample) { - Detector2D detector(25, -2 * deg, 2 * deg, 25, 0, 1 * deg); + OldDetec2D detector(25, -2 * deg, 2 * deg, 25, 0, 1 * deg); return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector); } @@ -91,7 +91,7 @@ test::makeSimulation::MiniZPolarizedGISAS(const MultiLayer& sample, const std::s const auto zCase = ZPolarizationCases.at(polCase); std::unique_ptr<Beam> beam(stdBeam.clone()); beam->setPolarization(zCase.first); - Detector2D detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg); + OldDetec2D detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg); detector.setAnalyzer(zCase.second); auto sim = std::make_unique<ScatteringSimulation>(*beam, sample, detector); return sim; @@ -102,7 +102,7 @@ test::makeSimulation::MiniZPolarizedGISAS(const MultiLayer& sample, const std::s std::unique_ptr<ScatteringSimulation> test::makeSimulation::BasicGISAS(const MultiLayer& sample) { - Detector2D detector(100, 0, 2 * deg, 100, 0, 2 * deg); + OldDetec2D detector(100, 0, 2 * deg, 100, 0, 2 * deg); return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector); } @@ -112,7 +112,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::SpinflipGISAS(const { std::unique_ptr<Beam> beam(stdBeam.clone()); beam->setPolarization(zplus); - Detector2D detector(100, 0, 2 * deg, 100, 0, 2 * deg); + OldDetec2D detector(100, 0, 2 * deg, 100, 0, 2 * deg); detector.setAnalyzer(-1. * zplus); return std::make_unique<ScatteringSimulation>(*beam, sample, detector); } @@ -139,7 +139,7 @@ test::makeSimulation::MiniGISASBeamDivergence(const MultiLayer& sample) std::unique_ptr<ScatteringSimulation> test::makeSimulation::GISASWithMasks(const MultiLayer& sample) { - Detector2D detector(50, -1 * deg, 1 * deg, 50, 0, 2 * deg); + OldDetec2D detector(50, -1 * deg, 1 * deg, 50, 0, 2 * deg); detector.maskAll(); // pacman @@ -180,7 +180,7 @@ test::makeSimulation::MiniGISASDetectorResolution(const MultiLayer& sample) std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISASSpecularPeak(const MultiLayer& sample) { - Detector2D detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg); + OldDetec2D detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg); std::unique_ptr<ScatteringSimulation> result = std::make_unique<ScatteringSimulation>(stdBeam, sample, detector); result->options().setIncludeSpecular(true); @@ -191,7 +191,7 @@ test::makeSimulation::MiniGISASSpecularPeak(const MultiLayer& sample) std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS(const MultiLayer& sample) { - Detector2D detector(256, -2 * deg, 2 * deg, 256, 0, 2 * deg); + OldDetec2D detector(256, -2 * deg, 2 * deg, 256, 0, 2 * deg); return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector); } @@ -201,7 +201,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS00(const Mu { std::unique_ptr<Beam> beam(stdBeam.clone()); beam->setPolarization(zplus); - Detector2D detector(256, -2 * deg, 2 * deg, 256, 0, 2 * deg); + OldDetec2D detector(256, -2 * deg, 2 * deg, 256, 0, 2 * deg); detector.setAnalyzer(zplus); return std::make_unique<ScatteringSimulation>(*beam, sample, detector); } @@ -221,7 +221,7 @@ test::makeSimulation::MiniGISASMonteCarlo(const MultiLayer& sample) std::unique_ptr<ScatteringSimulation> test::makeSimulation::SphericalDetWithRoi(const MultiLayer& sample) { - Detector2D detector(40, -2 * deg, 2 * deg, 30, -1 * deg, 2 * deg); + OldDetec2D detector(40, -2 * deg, 2 * deg, 30, -1 * deg, 2 * deg); detector.addMask(Rectangle(-0.5 * deg, 0.3 * deg, -0.2 * deg, 0.6 * deg)); detector.setRegionOfInterest(-1.499 * deg, 0.251 * deg, 1.499 * deg, 1.749 * deg); @@ -232,7 +232,7 @@ test::makeSimulation::SphericalDetWithRoi(const MultiLayer& sample) std::unique_ptr<ScatteringSimulation> test::makeSimulation::RectDetWithRoi(const MultiLayer& sample) { - Detector2D detector(40, -2 * deg, 2 * deg, 30, -1 * deg, 2 * deg); + OldDetec2D detector(40, -2 * deg, 2 * deg, 30, -1 * deg, 2 * deg); detector.addMask(Rectangle(0.35 * deg, -1.15 * deg, 0.75 * deg, 1.95 * deg)); detector.setRegionOfInterest(-2.55 * deg, 0.25 * deg, 1.75 * deg, 1.85 * deg); return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector); @@ -244,7 +244,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::ExtraLongWavelengthGISAS(const MultiLayer& sample) { std::unique_ptr<Beam> beam(Beam(1e8, 12 * Units::nm, 0.2 * deg).clone()); - Detector2D detector(100, -2 * deg, 2 * deg, 100, 0, 2 * deg); + OldDetec2D detector(100, -2 * deg, 2 * deg, 100, 0, 2 * deg); auto simulation = std::make_unique<ScatteringSimulation>(*beam, sample, detector); simulation->options().setIncludeSpecular(true); return simulation; @@ -254,7 +254,7 @@ test::makeSimulation::ExtraLongWavelengthGISAS(const MultiLayer& sample) //! Beam intensity set to provide reasonably large values in detector channels. std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISASFit(const MultiLayer& sample) { - Detector2D detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg); + OldDetec2D detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg); return std::make_unique<ScatteringSimulation>(powerBeam, sample, detector); } diff --git a/Tests/Unit/Device/Detector2DTest.cpp b/Tests/Unit/Device/Detector2DTest.cpp index 13d3c516575..092831a2925 100644 --- a/Tests/Unit/Device/Detector2DTest.cpp +++ b/Tests/Unit/Device/Detector2DTest.cpp @@ -16,9 +16,9 @@ using Units::deg; // Construction of the detector via classical constructor. -TEST(Detector2DTest, constructionWithParameters) +TEST(OldDetec2DTest, constructionWithParameters) { - Detector2D detector(10, -1 * deg, 1 * deg, 20, 0 * deg, 2 * deg); + OldDetec2D detector(10, -1 * deg, 1 * deg, 20, 0 * deg, 2 * deg); EXPECT_EQ(10u, detector.axis(0).size()); EXPECT_EQ(-1 * deg, detector.axis(0).min()); EXPECT_EQ(1 * deg, detector.axis(0).max()); @@ -28,9 +28,9 @@ TEST(Detector2DTest, constructionWithParameters) } // Creation of the detector map with axes in given units -TEST(Detector2DTest, createDetectorMap) +TEST(OldDetec2DTest, createDetectorMap) { - Detector2D detector(10, -1 * deg, 1 * deg, 20, 0, 2 * deg); + OldDetec2D detector(10, -1 * deg, 1 * deg, 20, 0, 2 * deg); // creating map in default units, which are radians and checking axes auto data = detector.createDetectorMap(); @@ -43,9 +43,9 @@ TEST(Detector2DTest, createDetectorMap) } // Testing region of interest. -TEST(Detector2DTest, regionOfInterest) +TEST(OldDetec2DTest, regionOfInterest) { - Detector2D detector(8, -3 * deg, 5 * deg, 4, 0, 4 * deg); + OldDetec2D detector(8, -3 * deg, 5 * deg, 4, 0, 4 * deg); // creating region of interest double xlow(-2 * deg), ylow(1 * deg), xup(4 * deg), yup(3 * deg); @@ -66,9 +66,9 @@ TEST(Detector2DTest, regionOfInterest) } // Create detector map in the presence of region of interest. -TEST(Detector2DTest, regionOfInterestAndDetectorMap) +TEST(OldDetec2DTest, regionOfInterestAndDetectorMap) { - Detector2D detector(6, -1 * deg, 5 * deg, 4, 0 * deg, 4 * deg); + OldDetec2D detector(6, -1 * deg, 5 * deg, 4, 0 * deg, 4 * deg); detector.setRegionOfInterest(0.1 * deg, 1.1 * deg, 2.999 * deg, 2.9 * deg); // Creating map in default units, which are radians and checking that axes are clipped @@ -82,9 +82,9 @@ TEST(Detector2DTest, regionOfInterestAndDetectorMap) } // Checking clone in the presence of ROI and masks. -TEST(Detector2DTest, Clone) +TEST(OldDetec2DTest, Clone) { - Detector2D detector(6, -1 * deg, 5 * deg, 4, 0, 4 * deg); + OldDetec2D detector(6, -1 * deg, 5 * deg, 4, 0, 4 * deg); detector.setRegionOfInterest(0.1 * deg, 1.1 * deg, 3.9 * deg, 2.9 * deg); detector.addMask(Rectangle(-0.9 * deg, 0.1 * deg, 0.9 * deg, 1.9 * deg), true); detector.addMask(Rectangle(3.1 * deg, 2.1 * deg, 4.9 * deg, 3.9 * deg), true); @@ -93,7 +93,7 @@ TEST(Detector2DTest, Clone) std::vector<size_t> indexes1 = detector.activeIndices(); - std::unique_ptr<Detector2D> clone(detector.clone()); + std::unique_ptr<OldDetec2D> clone(detector.clone()); auto data = clone->createDetectorMap(); EXPECT_EQ(data.axis(0).size(), 4u); diff --git a/Tests/Unit/Device/RegionOfInterestTest.cpp b/Tests/Unit/Device/RegionOfInterestTest.cpp index ae2a48d154a..d3d64a34655 100644 --- a/Tests/Unit/Device/RegionOfInterestTest.cpp +++ b/Tests/Unit/Device/RegionOfInterestTest.cpp @@ -13,7 +13,7 @@ using Units::deg; TEST(RegionOfInterestTest, constructor) { - Detector2D detector(8, -3 * deg, 5 * deg, 4, 0, 4 * deg); + OldDetec2D detector(8, -3 * deg, 5 * deg, 4, 0, 4 * deg); // creating region of interest double xlow(-1.9 * deg), ylow(1.1 * deg), xup(2.9 * deg), yup(2.85 * deg); @@ -38,7 +38,7 @@ TEST(RegionOfInterestTest, constructor) TEST(RegionOfInterestTest, largeArea) { - Detector2D detector(8, -3 * deg, 5 * deg, 4, 0, 4 * deg); + OldDetec2D detector(8, -3 * deg, 5 * deg, 4, 0, 4 * deg); // creating region of interest double xlow(-3.9 * deg), ylow(-1.1 * deg), xup(6.9 * deg), yup(5.85 * deg); @@ -59,13 +59,13 @@ TEST(RegionOfInterestTest, largeArea) TEST(RegionOfInterestTest, clone) { - Detector2D detector(8, -3 * deg, 5 * deg, 4, 0, 4 * deg); + OldDetec2D detector(8, -3 * deg, 5 * deg, 4, 0, 4 * deg); // creating region of interest double xlow(-1.9 * deg), ylow(1.1 * deg), xup(2.9 * deg), yup(2.85 * deg); detector.setRegionOfInterest(xlow, ylow, xup, yup); - std::unique_ptr<Detector2D> clone(detector.clone()); + std::unique_ptr<OldDetec2D> clone(detector.clone()); EXPECT_EQ(clone->regionOfInterestBounds(0).first, xlow); EXPECT_EQ(clone->regionOfInterestBounds(0).second, xup); diff --git a/Tests/Unit/Sim/FittingTestHelper.h b/Tests/Unit/Sim/FittingTestHelper.h index 4b368dd90cb..38a3c6bb503 100644 --- a/Tests/Unit/Sim/FittingTestHelper.h +++ b/Tests/Unit/Sim/FittingTestHelper.h @@ -40,7 +40,7 @@ public: sample.addLayer(Layer(material)); sample.addLayer(Layer(material)); - Detector2D detector(m_nx, m_xmin, m_xmax, m_ny, m_ymin, m_ymax); + OldDetec2D detector(m_nx, m_xmin, m_xmax, m_ny, m_ymin, m_ymax); std::unique_ptr<ScatteringSimulation> result( new ScatteringSimulation(Beam(1., 1., 0.), sample, detector)); diff --git a/Wrap/Python/std_simulations.py b/Wrap/Python/std_simulations.py index 2ab37f95986..579f562e2be 100644 --- a/Wrap/Python/std_simulations.py +++ b/Wrap/Python/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(n, -4.5*deg, 4.5*deg, n, -4.5*deg, 4.5*deg) + det = ba.OldDetec2D(n, -4.5*deg, 4.5*deg, n, -4.5*deg, 4.5*deg) 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 fe67b0ee2c9..5cfea1ceb5c 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 feb3906c360..e8f8b8ae6b5 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(nx, -1.7*deg, 1.7*deg, ny, 0, 1.84*deg) + return ba.OldDetec2D(nx, -1.7*deg, 1.7*deg, ny, 0, 1.84*deg) def create_simulation(P): diff --git a/auto/Examples/fit/scatter2d/fit2d.py b/auto/Examples/fit/scatter2d/fit2d.py index 0a6c0c12ff1..e8854589f5b 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 3afeac3cc07..ddc62eafaa6 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(n, -1.5*deg, 1.5*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 3*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 0aff11f4789..c322e945b24 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 60714658783..84a5d83ea7d 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 022772a9308..efcf917523b 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 3abfa81801b..0a9edf51e1f 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(n, -1.5*deg, 1.5*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 2*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/auto/Examples/offspec/OffspecResolved.py b/auto/Examples/offspec/OffspecResolved.py index 3be15c99c68..9520d128cc0 100755 --- a/auto/Examples/offspec/OffspecResolved.py +++ b/auto/Examples/offspec/OffspecResolved.py @@ -47,7 +47,7 @@ def simulate(sample): af = 1. * deg da = 0.03 * deg - detector = ba.Detector2D(501, -2*deg, 2*deg, 1, af - da, af + da) + detector = ba.OldDetec2D(501, -2*deg, 2*deg, 1, af - da, af + da) 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 58366c5c93b..74ca8515498 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/ApproximationLMA.py b/auto/Examples/scatter2d/ApproximationLMA.py index 511158764f0..8dea2344b22 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/ApproximationSSCA.py b/auto/Examples/scatter2d/ApproximationSSCA.py index 3d5fd95fb9f..2c08939beaf 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/BeamDivergence.py b/auto/Examples/scatter2d/BeamDivergence.py index d26c663b27f..3f274c160bc 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 88ace6e8000..6d7ecbea9a7 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/BoxesWithSpecularPeak.py b/auto/Examples/scatter2d/BoxesWithSpecularPeak.py index 0fe8b015bd7..0314e59776a 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) simulation.options().setIncludeSpecular(True) diff --git a/auto/Examples/scatter2d/ConstantBackground.py b/auto/Examples/scatter2d/ConstantBackground.py index 1243ca0007e..1b9a6063b96 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 498b41043ea..ff7a99e2d58 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CoreShellNanoparticles2.py b/auto/Examples/scatter2d/CoreShellNanoparticles2.py index abbf6f6e5bf..f9fc8f85276 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CorrelatedRoughness.py b/auto/Examples/scatter2d/CorrelatedRoughness.py index b68e9b1bac3..1a40e8970aa 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(n, -0.5*deg, 0.5*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py b/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py index 0d42dbcf89b..c333b1b37b8 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(n, -1.5*deg, 1.5*deg, n, 0, 2.5*deg) + detector = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 2.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CustomFormFactor.py b/auto/Examples/scatter2d/CustomFormFactor.py index 709cc385621..644907ba7ee 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(n, -1*deg, 1*deg, n, 0, 2*deg) + det = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 c633843b87c..8a627b2cecb 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/scatter2d/CylindersAndPrisms.py b/auto/Examples/scatter2d/CylindersAndPrisms.py index e9704f04062..a8b5bdf82d8 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/CylindersInAverageLayer.py b/auto/Examples/scatter2d/CylindersInAverageLayer.py index 9394e9efcc7..b8eae1b7b2f 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 8eb0fb99ac0..a65a83c27a6 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/DodecahedraSAS.py b/auto/Examples/scatter2d/DodecahedraSAS.py index 021ac7b4568..6c952d1408b 100755 --- a/auto/Examples/scatter2d/DodecahedraSAS.py +++ b/auto/Examples/scatter2d/DodecahedraSAS.py @@ -36,7 +36,7 @@ def get_simulation(sample): # Detector opposite to source: n = 200 # number of pixels per direction angmax = 5*deg - det = ba.Detector2D(n, -angmax, +angmax, n, -angmax, +angmax) + det = ba.OldDetec2D(n, -angmax, +angmax, n, -angmax, +angmax) return ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/Examples/scatter2d/FindPeaks.py b/auto/Examples/scatter2d/FindPeaks.py index 96c7d615e10..0f313b0f829 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(n, -0.5*deg, 0.5*deg, n, 0, 0.5*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 0.5*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 f2125689af8..72bf9750c1d 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 d9634749cfb..5b09c6484b1 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(n, -1*deg, 1*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference1DLattice.py b/auto/Examples/scatter2d/Interference1DLattice.py index 97cbf83f199..a2543335361 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(n, -1*deg, 1*deg, n, 0, 2*deg) + det = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 5ed251a6809..9ad81c39354 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py b/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py index 6002b9ac8c5..4d5b71ebe68 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference2DParacrystal.py b/auto/Examples/scatter2d/Interference2DParacrystal.py index 5ffa0c6339c..36a954e5ddb 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py b/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py index f5cf6662f28..b2861277475 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py b/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py index 9c5310ab6ea..2d7934a0274 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/LargeParticlesFormFactor.py b/auto/Examples/scatter2d/LargeParticlesFormFactor.py index 60b3a2ae77a..95c4f48bfaa 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(n, -1.5*deg, 1.5*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 3*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 2249cb65bb7..14ee4f83129 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/MagneticCylinders1.py b/auto/Examples/scatter2d/MagneticCylinders1.py index c5a5d7ffc24..4b139950cc0 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/MagneticCylinders2.py b/auto/Examples/scatter2d/MagneticCylinders2.py index ccdc18d685a..57cb4ba1a0c 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) beam.setPolarization(pol_dir) detector.setAnalyzer(z_up) diff --git a/auto/Examples/scatter2d/MagneticSpheres.py b/auto/Examples/scatter2d/MagneticSpheres.py index 7bf9029ba76..d2a5191a213 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(n, -3*deg, 3*deg, n, 0, 4*deg) + detector = ba.OldDetec2D(n, -3*deg, 3*deg, n, 0, 4*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 abda20c4ef4..07cd16fead8 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Mesocrystal2.py b/auto/Examples/scatter2d/Mesocrystal2.py index fd4e99e2a1b..83fdceda956 100755 --- a/auto/Examples/scatter2d/Mesocrystal2.py +++ b/auto/Examples/scatter2d/Mesocrystal2.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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/Mesocrystal3.py b/auto/Examples/scatter2d/Mesocrystal3.py index 9bc2362ed5c..35526b2daf7 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 d58734c2784..28dccb2f2e8 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/Examples/scatter2d/ParticleAcrossInterface.py b/auto/Examples/scatter2d/ParticleAcrossInterface.py index da674a92a0d..f6612c13984 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/PolarizedSANS.py b/auto/Examples/scatter2d/PolarizedSANS.py index 043765d6eb0..84b3b23b5aa 100755 --- a/auto/Examples/scatter2d/PolarizedSANS.py +++ b/auto/Examples/scatter2d/PolarizedSANS.py @@ -58,7 +58,7 @@ def get_simulation(sample): # Detector opposite to source: angmax = 7*deg - detector = ba.Detector2D(n, -angmax, +angmax, n, -angmax, +angmax) + detector = ba.OldDetec2D(n, -angmax, +angmax, n, -angmax, +angmax) 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 ca657f32bf9..40ad64f7a5c 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/PositionVariance.py b/auto/Examples/scatter2d/PositionVariance.py index 39f4bcec5c8..51ceea389f0 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(n, -2*deg, 2*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/Examples/scatter2d/RectangularGrating.py b/auto/Examples/scatter2d/RectangularGrating.py index d53db72132f..d2ef5e76099 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(n, -0.5*deg, 0.5*deg, n, 0, 0.5*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 0.5*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 6c8c5256f95..2a83d3ae711 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(nx, -1.5*deg, 1.5*deg, ny, 0, 3*deg) + detector = ba.OldDetec2D(nx, -1.5*deg, 1.5*deg, ny, 0, 3*deg) results = [] diff --git a/auto/Examples/scatter2d/RotatedPyramids.py b/auto/Examples/scatter2d/RotatedPyramids.py index 89a168496b5..9eec234273d 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/SlicedLayer.py b/auto/Examples/scatter2d/SlicedLayer.py index 91ac1340c69..d64cf3056a3 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 18bdb4e3c51..8545d72517b 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(n, -1*deg, 1*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Examples/scatter2d/TriangularRipple.py b/auto/Examples/scatter2d/TriangularRipple.py index cbf953a935b..8d5b40544b5 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*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 5f16630ebb3..ce875730e7c 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 3f05f4cae7a..ce0338824c6 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(nx, -1.7*deg, 1.7*deg, ny, 0, 1.84*deg) + return ba.OldDetec2D(nx, -1.7*deg, 1.7*deg, ny, 0, 1.84*deg) def create_simulation(P): diff --git a/auto/MiniExamples/fit/scatter2d/fit2d.py b/auto/MiniExamples/fit/scatter2d/fit2d.py index 75bd94f6aaf..09f839d39ef 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 3afeac3cc07..ddc62eafaa6 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(n, -1.5*deg, 1.5*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 3*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 cc2372c2e08..2b67e36b5b0 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 1104b11e07e..9c8bb155932 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 6b75f2e676a..4130cad4f1f 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 f49abf5a98b..bf0e49bad36 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(n, -1.5*deg, 1.5*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 2*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/auto/MiniExamples/offspec/OffspecResolved.py b/auto/MiniExamples/offspec/OffspecResolved.py index 3be15c99c68..9520d128cc0 100755 --- a/auto/MiniExamples/offspec/OffspecResolved.py +++ b/auto/MiniExamples/offspec/OffspecResolved.py @@ -47,7 +47,7 @@ def simulate(sample): af = 1. * deg da = 0.03 * deg - detector = ba.Detector2D(501, -2*deg, 2*deg, 1, af - da, af + da) + detector = ba.OldDetec2D(501, -2*deg, 2*deg, 1, af - da, af + da) 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 7aeaac2ad8b..b3052e46427 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/ApproximationLMA.py b/auto/MiniExamples/scatter2d/ApproximationLMA.py index 9ef559a73be..64553dde520 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/ApproximationSSCA.py b/auto/MiniExamples/scatter2d/ApproximationSSCA.py index 5d7d89bf7b5..fd733b322a2 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/BeamDivergence.py b/auto/MiniExamples/scatter2d/BeamDivergence.py index cca06378bfe..ac59fb05506 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 bd5969e67af..5ab47ede499 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py b/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py index 61cc4f2e33f..a92390b5c1e 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) simulation.options().setIncludeSpecular(True) diff --git a/auto/MiniExamples/scatter2d/ConstantBackground.py b/auto/MiniExamples/scatter2d/ConstantBackground.py index 14f4ddb429d..f00a5e5456b 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 e37c5ed63d7..68dc16c0479 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CoreShellNanoparticles2.py b/auto/MiniExamples/scatter2d/CoreShellNanoparticles2.py index c7c40c20f11..8d98f6f6d32 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CorrelatedRoughness.py b/auto/MiniExamples/scatter2d/CorrelatedRoughness.py index 01d807c6426..6697addebff 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(n, -0.5*deg, 0.5*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py b/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py index f253b6d7c28..5f5aed2ec09 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(n, -1.5*deg, 1.5*deg, n, 0, 2.5*deg) + detector = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 2.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CustomFormFactor.py b/auto/MiniExamples/scatter2d/CustomFormFactor.py index 63d31e9e6ae..b39b089dafd 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(n, -1*deg, 1*deg, n, 0, 2*deg) + det = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 5502e316a83..4e6e290c210 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/scatter2d/CylindersAndPrisms.py b/auto/MiniExamples/scatter2d/CylindersAndPrisms.py index 75fd4199e91..c80a6d65171 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py b/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py index 8b5dbbe016a..9fe00f92816 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 661ac194af9..fbee02c1906 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/DodecahedraSAS.py b/auto/MiniExamples/scatter2d/DodecahedraSAS.py index 97d42bc9122..ee283fb93c4 100755 --- a/auto/MiniExamples/scatter2d/DodecahedraSAS.py +++ b/auto/MiniExamples/scatter2d/DodecahedraSAS.py @@ -36,7 +36,7 @@ def get_simulation(sample): # Detector opposite to source: n = 11 # number of pixels per direction angmax = 5*deg - det = ba.Detector2D(n, -angmax, +angmax, n, -angmax, +angmax) + det = ba.OldDetec2D(n, -angmax, +angmax, n, -angmax, +angmax) return ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/MiniExamples/scatter2d/FindPeaks.py b/auto/MiniExamples/scatter2d/FindPeaks.py index e26034576cb..167680ce915 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(n, -0.5*deg, 0.5*deg, n, 0, 0.5*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 0.5*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 8df95982909..f0d67a2a705 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 e6b1336acdc..6d8fd1c428a 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(n, -1*deg, 1*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference1DLattice.py b/auto/MiniExamples/scatter2d/Interference1DLattice.py index 7da77f13e0d..dad5a7d4ed2 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(n, -1*deg, 1*deg, n, 0, 2*deg) + det = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 bdbb0f91a88..b9bb0334c86 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py b/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py index 653a4f99eef..92a2bf51d95 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference2DParacrystal.py b/auto/MiniExamples/scatter2d/Interference2DParacrystal.py index a3db69af9d1..fe858eca439 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py b/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py index 464254158d2..6d0cd34958f 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py b/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py index 55229f9022c..88e5ad18776 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py b/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py index db3441cd655..ae0e4b30200 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(n, -1.5*deg, 1.5*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 3*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 57f64d6fa2d..62d19b43521 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/MagneticCylinders1.py b/auto/MiniExamples/scatter2d/MagneticCylinders1.py index 38194b6afda..49c9a690edf 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/MagneticCylinders2.py b/auto/MiniExamples/scatter2d/MagneticCylinders2.py index 18bdcf30377..6d7ae6da465 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) beam.setPolarization(pol_dir) detector.setAnalyzer(z_up) diff --git a/auto/MiniExamples/scatter2d/MagneticSpheres.py b/auto/MiniExamples/scatter2d/MagneticSpheres.py index 5c7e2f1d6d5..43ad6f72312 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(n, -3*deg, 3*deg, n, 0, 4*deg) + detector = ba.OldDetec2D(n, -3*deg, 3*deg, n, 0, 4*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 8a21485a107..f1e7caede96 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Mesocrystal2.py b/auto/MiniExamples/scatter2d/Mesocrystal2.py index 1e73f254b7e..58eed4ac9e3 100755 --- a/auto/MiniExamples/scatter2d/Mesocrystal2.py +++ b/auto/MiniExamples/scatter2d/Mesocrystal2.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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/Mesocrystal3.py b/auto/MiniExamples/scatter2d/Mesocrystal3.py index 495b7677396..110f2c020ba 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 d58734c2784..28dccb2f2e8 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py b/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py index 6082bde3cfc..2b39997f255 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/PolarizedSANS.py b/auto/MiniExamples/scatter2d/PolarizedSANS.py index 9549cd8c477..dd3e0e03038 100755 --- a/auto/MiniExamples/scatter2d/PolarizedSANS.py +++ b/auto/MiniExamples/scatter2d/PolarizedSANS.py @@ -58,7 +58,7 @@ def get_simulation(sample): # Detector opposite to source: angmax = 7*deg - detector = ba.Detector2D(n, -angmax, +angmax, n, -angmax, +angmax) + detector = ba.OldDetec2D(n, -angmax, +angmax, n, -angmax, +angmax) 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 a064392eabf..cf3682f1655 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/PositionVariance.py b/auto/MiniExamples/scatter2d/PositionVariance.py index eae7fab160f..a3d09d634f9 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(n, -2*deg, 2*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, det) diff --git a/auto/MiniExamples/scatter2d/RectangularGrating.py b/auto/MiniExamples/scatter2d/RectangularGrating.py index 8a5bbfbb17c..8c09800cff0 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(n, -0.5*deg, 0.5*deg, n, 0, 0.5*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 0.5*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 696a3464f92..6a1ef3b347f 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(nx, -1.5*deg, 1.5*deg, ny, 0, 3*deg) + detector = ba.OldDetec2D(nx, -1.5*deg, 1.5*deg, ny, 0, 3*deg) results = [] diff --git a/auto/MiniExamples/scatter2d/RotatedPyramids.py b/auto/MiniExamples/scatter2d/RotatedPyramids.py index b64d0f5cc71..8dd925af8ec 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/SlicedLayer.py b/auto/MiniExamples/scatter2d/SlicedLayer.py index bb7cc5c7f68..1b42f586b6f 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 1542629f6c3..de0346ce08f 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(n, -1*deg, 1*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/MiniExamples/scatter2d/TriangularRipple.py b/auto/MiniExamples/scatter2d/TriangularRipple.py index 8b59d76e2da..84477680ae4 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index 5be2657a8f1..e2951faf653 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2708,38 +2708,64 @@ class IDetector(libBornAgainBase.ICloneable, libBornAgainParam.INode): # Register IDetector in _libBornAgainDevice: _libBornAgainDevice.IDetector_swigregister(IDetector) -class Detector2D(IDetector): - r"""Proxy of C++ Detector2D class.""" +class OldDetec2D(IDetector): + r"""Proxy of C++ OldDetec2D class.""" 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, size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) -> Detector2D - __init__(Detector2D self, double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, double center_phi, double center_alpha) -> Detector2D - """ - _libBornAgainDevice.Detector2D_swiginit(self, _libBornAgainDevice.new_Detector2D(*args)) - __swig_destroy__ = _libBornAgainDevice.delete_Detector2D + def __init__(self, n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max): + r"""__init__(OldDetec2D self, size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) -> OldDetec2D""" + _libBornAgainDevice.OldDetec2D_swiginit(self, _libBornAgainDevice.new_OldDetec2D(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max)) + __swig_destroy__ = _libBornAgainDevice.delete_OldDetec2D + + def clone(self): + r"""clone(OldDetec2D self) -> OldDetec2D""" + return _libBornAgainDevice.OldDetec2D_clone(self) + + def className(self): + r"""className(OldDetec2D self) -> std::string""" + return _libBornAgainDevice.OldDetec2D_className(self) + + def createPixel(self, index): + r"""createPixel(OldDetec2D self, size_t index) -> Pixel *""" + return _libBornAgainDevice.OldDetec2D_createPixel(self, index) + + def indexOfSpecular(self, beam): + r"""indexOfSpecular(OldDetec2D self, Beam beam) -> size_t""" + return _libBornAgainDevice.OldDetec2D_indexOfSpecular(self, beam) + +# Register OldDetec2D in _libBornAgainDevice: +_libBornAgainDevice.OldDetec2D_swigregister(OldDetec2D) +class NewDetec2D(IDetector): + r"""Proxy of C++ NewDetec2D class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, phi_full_width, alpha_full_width, n_phi, n_alpha, center_phi, center_alpha): + r"""__init__(NewDetec2D self, double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, double center_phi, double center_alpha) -> NewDetec2D""" + _libBornAgainDevice.NewDetec2D_swiginit(self, _libBornAgainDevice.new_NewDetec2D(phi_full_width, alpha_full_width, n_phi, n_alpha, center_phi, center_alpha)) + __swig_destroy__ = _libBornAgainDevice.delete_NewDetec2D def clone(self): - r"""clone(Detector2D self) -> Detector2D""" - return _libBornAgainDevice.Detector2D_clone(self) + r"""clone(NewDetec2D self) -> NewDetec2D""" + return _libBornAgainDevice.NewDetec2D_clone(self) def className(self): - r"""className(Detector2D self) -> std::string""" - return _libBornAgainDevice.Detector2D_className(self) + r"""className(NewDetec2D self) -> std::string""" + return _libBornAgainDevice.NewDetec2D_className(self) def createPixel(self, index): - r"""createPixel(Detector2D self, size_t index) -> Pixel *""" - return _libBornAgainDevice.Detector2D_createPixel(self, index) + r"""createPixel(NewDetec2D self, size_t index) -> Pixel *""" + return _libBornAgainDevice.NewDetec2D_createPixel(self, index) def indexOfSpecular(self, beam): - r"""indexOfSpecular(Detector2D self, Beam beam) -> size_t""" - return _libBornAgainDevice.Detector2D_indexOfSpecular(self, beam) + r"""indexOfSpecular(NewDetec2D self, Beam beam) -> size_t""" + return _libBornAgainDevice.NewDetec2D_indexOfSpecular(self, beam) -# Register Detector2D in _libBornAgainDevice: -_libBornAgainDevice.Detector2D_swigregister(Detector2D) +# Register NewDetec2D in _libBornAgainDevice: +_libBornAgainDevice.NewDetec2D_swigregister(NewDetec2D) 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 0d4750984e9..4d0bcbca5c0 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -3390,89 +3390,90 @@ namespace Swig { #define SWIGTYPE_p_Bin1D swig_types[1] #define SWIGTYPE_p_Coordinate swig_types[2] #define SWIGTYPE_p_Datafield swig_types[3] -#define SWIGTYPE_p_Detector2D swig_types[4] -#define SWIGTYPE_p_Ellipse swig_types[5] -#define SWIGTYPE_p_FootprintGauss swig_types[6] -#define SWIGTYPE_p_FootprintSquare swig_types[7] -#define SWIGTYPE_p_Frame swig_types[8] -#define SWIGTYPE_p_HorizontalLine swig_types[9] -#define SWIGTYPE_p_ICloneable swig_types[10] -#define SWIGTYPE_p_IDetector swig_types[11] -#define SWIGTYPE_p_IDetectorResolution swig_types[12] -#define SWIGTYPE_p_IFootprint swig_types[13] -#define SWIGTYPE_p_INode swig_types[14] -#define SWIGTYPE_p_IResolutionFunction2D swig_types[15] -#define SWIGTYPE_p_IShape2D swig_types[16] -#define SWIGTYPE_p_ImportSettings1D swig_types[17] -#define SWIGTYPE_p_Line swig_types[18] -#define SWIGTYPE_p_MaskStack swig_types[19] +#define SWIGTYPE_p_Ellipse swig_types[4] +#define SWIGTYPE_p_FootprintGauss swig_types[5] +#define SWIGTYPE_p_FootprintSquare swig_types[6] +#define SWIGTYPE_p_Frame swig_types[7] +#define SWIGTYPE_p_HorizontalLine swig_types[8] +#define SWIGTYPE_p_ICloneable swig_types[9] +#define SWIGTYPE_p_IDetector swig_types[10] +#define SWIGTYPE_p_IDetectorResolution swig_types[11] +#define SWIGTYPE_p_IFootprint swig_types[12] +#define SWIGTYPE_p_INode swig_types[13] +#define SWIGTYPE_p_IResolutionFunction2D swig_types[14] +#define SWIGTYPE_p_IShape2D swig_types[15] +#define SWIGTYPE_p_ImportSettings1D swig_types[16] +#define SWIGTYPE_p_Line swig_types[17] +#define SWIGTYPE_p_MaskStack swig_types[18] +#define SWIGTYPE_p_NewDetec2D swig_types[19] #define SWIGTYPE_p_OffspecDetector swig_types[20] -#define SWIGTYPE_p_Pixel swig_types[21] -#define SWIGTYPE_p_PolFilter swig_types[22] -#define SWIGTYPE_p_Polygon swig_types[23] -#define SWIGTYPE_p_PolygonPrivate swig_types[24] -#define SWIGTYPE_p_Rectangle swig_types[25] -#define SWIGTYPE_p_ResolutionFunction2DGaussian swig_types[26] -#define SWIGTYPE_p_Rotation3DT_double_t swig_types[27] -#define SWIGTYPE_p_Scale swig_types[28] -#define SWIGTYPE_p_SphericalDetector swig_types[29] -#define SWIGTYPE_p_Vec3T_double_t swig_types[30] -#define SWIGTYPE_p_Vec3T_int_t swig_types[31] -#define SWIGTYPE_p_Vec3T_std__complexT_double_t_t swig_types[32] -#define SWIGTYPE_p_VerticalLine swig_types[33] -#define SWIGTYPE_p_allocator_type swig_types[34] -#define SWIGTYPE_p_char swig_types[35] -#define SWIGTYPE_p_const_iterator swig_types[36] -#define SWIGTYPE_p_corr_matrix_t swig_types[37] -#define SWIGTYPE_p_difference_type swig_types[38] -#define SWIGTYPE_p_first_type swig_types[39] -#define SWIGTYPE_p_int swig_types[40] -#define SWIGTYPE_p_iterator swig_types[41] -#define SWIGTYPE_p_key_type swig_types[42] -#define SWIGTYPE_p_long_long swig_types[43] -#define SWIGTYPE_p_mapped_type swig_types[44] -#define SWIGTYPE_p_p_PyObject swig_types[45] -#define SWIGTYPE_p_parameters_t swig_types[46] -#define SWIGTYPE_p_second_type swig_types[47] -#define SWIGTYPE_p_short swig_types[48] -#define SWIGTYPE_p_signed_char swig_types[49] -#define SWIGTYPE_p_size_type swig_types[50] -#define SWIGTYPE_p_std__allocatorT_Vec3T_double_t_t swig_types[51] -#define SWIGTYPE_p_std__allocatorT_double_t swig_types[52] -#define SWIGTYPE_p_std__allocatorT_int_t swig_types[53] -#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[54] -#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[55] -#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[56] -#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[57] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[58] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[59] -#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[60] -#define SWIGTYPE_p_std__complexT_double_t swig_types[61] -#define SWIGTYPE_p_std__functionT_double_fdoubleF_t swig_types[62] -#define SWIGTYPE_p_std__invalid_argument swig_types[63] -#define SWIGTYPE_p_std__lessT_std__string_t swig_types[64] -#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[65] -#define SWIGTYPE_p_std__pairT_double_double_t swig_types[66] -#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[67] -#define SWIGTYPE_p_std__vectorT_ParaMeta_std__allocatorT_ParaMeta_t_t swig_types[68] -#define SWIGTYPE_p_std__vectorT_Scale_const_p_std__allocatorT_Scale_const_p_t_t swig_types[69] -#define SWIGTYPE_p_std__vectorT_Vec3T_double_t_std__allocatorT_Vec3T_double_t_t_t swig_types[70] -#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[71] -#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[72] -#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[73] -#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[74] -#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[75] -#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[76] -#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[77] -#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[78] -#define SWIGTYPE_p_swig__SwigPyIterator swig_types[79] -#define SWIGTYPE_p_unsigned_char swig_types[80] -#define SWIGTYPE_p_unsigned_int swig_types[81] -#define SWIGTYPE_p_unsigned_long_long swig_types[82] -#define SWIGTYPE_p_unsigned_short swig_types[83] -#define SWIGTYPE_p_value_type swig_types[84] -static swig_type_info *swig_types[86]; -static swig_module_info swig_module = {swig_types, 85, 0, 0, 0, 0}; +#define SWIGTYPE_p_OldDetec2D swig_types[21] +#define SWIGTYPE_p_Pixel swig_types[22] +#define SWIGTYPE_p_PolFilter swig_types[23] +#define SWIGTYPE_p_Polygon swig_types[24] +#define SWIGTYPE_p_PolygonPrivate swig_types[25] +#define SWIGTYPE_p_Rectangle swig_types[26] +#define SWIGTYPE_p_ResolutionFunction2DGaussian swig_types[27] +#define SWIGTYPE_p_Rotation3DT_double_t swig_types[28] +#define SWIGTYPE_p_Scale swig_types[29] +#define SWIGTYPE_p_SphericalDetector swig_types[30] +#define SWIGTYPE_p_Vec3T_double_t swig_types[31] +#define SWIGTYPE_p_Vec3T_int_t swig_types[32] +#define SWIGTYPE_p_Vec3T_std__complexT_double_t_t swig_types[33] +#define SWIGTYPE_p_VerticalLine swig_types[34] +#define SWIGTYPE_p_allocator_type swig_types[35] +#define SWIGTYPE_p_char swig_types[36] +#define SWIGTYPE_p_const_iterator swig_types[37] +#define SWIGTYPE_p_corr_matrix_t swig_types[38] +#define SWIGTYPE_p_difference_type swig_types[39] +#define SWIGTYPE_p_first_type swig_types[40] +#define SWIGTYPE_p_int swig_types[41] +#define SWIGTYPE_p_iterator swig_types[42] +#define SWIGTYPE_p_key_type swig_types[43] +#define SWIGTYPE_p_long_long swig_types[44] +#define SWIGTYPE_p_mapped_type swig_types[45] +#define SWIGTYPE_p_p_PyObject swig_types[46] +#define SWIGTYPE_p_parameters_t swig_types[47] +#define SWIGTYPE_p_second_type swig_types[48] +#define SWIGTYPE_p_short swig_types[49] +#define SWIGTYPE_p_signed_char swig_types[50] +#define SWIGTYPE_p_size_type swig_types[51] +#define SWIGTYPE_p_std__allocatorT_Vec3T_double_t_t swig_types[52] +#define SWIGTYPE_p_std__allocatorT_double_t swig_types[53] +#define SWIGTYPE_p_std__allocatorT_int_t swig_types[54] +#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[55] +#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[56] +#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[57] +#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[58] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[59] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[60] +#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[61] +#define SWIGTYPE_p_std__complexT_double_t swig_types[62] +#define SWIGTYPE_p_std__functionT_double_fdoubleF_t swig_types[63] +#define SWIGTYPE_p_std__invalid_argument swig_types[64] +#define SWIGTYPE_p_std__lessT_std__string_t swig_types[65] +#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[66] +#define SWIGTYPE_p_std__pairT_double_double_t swig_types[67] +#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[68] +#define SWIGTYPE_p_std__vectorT_ParaMeta_std__allocatorT_ParaMeta_t_t swig_types[69] +#define SWIGTYPE_p_std__vectorT_Scale_const_p_std__allocatorT_Scale_const_p_t_t swig_types[70] +#define SWIGTYPE_p_std__vectorT_Vec3T_double_t_std__allocatorT_Vec3T_double_t_t_t swig_types[71] +#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[72] +#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[73] +#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[74] +#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[75] +#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[76] +#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[77] +#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[78] +#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[79] +#define SWIGTYPE_p_swig__SwigPyIterator swig_types[80] +#define SWIGTYPE_p_unsigned_char swig_types[81] +#define SWIGTYPE_p_unsigned_int swig_types[82] +#define SWIGTYPE_p_unsigned_long_long swig_types[83] +#define SWIGTYPE_p_unsigned_short swig_types[84] +#define SWIGTYPE_p_value_type swig_types[85] +static swig_type_info *swig_types[87]; +static swig_module_info swig_module = {swig_types, 86, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -36460,7 +36461,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) { +SWIGINTERN PyObject *_wrap_new_OldDetec2D(PyObject *self, PyObject *args) { PyObject *resultobj = 0; size_t arg1 ; double arg2 ; @@ -36480,42 +36481,224 @@ SWIGINTERN PyObject *_wrap_new_Detector2D__SWIG_0(PyObject *self, Py_ssize_t nob int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; - Detector2D *result = 0 ; + PyObject *swig_obj[6] ; + OldDetec2D *result = 0 ; - if ((nobjs < 6) || (nobjs > 6)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_OldDetec2D", 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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OldDetec2D" "', argument " "1"" of type '" "size_t""'"); } arg1 = static_cast< size_t >(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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OldDetec2D" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Detector2D" "', argument " "3"" of type '" "double""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_OldDetec2D" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_OldDetec2D" "', 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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_OldDetec2D" "', 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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_OldDetec2D" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); { try { - result = (Detector2D *)new Detector2D(arg1,arg2,arg3,arg4,arg5,arg6); + result = (OldDetec2D *)new OldDetec2D(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_OldDetec2D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_OldDetec2D(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + OldDetec2D *arg1 = (OldDetec2D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OldDetec2D, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OldDetec2D" "', argument " "1"" of type '" "OldDetec2D *""'"); + } + arg1 = reinterpret_cast< OldDetec2D * >(argp1); + { + try { + delete arg1; + } 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_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_OldDetec2D_clone(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + OldDetec2D *arg1 = (OldDetec2D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + OldDetec2D *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OldDetec2D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OldDetec2D_clone" "', argument " "1"" of type '" "OldDetec2D const *""'"); + } + arg1 = reinterpret_cast< OldDetec2D * >(argp1); + { + try { + result = (OldDetec2D *)((OldDetec2D const *)arg1)->clone(); + } 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_OldDetec2D, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_OldDetec2D_className(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + OldDetec2D *arg1 = (OldDetec2D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::string result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OldDetec2D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OldDetec2D_className" "', argument " "1"" of type '" "OldDetec2D const *""'"); + } + arg1 = reinterpret_cast< OldDetec2D * >(argp1); + { + try { + result = ((OldDetec2D const *)arg1)->className(); + } 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_From_std_string(static_cast< std::string >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_OldDetec2D_createPixel(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + OldDetec2D *arg1 = (OldDetec2D *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + Pixel *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "OldDetec2D_createPixel", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OldDetec2D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OldDetec2D_createPixel" "', argument " "1"" of type '" "OldDetec2D const *""'"); + } + arg1 = reinterpret_cast< OldDetec2D * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OldDetec2D_createPixel" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + { + try { + result = (Pixel *)((OldDetec2D const *)arg1)->createPixel(arg2); + } 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_Pixel, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_OldDetec2D_indexOfSpecular(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + OldDetec2D *arg1 = (OldDetec2D *) 0 ; + Beam *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + size_t result; + + if (!SWIG_Python_UnpackTuple(args, "OldDetec2D_indexOfSpecular", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OldDetec2D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OldDetec2D_indexOfSpecular" "', argument " "1"" of type '" "OldDetec2D const *""'"); + } + arg1 = reinterpret_cast< OldDetec2D * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Beam, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OldDetec2D_indexOfSpecular" "', argument " "2"" of type '" "Beam const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OldDetec2D_indexOfSpecular" "', argument " "2"" of type '" "Beam const &""'"); + } + arg2 = reinterpret_cast< Beam * >(argp2); + { + try { + result = ((OldDetec2D const *)arg1)->indexOfSpecular((Beam const &)*arg2); } catch (const std::exception& ex) { // message shown in the Python interpreter const std::string msg { @@ -36524,14 +36707,25 @@ SWIGINTERN PyObject *_wrap_new_Detector2D__SWIG_0(PyObject *self, Py_ssize_t nob SWIG_exception(SWIG_RuntimeError, msg.c_str()); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Detector2D, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_new_Detector2D__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *OldDetec2D_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_OldDetec2D, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *OldDetec2D_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject *_wrap_new_NewDetec2D(PyObject *self, PyObject *args) { PyObject *resultobj = 0; double arg1 ; double arg2 ; @@ -36551,42 +36745,43 @@ SWIGINTERN PyObject *_wrap_new_Detector2D__SWIG_1(PyObject *self, Py_ssize_t nob int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; - Detector2D *result = 0 ; + PyObject *swig_obj[6] ; + NewDetec2D *result = 0 ; - if ((nobjs < 6) || (nobjs > 6)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_NewDetec2D", 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 '" "new_Detector2D" "', argument " "1"" of type '" "double""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_NewDetec2D" "', 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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_NewDetec2D" "', 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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_NewDetec2D" "', 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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_NewDetec2D" "', 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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_NewDetec2D" "', 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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_NewDetec2D" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); { try { - result = (Detector2D *)new Detector2D(arg1,arg2,arg3,arg4,arg5,arg6); + result = (NewDetec2D *)new NewDetec2D(arg1,arg2,arg3,arg4,arg5,arg6); } catch (const std::exception& ex) { // message shown in the Python interpreter const std::string msg { @@ -36595,125 +36790,27 @@ SWIGINTERN PyObject *_wrap_new_Detector2D__SWIG_1(PyObject *self, Py_ssize_t nob SWIG_exception(SWIG_RuntimeError, msg.c_str()); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Detector2D, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_NewDetec2D, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -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_0(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_1(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(size_t,double,double,size_t,double,double)\n" - " Detector2D::Detector2D(double,double,size_t,size_t,double,double)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_Detector2D(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_NewDetec2D(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - Detector2D *arg1 = (Detector2D *) 0 ; + NewDetec2D *arg1 = (NewDetec2D *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Detector2D, SWIG_POINTER_DISOWN | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_NewDetec2D, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Detector2D" "', argument " "1"" of type '" "Detector2D *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_NewDetec2D" "', argument " "1"" of type '" "NewDetec2D *""'"); } - arg1 = reinterpret_cast< Detector2D * >(argp1); + arg1 = reinterpret_cast< NewDetec2D * >(argp1); { try { delete arg1; @@ -36732,24 +36829,24 @@ fail: } -SWIGINTERN PyObject *_wrap_Detector2D_clone(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_NewDetec2D_clone(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - Detector2D *arg1 = (Detector2D *) 0 ; + NewDetec2D *arg1 = (NewDetec2D *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; - Detector2D *result = 0 ; + NewDetec2D *result = 0 ; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Detector2D, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_NewDetec2D, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Detector2D_clone" "', argument " "1"" of type '" "Detector2D const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NewDetec2D_clone" "', argument " "1"" of type '" "NewDetec2D const *""'"); } - arg1 = reinterpret_cast< Detector2D * >(argp1); + arg1 = reinterpret_cast< NewDetec2D * >(argp1); { try { - result = (Detector2D *)((Detector2D const *)arg1)->clone(); + result = (NewDetec2D *)((NewDetec2D const *)arg1)->clone(); } catch (const std::exception& ex) { // message shown in the Python interpreter const std::string msg { @@ -36758,16 +36855,16 @@ SWIGINTERN PyObject *_wrap_Detector2D_clone(PyObject *self, PyObject *args) { SWIG_exception(SWIG_RuntimeError, msg.c_str()); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Detector2D, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_NewDetec2D, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Detector2D_className(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_NewDetec2D_className(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - Detector2D *arg1 = (Detector2D *) 0 ; + NewDetec2D *arg1 = (NewDetec2D *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; @@ -36775,14 +36872,14 @@ SWIGINTERN PyObject *_wrap_Detector2D_className(PyObject *self, PyObject *args) if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Detector2D, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_NewDetec2D, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Detector2D_className" "', argument " "1"" of type '" "Detector2D const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NewDetec2D_className" "', argument " "1"" of type '" "NewDetec2D const *""'"); } - arg1 = reinterpret_cast< Detector2D * >(argp1); + arg1 = reinterpret_cast< NewDetec2D * >(argp1); { try { - result = ((Detector2D const *)arg1)->className(); + result = ((NewDetec2D const *)arg1)->className(); } catch (const std::exception& ex) { // message shown in the Python interpreter const std::string msg { @@ -36798,9 +36895,9 @@ fail: } -SWIGINTERN PyObject *_wrap_Detector2D_createPixel(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_NewDetec2D_createPixel(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - Detector2D *arg1 = (Detector2D *) 0 ; + NewDetec2D *arg1 = (NewDetec2D *) 0 ; size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -36809,20 +36906,20 @@ SWIGINTERN PyObject *_wrap_Detector2D_createPixel(PyObject *self, PyObject *args PyObject *swig_obj[2] ; Pixel *result = 0 ; - if (!SWIG_Python_UnpackTuple(args, "Detector2D_createPixel", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Detector2D, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "NewDetec2D_createPixel", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_NewDetec2D, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Detector2D_createPixel" "', argument " "1"" of type '" "Detector2D const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NewDetec2D_createPixel" "', argument " "1"" of type '" "NewDetec2D const *""'"); } - arg1 = reinterpret_cast< Detector2D * >(argp1); + arg1 = reinterpret_cast< NewDetec2D * >(argp1); ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Detector2D_createPixel" "', argument " "2"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NewDetec2D_createPixel" "', argument " "2"" of type '" "size_t""'"); } arg2 = static_cast< size_t >(val2); { try { - result = (Pixel *)((Detector2D const *)arg1)->createPixel(arg2); + result = (Pixel *)((NewDetec2D const *)arg1)->createPixel(arg2); } catch (const std::exception& ex) { // message shown in the Python interpreter const std::string msg { @@ -36838,9 +36935,9 @@ fail: } -SWIGINTERN PyObject *_wrap_Detector2D_indexOfSpecular(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_NewDetec2D_indexOfSpecular(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - Detector2D *arg1 = (Detector2D *) 0 ; + NewDetec2D *arg1 = (NewDetec2D *) 0 ; Beam *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -36849,23 +36946,23 @@ SWIGINTERN PyObject *_wrap_Detector2D_indexOfSpecular(PyObject *self, PyObject * PyObject *swig_obj[2] ; size_t result; - if (!SWIG_Python_UnpackTuple(args, "Detector2D_indexOfSpecular", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Detector2D, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "NewDetec2D_indexOfSpecular", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_NewDetec2D, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Detector2D_indexOfSpecular" "', argument " "1"" of type '" "Detector2D const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NewDetec2D_indexOfSpecular" "', argument " "1"" of type '" "NewDetec2D const *""'"); } - arg1 = reinterpret_cast< Detector2D * >(argp1); + arg1 = reinterpret_cast< NewDetec2D * >(argp1); res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Beam, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Detector2D_indexOfSpecular" "', argument " "2"" of type '" "Beam const &""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "NewDetec2D_indexOfSpecular" "', argument " "2"" of type '" "Beam const &""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Detector2D_indexOfSpecular" "', argument " "2"" of type '" "Beam const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "NewDetec2D_indexOfSpecular" "', argument " "2"" of type '" "Beam const &""'"); } arg2 = reinterpret_cast< Beam * >(argp2); { try { - result = ((Detector2D const *)arg1)->indexOfSpecular((Beam const &)*arg2); + result = ((NewDetec2D const *)arg1)->indexOfSpecular((Beam const &)*arg2); } catch (const std::exception& ex) { // message shown in the Python interpreter const std::string msg { @@ -36881,14 +36978,14 @@ fail: } -SWIGINTERN PyObject *Detector2D_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *NewDetec2D_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_Detector2D, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_NewDetec2D, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } -SWIGINTERN PyObject *Detector2D_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *NewDetec2D_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { return SWIG_Python_InitShadowInstance(args); } @@ -42621,17 +42718,22 @@ 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(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max)\n" - "new_Detector2D(double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, double center_phi, double center_alpha) -> Detector2D\n" - ""}, - { "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"}, - { "Detector2D_createPixel", _wrap_Detector2D_createPixel, METH_VARARGS, "Detector2D_createPixel(Detector2D self, size_t index) -> Pixel *"}, - { "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}, + { "new_OldDetec2D", _wrap_new_OldDetec2D, METH_VARARGS, "new_OldDetec2D(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) -> OldDetec2D"}, + { "delete_OldDetec2D", _wrap_delete_OldDetec2D, METH_O, "delete_OldDetec2D(OldDetec2D self)"}, + { "OldDetec2D_clone", _wrap_OldDetec2D_clone, METH_O, "OldDetec2D_clone(OldDetec2D self) -> OldDetec2D"}, + { "OldDetec2D_className", _wrap_OldDetec2D_className, METH_O, "OldDetec2D_className(OldDetec2D self) -> std::string"}, + { "OldDetec2D_createPixel", _wrap_OldDetec2D_createPixel, METH_VARARGS, "OldDetec2D_createPixel(OldDetec2D self, size_t index) -> Pixel *"}, + { "OldDetec2D_indexOfSpecular", _wrap_OldDetec2D_indexOfSpecular, METH_VARARGS, "OldDetec2D_indexOfSpecular(OldDetec2D self, Beam beam) -> size_t"}, + { "OldDetec2D_swigregister", OldDetec2D_swigregister, METH_O, NULL}, + { "OldDetec2D_swiginit", OldDetec2D_swiginit, METH_VARARGS, NULL}, + { "new_NewDetec2D", _wrap_new_NewDetec2D, METH_VARARGS, "new_NewDetec2D(double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, double center_phi, double center_alpha) -> NewDetec2D"}, + { "delete_NewDetec2D", _wrap_delete_NewDetec2D, METH_O, "delete_NewDetec2D(NewDetec2D self)"}, + { "NewDetec2D_clone", _wrap_NewDetec2D_clone, METH_O, "NewDetec2D_clone(NewDetec2D self) -> NewDetec2D"}, + { "NewDetec2D_className", _wrap_NewDetec2D_className, METH_O, "NewDetec2D_className(NewDetec2D self) -> std::string"}, + { "NewDetec2D_createPixel", _wrap_NewDetec2D_createPixel, METH_VARARGS, "NewDetec2D_createPixel(NewDetec2D self, size_t index) -> Pixel *"}, + { "NewDetec2D_indexOfSpecular", _wrap_NewDetec2D_indexOfSpecular, METH_VARARGS, "NewDetec2D_indexOfSpecular(NewDetec2D self, Beam beam) -> size_t"}, + { "NewDetec2D_swigregister", NewDetec2D_swigregister, METH_O, NULL}, + { "NewDetec2D_swiginit", NewDetec2D_swiginit, METH_VARARGS, NULL}, { "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" @@ -42716,9 +42818,6 @@ static PyMethodDef SwigMethods[] = { static void *_p_BeamTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((ICloneable *) ((Beam *) x)); } -static void *_p_Detector2DTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((ICloneable *) (IDetector *) ((Detector2D *) x)); -} static void *_p_EllipseTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((ICloneable *) (IShape2D *) ((Ellipse *) x)); } @@ -42749,6 +42848,12 @@ static void *_p_IShape2DTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) static void *_p_LineTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((ICloneable *) (IShape2D *) ((Line *) x)); } +static void *_p_NewDetec2DTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((ICloneable *) (IDetector *) ((NewDetec2D *) x)); +} +static void *_p_OldDetec2DTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((ICloneable *) (IDetector *) ((OldDetec2D *) x)); +} static void *_p_PolygonTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((ICloneable *) (IShape2D *) ((Polygon *) x)); } @@ -42764,8 +42869,11 @@ static void *_p_SphericalDetectorTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(ne static void *_p_VerticalLineTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((ICloneable *) (IShape2D *) ((VerticalLine *) x)); } -static void *_p_Detector2DTo_p_IDetector(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((IDetector *) ((Detector2D *) x)); +static void *_p_NewDetec2DTo_p_IDetector(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((IDetector *) ((NewDetec2D *) x)); +} +static void *_p_OldDetec2DTo_p_IDetector(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((IDetector *) ((OldDetec2D *) x)); } static void *_p_SphericalDetectorTo_p_IDetector(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IDetector *) ((SphericalDetector *) x)); @@ -42779,9 +42887,6 @@ static void *_p_FootprintSquareTo_p_IFootprint(void *x, int *SWIGUNUSEDPARM(newm static void *_p_BeamTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((INode *) ((Beam *) x)); } -static void *_p_Detector2DTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((INode *) (IDetector *) ((Detector2D *) x)); -} static void *_p_FootprintGaussTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((INode *) (IFootprint *) ((FootprintGauss *) x)); } @@ -42800,9 +42905,15 @@ static void *_p_IFootprintTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { static void *_p_IResolutionFunction2DTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((INode *) ((IResolutionFunction2D *) x)); } +static void *_p_NewDetec2DTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((INode *) (IDetector *) ((NewDetec2D *) x)); +} static void *_p_OffspecDetectorTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((INode *) ((OffspecDetector *) x)); } +static void *_p_OldDetec2DTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((INode *) (IDetector *) ((OldDetec2D *) x)); +} static void *_p_ResolutionFunction2DGaussianTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((INode *) (IResolutionFunction2D *) ((ResolutionFunction2DGaussian *) x)); } @@ -42834,7 +42945,6 @@ static swig_type_info _swigt__p_Beam = {"_p_Beam", "Beam *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Bin1D = {"_p_Bin1D", "Bin1D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Coordinate = {"_p_Coordinate", "Coordinate *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Datafield = {"_p_Datafield", "Datafield *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Detector2D = {"_p_Detector2D", "Detector2D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Ellipse = {"_p_Ellipse", "Ellipse *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_FootprintGauss = {"_p_FootprintGauss", "FootprintGauss *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_FootprintSquare = {"_p_FootprintSquare", "FootprintSquare *", 0, 0, (void*)0, 0}; @@ -42850,7 +42960,9 @@ static swig_type_info _swigt__p_IShape2D = {"_p_IShape2D", "IShape2D *", 0, 0, ( static swig_type_info _swigt__p_ImportSettings1D = {"_p_ImportSettings1D", "ImportSettings1D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Line = {"_p_Line", "Line *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_MaskStack = {"_p_MaskStack", "MaskStack *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_NewDetec2D = {"_p_NewDetec2D", "NewDetec2D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_OffspecDetector = {"_p_OffspecDetector", "OffspecDetector *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_OldDetec2D = {"_p_OldDetec2D", "OldDetec2D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Pixel = {"_p_Pixel", "Pixel *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_PolFilter = {"_p_PolFilter", "PolFilter *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Polygon = {"_p_Polygon", "Polygon *", 0, 0, (void*)0, 0}; @@ -42921,7 +43033,6 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Bin1D, &_swigt__p_Coordinate, &_swigt__p_Datafield, - &_swigt__p_Detector2D, &_swigt__p_Ellipse, &_swigt__p_FootprintGauss, &_swigt__p_FootprintSquare, @@ -42937,7 +43048,9 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_ImportSettings1D, &_swigt__p_Line, &_swigt__p_MaskStack, + &_swigt__p_NewDetec2D, &_swigt__p_OffspecDetector, + &_swigt__p_OldDetec2D, &_swigt__p_Pixel, &_swigt__p_PolFilter, &_swigt__p_Polygon, @@ -43008,23 +43121,24 @@ static swig_cast_info _swigc__p_Beam[] = { {&_swigt__p_Beam, 0, 0, 0},{0, 0, 0, static swig_cast_info _swigc__p_Bin1D[] = { {&_swigt__p_Bin1D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Coordinate[] = { {&_swigt__p_Coordinate, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Datafield[] = { {&_swigt__p_Datafield, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Detector2D[] = { {&_swigt__p_Detector2D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Ellipse[] = { {&_swigt__p_Ellipse, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_FootprintGauss[] = { {&_swigt__p_FootprintGauss, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_FootprintSquare[] = { {&_swigt__p_FootprintSquare, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Frame[] = { {&_swigt__p_Frame, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_HorizontalLine[] = { {&_swigt__p_HorizontalLine, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ICloneable[] = { {&_swigt__p_ICloneable, 0, 0, 0}, {&_swigt__p_Beam, _p_BeamTo_p_ICloneable, 0, 0}, {&_swigt__p_Detector2D, _p_Detector2DTo_p_ICloneable, 0, 0}, {&_swigt__p_Ellipse, _p_EllipseTo_p_ICloneable, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_ICloneable, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_ICloneable, 0, 0}, {&_swigt__p_HorizontalLine, _p_HorizontalLineTo_p_ICloneable, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_ICloneable, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_ICloneable, 0, 0}, {&_swigt__p_IFootprint, _p_IFootprintTo_p_ICloneable, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_ICloneable, 0, 0}, {&_swigt__p_IShape2D, _p_IShape2DTo_p_ICloneable, 0, 0}, {&_swigt__p_Line, _p_LineTo_p_ICloneable, 0, 0}, {&_swigt__p_Polygon, _p_PolygonTo_p_ICloneable, 0, 0}, {&_swigt__p_Rectangle, _p_RectangleTo_p_ICloneable, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_ICloneable, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_ICloneable, 0, 0}, {&_swigt__p_VerticalLine, _p_VerticalLineTo_p_ICloneable, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_IDetector[] = { {&_swigt__p_IDetector, 0, 0, 0}, {&_swigt__p_Detector2D, _p_Detector2DTo_p_IDetector, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_IDetector, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ICloneable[] = { {&_swigt__p_ICloneable, 0, 0, 0}, {&_swigt__p_Beam, _p_BeamTo_p_ICloneable, 0, 0}, {&_swigt__p_Ellipse, _p_EllipseTo_p_ICloneable, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_ICloneable, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_ICloneable, 0, 0}, {&_swigt__p_HorizontalLine, _p_HorizontalLineTo_p_ICloneable, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_ICloneable, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_ICloneable, 0, 0}, {&_swigt__p_IFootprint, _p_IFootprintTo_p_ICloneable, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_ICloneable, 0, 0}, {&_swigt__p_IShape2D, _p_IShape2DTo_p_ICloneable, 0, 0}, {&_swigt__p_Line, _p_LineTo_p_ICloneable, 0, 0}, {&_swigt__p_NewDetec2D, _p_NewDetec2DTo_p_ICloneable, 0, 0}, {&_swigt__p_OldDetec2D, _p_OldDetec2DTo_p_ICloneable, 0, 0}, {&_swigt__p_Polygon, _p_PolygonTo_p_ICloneable, 0, 0}, {&_swigt__p_Rectangle, _p_RectangleTo_p_ICloneable, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_ICloneable, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_ICloneable, 0, 0}, {&_swigt__p_VerticalLine, _p_VerticalLineTo_p_ICloneable, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_IDetector[] = { {&_swigt__p_IDetector, 0, 0, 0}, {&_swigt__p_NewDetec2D, _p_NewDetec2DTo_p_IDetector, 0, 0}, {&_swigt__p_OldDetec2D, _p_OldDetec2DTo_p_IDetector, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_IDetector, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IDetectorResolution[] = { {&_swigt__p_IDetectorResolution, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IFootprint[] = { {&_swigt__p_IFootprint, 0, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_IFootprint, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_IFootprint, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_INode[] = { {&_swigt__p_INode, 0, 0, 0}, {&_swigt__p_Beam, _p_BeamTo_p_INode, 0, 0}, {&_swigt__p_Detector2D, _p_Detector2DTo_p_INode, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_INode, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_INode, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_INode, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_INode, 0, 0}, {&_swigt__p_IFootprint, _p_IFootprintTo_p_INode, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_INode, 0, 0}, {&_swigt__p_OffspecDetector, _p_OffspecDetectorTo_p_INode, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_INode, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_INode, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_INode[] = { {&_swigt__p_INode, 0, 0, 0}, {&_swigt__p_Beam, _p_BeamTo_p_INode, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_INode, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_INode, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_INode, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_INode, 0, 0}, {&_swigt__p_IFootprint, _p_IFootprintTo_p_INode, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_INode, 0, 0}, {&_swigt__p_NewDetec2D, _p_NewDetec2DTo_p_INode, 0, 0}, {&_swigt__p_OffspecDetector, _p_OffspecDetectorTo_p_INode, 0, 0}, {&_swigt__p_OldDetec2D, _p_OldDetec2DTo_p_INode, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_INode, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_INode, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IResolutionFunction2D[] = { {&_swigt__p_IResolutionFunction2D, 0, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_IResolutionFunction2D, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IShape2D[] = { {&_swigt__p_IShape2D, 0, 0, 0}, {&_swigt__p_Ellipse, _p_EllipseTo_p_IShape2D, 0, 0}, {&_swigt__p_HorizontalLine, _p_HorizontalLineTo_p_IShape2D, 0, 0}, {&_swigt__p_Line, _p_LineTo_p_IShape2D, 0, 0}, {&_swigt__p_Polygon, _p_PolygonTo_p_IShape2D, 0, 0}, {&_swigt__p_Rectangle, _p_RectangleTo_p_IShape2D, 0, 0}, {&_swigt__p_VerticalLine, _p_VerticalLineTo_p_IShape2D, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ImportSettings1D[] = { {&_swigt__p_ImportSettings1D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Line[] = { {&_swigt__p_Line, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_MaskStack[] = { {&_swigt__p_MaskStack, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_NewDetec2D[] = { {&_swigt__p_NewDetec2D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_OffspecDetector[] = { {&_swigt__p_OffspecDetector, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_OldDetec2D[] = { {&_swigt__p_OldDetec2D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Pixel[] = { {&_swigt__p_Pixel, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PolFilter[] = { {&_swigt__p_PolFilter, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Polygon[] = { {&_swigt__p_Polygon, 0, 0, 0},{0, 0, 0, 0}}; @@ -43095,7 +43209,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Bin1D, _swigc__p_Coordinate, _swigc__p_Datafield, - _swigc__p_Detector2D, _swigc__p_Ellipse, _swigc__p_FootprintGauss, _swigc__p_FootprintSquare, @@ -43111,7 +43224,9 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_ImportSettings1D, _swigc__p_Line, _swigc__p_MaskStack, + _swigc__p_NewDetec2D, _swigc__p_OffspecDetector, + _swigc__p_OldDetec2D, _swigc__p_Pixel, _swigc__p_PolFilter, _swigc__p_Polygon, diff --git a/rawEx/fit/scatter2d/consecutive_fitting.py b/rawEx/fit/scatter2d/consecutive_fitting.py index 0a34893aef2..b194b46aeb7 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 5a7d75af8e2..92abb60b70b 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(nx, -1.7*deg, 1.7*deg, ny, 0, 1.84*deg) + return ba.OldDetec2D(nx, -1.7*deg, 1.7*deg, ny, 0, 1.84*deg) def create_simulation(P): diff --git a/rawEx/fit/scatter2d/fit2d.py b/rawEx/fit/scatter2d/fit2d.py index 946061b4141..e525bc61192 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 3afeac3cc07..ddc62eafaa6 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(n, -1.5*deg, 1.5*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 3*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 0777b7c9645..9e40a39cd5b 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 87aaf0e66cd..16fdbdb42ad 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/fit/scatter2d/model2_hexlattice.py b/rawEx/fit/scatter2d/model2_hexlattice.py index 4cc4bf83881..971c1b31f47 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 278c6c9612f..48e707cde24 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(n, -1.5*deg, 1.5*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 2*deg) return ba.ScatteringSimulation(beam, get_sample(P), detector) diff --git a/rawEx/offspec/OffspecResolved.py b/rawEx/offspec/OffspecResolved.py index 3be15c99c68..9520d128cc0 100755 --- a/rawEx/offspec/OffspecResolved.py +++ b/rawEx/offspec/OffspecResolved.py @@ -47,7 +47,7 @@ def simulate(sample): af = 1. * deg da = 0.03 * deg - detector = ba.Detector2D(501, -2*deg, 2*deg, 1, af - da, af + da) + detector = ba.OldDetec2D(501, -2*deg, 2*deg, 1, af - da, af + da) sim = ba.ScatteringSimulation(beam, sample, detector) return sim.simulate().flat() diff --git a/rawEx/scatter2d/ApproximationDA.py b/rawEx/scatter2d/ApproximationDA.py index 941bf92323d..89c2015217b 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/ApproximationLMA.py b/rawEx/scatter2d/ApproximationLMA.py index 8ee00980149..6c4be03b9ba 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/ApproximationSSCA.py b/rawEx/scatter2d/ApproximationSSCA.py index 91f8871a841..cdc976b6630 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/BeamDivergence.py b/rawEx/scatter2d/BeamDivergence.py index 246cde059d9..4f08595862e 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 6a16be80a6e..4471d1ca73e 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/BoxesWithSpecularPeak.py b/rawEx/scatter2d/BoxesWithSpecularPeak.py index 5e790a1661f..ab6210c8b18 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) simulation.options().setUseAvgMaterials(True) simulation.options().setIncludeSpecular(True) diff --git a/rawEx/scatter2d/ConstantBackground.py b/rawEx/scatter2d/ConstantBackground.py index 7b279210cfb..a86ad89836e 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*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 1ddab7c36a5..441e4266555 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CoreShellNanoparticles2.py b/rawEx/scatter2d/CoreShellNanoparticles2.py index cbd2503ea32..5bfb4201a80 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CorrelatedRoughness.py b/rawEx/scatter2d/CorrelatedRoughness.py index 7eab5ac9b8c..155ecefa100 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(n, -0.5*deg, 0.5*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CosineRipplesAtRectLattice.py b/rawEx/scatter2d/CosineRipplesAtRectLattice.py index dfbd73ddbc1..a25f93b279a 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(n, -1.5*deg, 1.5*deg, n, 0, 2.5*deg) + detector = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 2.5*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CustomFormFactor.py b/rawEx/scatter2d/CustomFormFactor.py index 65f45306969..f6e60b57835 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(n, -1*deg, 1*deg, n, 0, 2*deg) + det = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 006e695d076..44835f8c584 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/scatter2d/CylindersAndPrisms.py b/rawEx/scatter2d/CylindersAndPrisms.py index 4a18b4d371b..a9e2b0b05e4 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/CylindersInAverageLayer.py b/rawEx/scatter2d/CylindersInAverageLayer.py index 06f0692ef61..edfbac5d146 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 cf832d92721..53589e42d73 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/DodecahedraSAS.py b/rawEx/scatter2d/DodecahedraSAS.py index ec14a789627..dc6926216a5 100755 --- a/rawEx/scatter2d/DodecahedraSAS.py +++ b/rawEx/scatter2d/DodecahedraSAS.py @@ -36,7 +36,7 @@ def get_simulation(sample): # Detector opposite to source: n = <%= sm ? 11 : 200 %> # number of pixels per direction angmax = 5*deg - det = ba.Detector2D(n, -angmax, +angmax, n, -angmax, +angmax) + det = ba.OldDetec2D(n, -angmax, +angmax, n, -angmax, +angmax) return ba.ScatteringSimulation(beam, sample, det) diff --git a/rawEx/scatter2d/FindPeaks.py b/rawEx/scatter2d/FindPeaks.py index c1eeb0586d3..1420f989a43 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(n, -0.5*deg, 0.5*deg, n, 0, 0.5*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 0.5*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 f02d14ef215..736e5533931 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 db88cf81d04..759daf6f6ba 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(n, -1*deg, 1*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference1DLattice.py b/rawEx/scatter2d/Interference1DLattice.py index 37e062bd9a5..5390ca6bb69 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(n, -1*deg, 1*deg, n, 0, 2*deg) + det = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*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 34029da485a..4a3ed17f626 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference2DCenteredSquareLattice.py b/rawEx/scatter2d/Interference2DCenteredSquareLattice.py index 29430035ddc..f5115dd9f12 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference2DParacrystal.py b/rawEx/scatter2d/Interference2DParacrystal.py index 2ce96e299a9..5a2c2b33422 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference2DRotatedSquareLattice.py b/rawEx/scatter2d/Interference2DRotatedSquareLattice.py index db2f3f5fbdb..7d1a21dc7b3 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Interference2DSquareFiniteLattice.py b/rawEx/scatter2d/Interference2DSquareFiniteLattice.py index 097e20e2cf6..358e2ccb92c 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/LargeParticlesFormFactor.py b/rawEx/scatter2d/LargeParticlesFormFactor.py index 2f5b0f388e0..fb7c227c584 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(n, -1.5*deg, 1.5*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -1.5*deg, 1.5*deg, n, 0, 3*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 0283489535c..f3e1b997222 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/MagneticCylinders1.py b/rawEx/scatter2d/MagneticCylinders1.py index f5adba45cff..3f0dce76990 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(n, 0, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, 0, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/MagneticCylinders2.py b/rawEx/scatter2d/MagneticCylinders2.py index 22e56954044..115b95cb6cf 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) beam.setPolarization(pol_dir) detector.setAnalyzer(z_up) diff --git a/rawEx/scatter2d/MagneticSpheres.py b/rawEx/scatter2d/MagneticSpheres.py index 40d3aa4c133..99999a3d771 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(n, -3*deg, 3*deg, n, 0, 4*deg) + detector = ba.OldDetec2D(n, -3*deg, 3*deg, n, 0, 4*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 60195155ad2..47f63a2bf1c 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Mesocrystal2.py b/rawEx/scatter2d/Mesocrystal2.py index d6bc1dc2d8b..60180a6e210 100755 --- a/rawEx/scatter2d/Mesocrystal2.py +++ b/rawEx/scatter2d/Mesocrystal2.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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/Mesocrystal3.py b/rawEx/scatter2d/Mesocrystal3.py index 028b3c61e58..c6aa83da696 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 d58734c2784..28dccb2f2e8 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, detector) diff --git a/rawEx/scatter2d/ParticleAcrossInterface.py b/rawEx/scatter2d/ParticleAcrossInterface.py index 0078638417e..dd9fcf56464 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/PolarizedSANS.py b/rawEx/scatter2d/PolarizedSANS.py index f8faf476f57..4daf6726e27 100755 --- a/rawEx/scatter2d/PolarizedSANS.py +++ b/rawEx/scatter2d/PolarizedSANS.py @@ -58,7 +58,7 @@ def get_simulation(sample): # Detector opposite to source: angmax = 7*deg - detector = ba.Detector2D(n, -angmax, +angmax, n, -angmax, +angmax) + detector = ba.OldDetec2D(n, -angmax, +angmax, n, -angmax, +angmax) 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 420123e7574..87536021201 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(n, -1*deg, 1*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/PositionVariance.py b/rawEx/scatter2d/PositionVariance.py index c93a3b76b60..041c2d8ae81 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(n, -2*deg, 2*deg, n, 0, 3*deg) + det = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) return ba.ScatteringSimulation(beam, sample, det) diff --git a/rawEx/scatter2d/RectangularGrating.py b/rawEx/scatter2d/RectangularGrating.py index 7247253525f..c780d84f676 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(n, -0.5*deg, 0.5*deg, n, 0, 0.5*deg) + detector = ba.OldDetec2D(n, -0.5*deg, 0.5*deg, n, 0, 0.5*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 9477e7ea4f2..c09d3c7a23b 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(nx, -1.5*deg, 1.5*deg, ny, 0, 3*deg) + detector = ba.OldDetec2D(nx, -1.5*deg, 1.5*deg, ny, 0, 3*deg) results = [] diff --git a/rawEx/scatter2d/RotatedPyramids.py b/rawEx/scatter2d/RotatedPyramids.py index 588f4f02883..71d19fed081 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/SlicedLayer.py b/rawEx/scatter2d/SlicedLayer.py index 04fabea110a..6d939f62060 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(n, -2*deg, 2*deg, n, 0, 2*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 2*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 ea8bb388074..f05f423934e 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(n, -1*deg, 1*deg, n, 0, 1*deg) + detector = ba.OldDetec2D(n, -1*deg, 1*deg, n, 0, 1*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation diff --git a/rawEx/scatter2d/TriangularRipple.py b/rawEx/scatter2d/TriangularRipple.py index 07db413e6d5..a8e1214d8c2 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(n, -2*deg, 2*deg, n, 0, 3*deg) + detector = ba.OldDetec2D(n, -2*deg, 2*deg, n, 0, 3*deg) simulation = ba.ScatteringSimulation(beam, sample, detector) return simulation -- GitLab