diff --git a/Core/Algorithms/inc/GISASSimulation.h b/Core/Algorithms/inc/GISASSimulation.h index 75f8f8712087fc38430e50f3344df72ac283cf4e..c6db079337b92df535362610887337383d9bdc23 100644 --- a/Core/Algorithms/inc/GISASSimulation.h +++ b/Core/Algorithms/inc/GISASSimulation.h @@ -90,9 +90,15 @@ public: void setDetectorParameters(const OutputData<double> &output_data); void setDetectorParameters(const IHistogram &hisotgram); - //! Sets detector parameters using angle ranges - void setDetectorParameters(size_t n_x, double x_min, double x_max, - size_t n_y, double y_min, double y_max); + //! Sets spherical detector parameters using angle ranges + //! @param n_phi number of phi-axis bins + //! @param phi_min low edge of first phi-bin + //! @param phi_max upper edge of last phi-bin + //! @param n_alpha number of alpha-axis bins + //! @param alpha_min low edge of first alpha-bin + //! @param alpha_max upper edge of last alpha-bin + void setDetectorParameters(size_t n_phi, double phi_min, double phi_max, + size_t n_alpha, double alpha_min, double alpha_max); //! Define resolution function for detector void setDetectorResolutionFunction(const IResolutionFunction2D &resolution_function); diff --git a/Core/Algorithms/inc/IsGISAXSDetector.h b/Core/Algorithms/inc/IsGISAXSDetector.h index 2a79eee0ec14fc9404cd6f2406e6776de135b5b5..4afca2e6af6e1bb1172310acdda16658bbb50616 100644 --- a/Core/Algorithms/inc/IsGISAXSDetector.h +++ b/Core/Algorithms/inc/IsGISAXSDetector.h @@ -26,6 +26,9 @@ class BA_CORE_API_ IsGISAXSDetector : public SphericalDetector { public: IsGISAXSDetector(); + IsGISAXSDetector(size_t n_phi, double phi_min, double phi_max, + size_t n_alpha, double alpha_min, double alpha_max); + IsGISAXSDetector(const IsGISAXSDetector &other); IsGISAXSDetector &operator=(const IsGISAXSDetector &other); diff --git a/Core/Algorithms/inc/RectangularDetector.h b/Core/Algorithms/inc/RectangularDetector.h index 6f0e11e33a142d5a8d9a3e128aa984ee041e1d13..e7acf2cdb1edc4d8548d6b893e9342091db60f5a 100644 --- a/Core/Algorithms/inc/RectangularDetector.h +++ b/Core/Algorithms/inc/RectangularDetector.h @@ -50,7 +50,6 @@ public: //! @param height Height of the detector in mm along y-direction RectangularDetector(int nxbins, double width, int nybins, double height); - RectangularDetector(kvector_t normal_to_detector, kvector_t u_direction); RectangularDetector(const RectangularDetector &other); RectangularDetector &operator=(const RectangularDetector &other); diff --git a/Core/Algorithms/inc/SphericalDetector.h b/Core/Algorithms/inc/SphericalDetector.h index 8f53db764170e63e9ae0efce11e1b7b8f21c7432..1cf211ad38b9bf0a99c7294402409abed7fc5159 100644 --- a/Core/Algorithms/inc/SphericalDetector.h +++ b/Core/Algorithms/inc/SphericalDetector.h @@ -35,6 +35,17 @@ class BA_CORE_API_ SphericalDetector : public IDetector2D { public: SphericalDetector(); + + //! Spherical detector constructor using angle ranges + //! @param n_phi number of phi-axis bins + //! @param phi_min low edge of first phi-bin + //! @param phi_max upper edge of last phi-bin + //! @param n_alpha number of alpha-axis bins + //! @param alpha_min low edge of first alpha-bin + //! @param alpha_max upper edge of last alpha-bin + SphericalDetector(size_t n_phi, double phi_min, double phi_max, + size_t n_alpha, double alpha_min, double alpha_max); + SphericalDetector(const SphericalDetector &other); SphericalDetector &operator=(const SphericalDetector &other); diff --git a/Core/Algorithms/src/GISASSimulation.cpp b/Core/Algorithms/src/GISASSimulation.cpp index bd2e764b9608ba0f31e2cef56ad634b20b6399b1..7b382fb151f386d1203ec634a8b82e2de6208bfd 100644 --- a/Core/Algorithms/src/GISASSimulation.cpp +++ b/Core/Algorithms/src/GISASSimulation.cpp @@ -157,10 +157,10 @@ void GISASSimulation::setDetectorParameters(const IHistogram &hisotgram) setDetectorParameters(*data); } -void GISASSimulation::setDetectorParameters(size_t n_x, double x_min, double x_max, - size_t n_y, double y_min, double y_max) +void GISASSimulation::setDetectorParameters(size_t n_phi, double phi_min, double phi_max, + size_t n_alpha, double alpha_min, double alpha_max) { - m_instrument.setDetectorParameters(n_x, x_min, x_max, n_y, y_min, y_max); + m_instrument.setDetectorParameters(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max); updateIntensityMap(); } diff --git a/Core/Algorithms/src/IsGISAXSDetector.cpp b/Core/Algorithms/src/IsGISAXSDetector.cpp index 53d8fed3154f322eee178f78cd82473321ca5f52..a0ba129124267cdfb30724baf315cd4567adfe81 100644 --- a/Core/Algorithms/src/IsGISAXSDetector.cpp +++ b/Core/Algorithms/src/IsGISAXSDetector.cpp @@ -24,6 +24,14 @@ IsGISAXSDetector::IsGISAXSDetector() init_parameters(); } +IsGISAXSDetector::IsGISAXSDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, + double alpha_min, double alpha_max) +{ + setName(BornAgain::IsGISAXSDetectorType); + init_parameters(); + setDetectorParameters(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max); +} + IsGISAXSDetector::IsGISAXSDetector(const IsGISAXSDetector &other) : SphericalDetector(other) { diff --git a/Core/Algorithms/src/RectangularDetector.cpp b/Core/Algorithms/src/RectangularDetector.cpp index f246500d2bdde22cb4e241a3123e5e14e69e0210..eab8b51ca89e565b8195b893bb2957c7944a922b 100644 --- a/Core/Algorithms/src/RectangularDetector.cpp +++ b/Core/Algorithms/src/RectangularDetector.cpp @@ -41,20 +41,6 @@ RectangularDetector::RectangularDetector(int nxbins, double width, int nybins, d init_parameters(); } -RectangularDetector::RectangularDetector(kvector_t normal_to_detector, kvector_t u_direction) - : m_normal_to_detector(normal_to_detector) - , m_u0(0.0) - , m_v0(0.0) - , m_direction(u_direction) - , m_distance(0.0) - , m_dbeam_u0(0.0) - , m_dbeam_v0(0.0) - , m_detector_arrangement(GENERIC) -{ - setName(BornAgain::RectangularDetectorType); - init_parameters(); -} - RectangularDetector::RectangularDetector(const RectangularDetector &other) : IDetector2D(other) , m_normal_to_detector(other.m_normal_to_detector) @@ -65,7 +51,8 @@ RectangularDetector::RectangularDetector(const RectangularDetector &other) , m_dbeam_u0(other.m_dbeam_u0) , m_dbeam_v0(other.m_dbeam_v0) , m_detector_arrangement(other.m_detector_arrangement) - , m_u_unit(other.m_u_unit), m_v_unit(other.m_v_unit) + , m_u_unit(other.m_u_unit) + , m_v_unit(other.m_v_unit) { setName(BornAgain::RectangularDetectorType); init_parameters(); @@ -93,7 +80,8 @@ void RectangularDetector::init(const GISASSimulation *simulation) initUandV(alpha_i); } -void RectangularDetector::setPosition(const kvector_t &normal_to_detector, double u0, double v0, const kvector_t &direction) +void RectangularDetector::setPosition(const kvector_t &normal_to_detector, + double u0, double v0, const kvector_t &direction) { m_detector_arrangement = GENERIC; m_normal_to_detector = normal_to_detector; @@ -138,15 +126,14 @@ IPixelMap *RectangularDetector::createPixelMap(size_t index) const Bin1D v_bin = v_axis.getBin(v_index); kvector_t corner_position = m_normal_to_detector + (u_bin.m_lower - m_u0)*m_u_unit + (v_bin.m_lower - m_v0)*m_v_unit; -// kvector_t corner_position = m_normal_to_detector -// + (u_bin.m_lower + m_u0)*m_u_unit + (v_bin.m_lower + m_v0)*m_v_unit; kvector_t width = u_bin.getBinSize()*m_u_unit; kvector_t height = v_bin.getBinSize()*m_v_unit; return new RectPixelMap(corner_position, width, height); } -std::string RectangularDetector::addParametersToExternalPool(std::string path, ParameterPool *external_pool, - int copy_number) const +std::string RectangularDetector::addParametersToExternalPool(std::string path, + ParameterPool *external_pool, + int copy_number) const { // add own parameters std::string new_path diff --git a/Core/Algorithms/src/SphericalDetector.cpp b/Core/Algorithms/src/SphericalDetector.cpp index 43d2cc0507ddd5689a5f19b7ebdaa8da9ba593f5..be78192803ff5ab5857c7f3af3ba87fbcc8523a1 100644 --- a/Core/Algorithms/src/SphericalDetector.cpp +++ b/Core/Algorithms/src/SphericalDetector.cpp @@ -30,6 +30,14 @@ SphericalDetector::SphericalDetector() init_parameters(); } +SphericalDetector::SphericalDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, + double alpha_min, double alpha_max) +{ + setName(BornAgain::SphericalDetectorType); + init_parameters(); + setDetectorParameters(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max); +} + SphericalDetector::SphericalDetector(const SphericalDetector &other) : IDetector2D(other) { diff --git a/Core/PythonAPI/src/GISASSimulation.pypp.cpp b/Core/PythonAPI/src/GISASSimulation.pypp.cpp index 37d44aeac806b473627a6837e37b49ce705972ed..3561f1466768145458dfc167a3f8148ecefffc77 100644 --- a/Core/PythonAPI/src/GISASSimulation.pypp.cpp +++ b/Core/PythonAPI/src/GISASSimulation.pypp.cpp @@ -437,8 +437,8 @@ void register_GISASSimulation_class(){ GISASSimulation_exposer.def( "setDetectorParameters" , setDetectorParameters_function_type( &::GISASSimulation::setDetectorParameters ) - , ( bp::arg("n_x"), bp::arg("x_min"), bp::arg("x_max"), bp::arg("n_y"), bp::arg("y_min"), bp::arg("y_max") ) - , "Sets detector parameters using angle ranges." ); + , ( bp::arg("n_phi"), bp::arg("phi_min"), bp::arg("phi_max"), bp::arg("n_alpha"), bp::arg("alpha_min"), bp::arg("alpha_max") ) + , "Sets spherical detector parameters using angle ranges @param n_phi number of phi-axis bins @param phi_min low edge of first phi-bin @param phi_max upper edge of last phi-bin @param n_alpha number of alpha-axis bins @param alpha_min low edge of first alpha-bin @param alpha_max upper edge of last alpha-bin \n\n:Parameters:\n - 'n_phi' - number of phi-axis bins\n - 'phi_min' - low edge of first phi-bin\n - 'phi_max' - upper edge of last phi-bin\n - 'n_alpha' - number of alpha-axis bins\n - 'alpha_min' - low edge of first alpha-bin\n - 'alpha_max' - upper edge of last alpha-bin\n" ); } { //::GISASSimulation::setDetectorResolutionFunction diff --git a/Core/PythonAPI/src/IDetector2D.pypp.cpp b/Core/PythonAPI/src/IDetector2D.pypp.cpp index e72b5865683d0b4ac8f406968a1dc8bbdbc839a4..56370784eb507e470c785275fc56e821745e19ed 100644 --- a/Core/PythonAPI/src/IDetector2D.pypp.cpp +++ b/Core/PythonAPI/src/IDetector2D.pypp.cpp @@ -354,17 +354,6 @@ void register_IDetector2D_class(){ , ( bp::arg("axis0"), bp::arg("axis1") ) , "Sets detector parameters using axes." ); - } - { //::IDetector2D::setDetectorParameters - - typedef void ( ::IDetector2D::*setDetectorParameters_function_type)( ::std::size_t,double,double,::std::size_t,double,double ) ; - - IDetector2D_exposer.def( - "setDetectorParameters" - , setDetectorParameters_function_type( &::IDetector2D::setDetectorParameters ) - , ( bp::arg("n_x"), bp::arg("x_min"), bp::arg("x_max"), bp::arg("n_y"), bp::arg("y_min"), bp::arg("y_max") ) - , "Sets detector parameters using angle ranges." ); - } { //::IParameterized::areParametersChanged diff --git a/Core/PythonAPI/src/IsGISAXSDetector.pypp.cpp b/Core/PythonAPI/src/IsGISAXSDetector.pypp.cpp index 31c564e54b634943751b4aca974dbb2e96335c46..6182a99fd01126bf2b08093817b74fae3185c956 100644 --- a/Core/PythonAPI/src/IsGISAXSDetector.pypp.cpp +++ b/Core/PythonAPI/src/IsGISAXSDetector.pypp.cpp @@ -37,6 +37,13 @@ struct IsGISAXSDetector_wrapper : IsGISAXSDetector, bp::wrapper< IsGISAXSDetecto m_pyobj = 0; } + IsGISAXSDetector_wrapper(::std::size_t n_phi, double phi_min, double phi_max, ::std::size_t n_alpha, double alpha_min, double alpha_max ) + : IsGISAXSDetector( n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max ) + , bp::wrapper< IsGISAXSDetector >(){ + // constructor + m_pyobj = 0; + } + IsGISAXSDetector_wrapper(::IsGISAXSDetector const & other ) : IsGISAXSDetector( boost::ref(other) ) , bp::wrapper< IsGISAXSDetector >(){ @@ -157,6 +164,7 @@ void register_IsGISAXSDetector_class(){ typedef bp::class_< IsGISAXSDetector_wrapper, bp::bases< SphericalDetector >, std::auto_ptr< IsGISAXSDetector_wrapper > > IsGISAXSDetector_exposer_t; IsGISAXSDetector_exposer_t IsGISAXSDetector_exposer = IsGISAXSDetector_exposer_t( "IsGISAXSDetector", "A spherical detector used for validation with IsGISAXS results.", bp::init< >() ); bp::scope IsGISAXSDetector_scope( IsGISAXSDetector_exposer ); + IsGISAXSDetector_exposer.def( bp::init< std::size_t, double, double, std::size_t, double, double >(( bp::arg("n_phi"), bp::arg("phi_min"), bp::arg("phi_max"), bp::arg("n_alpha"), bp::arg("alpha_min"), bp::arg("alpha_max") )) ); IsGISAXSDetector_exposer.def( bp::init< IsGISAXSDetector const & >(( bp::arg("other") )) ); { //::IsGISAXSDetector::clone diff --git a/Core/PythonAPI/src/RectangularDetector.pypp.cpp b/Core/PythonAPI/src/RectangularDetector.pypp.cpp index 50ef43ce114ef7683522fe7634658e4a4cd4b1d7..07f169d6253e747abdaede967a336cb4f73cef28 100644 --- a/Core/PythonAPI/src/RectangularDetector.pypp.cpp +++ b/Core/PythonAPI/src/RectangularDetector.pypp.cpp @@ -37,13 +37,6 @@ struct RectangularDetector_wrapper : RectangularDetector, bp::wrapper< Rectangul m_pyobj = 0; } - RectangularDetector_wrapper(::kvector_t normal_to_detector, ::kvector_t u_direction ) - : RectangularDetector( normal_to_detector, u_direction ) - , bp::wrapper< RectangularDetector >(){ - // constructor - m_pyobj = 0; - } - RectangularDetector_wrapper(::RectangularDetector const & other ) : RectangularDetector( boost::ref(other) ) , bp::wrapper< RectangularDetector >(){ @@ -172,8 +165,7 @@ void register_RectangularDetector_class(){ .value("PERPENDICULAR_TO_REFLECTED_BEAM_DPOS", RectangularDetector::PERPENDICULAR_TO_REFLECTED_BEAM_DPOS) .export_values() ; - RectangularDetector_exposer.def( bp::init< kvector_t, kvector_t >(( bp::arg("normal_to_detector"), bp::arg("u_direction") ), "Rectangular detector constructor @param nxbins Number of bins (pixels) in x-direction @param width Width of the detector in mm along x-direction @param nybins Number of bins (pixels) in y-direction @param height Height of the detector in mm along y-direction \n\n:Parameters:\n - 'nxbins' - Number of bins (pixels) in x-direction\n - 'width' - Width of the detector in mm along x-direction\n - 'nybins' - Number of bins (pixels) in y-direction\n - 'height' - Height of the detector in mm along y-direction\n") ); - RectangularDetector_exposer.def( bp::init< RectangularDetector const & >(( bp::arg("other") )) ); + RectangularDetector_exposer.def( bp::init< RectangularDetector const & >(( bp::arg("other") ), "Rectangular detector constructor @param nxbins Number of bins (pixels) in x-direction @param width Width of the detector in mm along x-direction @param nybins Number of bins (pixels) in y-direction @param height Height of the detector in mm along y-direction \n\n:Parameters:\n - 'nxbins' - Number of bins (pixels) in x-direction\n - 'width' - Width of the detector in mm along x-direction\n - 'nybins' - Number of bins (pixels) in y-direction\n - 'height' - Height of the detector in mm along y-direction\n") ); { //::RectangularDetector::clone typedef ::RectangularDetector * ( ::RectangularDetector::*clone_function_type)( ) const; diff --git a/Core/PythonAPI/src/SphericalDetector.pypp.cpp b/Core/PythonAPI/src/SphericalDetector.pypp.cpp index 830508751d8013a0c73ecb6c15aa44abe48a0ab1..782673d3d69156ad545dab5f3c8a240f0db43ddb 100644 --- a/Core/PythonAPI/src/SphericalDetector.pypp.cpp +++ b/Core/PythonAPI/src/SphericalDetector.pypp.cpp @@ -37,6 +37,13 @@ struct SphericalDetector_wrapper : SphericalDetector, bp::wrapper< SphericalDete m_pyobj = 0; } + SphericalDetector_wrapper(::std::size_t n_phi, double phi_min, double phi_max, ::std::size_t n_alpha, double alpha_min, double alpha_max ) + : SphericalDetector( n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max ) + , bp::wrapper< SphericalDetector >(){ + // constructor + m_pyobj = 0; + } + SphericalDetector_wrapper(::SphericalDetector const & other ) : SphericalDetector( boost::ref(other) ) , bp::wrapper< SphericalDetector >(){ @@ -157,6 +164,7 @@ void register_SphericalDetector_class(){ typedef bp::class_< SphericalDetector_wrapper, bp::bases< IDetector2D >, std::auto_ptr< SphericalDetector_wrapper > > SphericalDetector_exposer_t; SphericalDetector_exposer_t SphericalDetector_exposer = SphericalDetector_exposer_t( "SphericalDetector", "A spherical detector with axes and resolution function.", bp::init< >() ); bp::scope SphericalDetector_scope( SphericalDetector_exposer ); + SphericalDetector_exposer.def( bp::init< std::size_t, double, double, std::size_t, double, double >(( bp::arg("n_phi"), bp::arg("phi_min"), bp::arg("phi_max"), bp::arg("n_alpha"), bp::arg("alpha_min"), bp::arg("alpha_max") ), "Spherical detector constructor using angle ranges @param n_phi number of phi-axis bins @param phi_min low edge of first phi-bin @param phi_max upper edge of last phi-bin @param n_alpha number of alpha-axis bins @param alpha_min low edge of first alpha-bin @param alpha_max upper edge of last alpha-bin \n\n:Parameters:\n - 'n_phi' - number of phi-axis bins\n - 'phi_min' - low edge of first phi-bin\n - 'phi_max' - upper edge of last phi-bin\n - 'n_alpha' - number of alpha-axis bins\n - 'alpha_min' - low edge of first alpha-bin\n - 'alpha_max' - upper edge of last alpha-bin\n") ); SphericalDetector_exposer.def( bp::init< SphericalDetector const & >(( bp::arg("other") )) ); { //::SphericalDetector::clone diff --git a/Tests/FunctionalTests/TestPyCore/cylinders_ba_dwba_size.py b/Tests/FunctionalTests/TestPyCore/cylinders_ba_dwba_size.py index 931f15e01aaac94c7397c358a2859af06c87a22c..4bf751e529896b29d8634d856293a02ed2420a5d 100644 --- a/Tests/FunctionalTests/TestPyCore/cylinders_ba_dwba_size.py +++ b/Tests/FunctionalTests/TestPyCore/cylinders_ba_dwba_size.py @@ -37,8 +37,7 @@ def RunSimulationDWBA(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) @@ -73,8 +72,7 @@ def RunSimulationBA(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) @@ -118,8 +116,7 @@ def RunSimulationBA_Size(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs01.py b/Tests/FunctionalTests/TestPyCore/isgisaxs01.py index e698f68ecb29c364ceaa3a1245189bf79705dc2c..b3eda99476b7e113b0aa47da3519e3eb20622536 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs01.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs01.py @@ -42,8 +42,7 @@ def RunSimulation(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, -1.0*degree, 1.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, -1.0*degree, 1.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs02.py b/Tests/FunctionalTests/TestPyCore/isgisaxs02.py index a340a0c20e9132c86fdf736a53b6420a8fd21f73..e96e1bab55d9d8efee66f207f28176619c44e916 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs02.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs02.py @@ -56,8 +56,7 @@ def RunSimulation(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs04.py b/Tests/FunctionalTests/TestPyCore/isgisaxs04.py index 84d4d0c78cadb7df1cac25082197850f018f297c..7d03316acddc5484b16f147d24a10fe50dc935e4 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs04.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs04.py @@ -40,8 +40,7 @@ def RunSimulation1(): multi_layer.addLayer(substrate_layer) # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0 * angstrom, 0.2 * degree, 0.0 * degree) simulation.setSample(multi_layer) @@ -83,8 +82,7 @@ def RunSimulation2(): # build and run experiment #gsl_set_error_handler_off() simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0 * angstrom, 0.2 * degree, 0.0 * degree) simulation.setSample(multi_layer) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs06.py b/Tests/FunctionalTests/TestPyCore/isgisaxs06.py index 962949be8da213975b62eac3986381c008f60ba4..4e323fa135487cc61dae81a9d5104353479ff393 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs06.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs06.py @@ -41,8 +41,7 @@ def run_simulation_lattice(): multi_layer.addLayer(substrate_layer) # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) @@ -86,8 +85,7 @@ def run_simulation_centered(): multi_layer.addLayer(substrate_layer) # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) @@ -124,8 +122,7 @@ def run_simulation_rotated(): multi_layer.addLayer(substrate_layer) # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) @@ -141,8 +138,7 @@ def run_simulation_variants(): # building simulation simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs07.py b/Tests/FunctionalTests/TestPyCore/isgisaxs07.py index 6b068a739245060ec5ff8e7d27c478e7a08b9735..ab14cbac891ce4c0ab378c83664ecaf777dbd1bc 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs07.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs07.py @@ -102,8 +102,7 @@ def RunSimulation(): #build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 1.0*degree, 100, 0.0*degree, 1.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 1.0*degree, 100, 0.0*degree, 1.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.0*degree, 0.0*degree) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs08.py b/Tests/FunctionalTests/TestPyCore/isgisaxs08.py index 13b38e7cb0d296738398d127884951f125946316..0f8b3a866279cf2ab6b3148c15143080e6cca19a 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs08.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs08.py @@ -42,8 +42,7 @@ def RunSimulation1(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) @@ -83,8 +82,7 @@ def RunSimulation2(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs09.py b/Tests/FunctionalTests/TestPyCore/isgisaxs09.py index c2f53d7705ea80496f7895e8b136420ebe9a22a8..7272a0ade1e461e4ba1f03f2293ca2206daf446c 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs09.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs09.py @@ -39,8 +39,7 @@ def RunSimulation1(): multi_layer.addLayer(substrate_layer) # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) @@ -79,8 +78,7 @@ def RunSimulation2(): multi_layer.addLayer(substrate_layer) # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs10.py b/Tests/FunctionalTests/TestPyCore/isgisaxs10.py index 431fdfe92d31c004d11f30f5687e461d2c9a5809..4390567023cefbbb633d3b2cacefeee4b4bd9a9f 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs10.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs10.py @@ -37,8 +37,7 @@ def RunSimulation(): multi_layer.addLayer(substrate_layer) # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0 * angstrom, 0.2 * degree, 0.0 * degree) simulation.setSample(multi_layer) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs11.py b/Tests/FunctionalTests/TestPyCore/isgisaxs11.py index bd8ccaa47392521484c9499e12a57b68ba6091c4..aa2c1cbc90368b46177720f4f1b551a20c94dbed 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs11.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs11.py @@ -41,8 +41,7 @@ def RunSimulation(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) + detector = IsGISAXSDetector(100, 0.0*degree, 2.0*degree, 100, 0.0*degree, 2.0*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree) simulation.setSample(multi_layer) diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs15.py b/Tests/FunctionalTests/TestPyCore/isgisaxs15.py index 2706933a3471571dad8a221dbfa027e5fe482e45..ad53c611ab78f1f22fda9e5f44e77fc0ec9f40eb 100644 --- a/Tests/FunctionalTests/TestPyCore/isgisaxs15.py +++ b/Tests/FunctionalTests/TestPyCore/isgisaxs15.py @@ -44,8 +44,7 @@ def RunSimulation(): # build and run experiment simulation = GISASSimulation() - detector = IsGISAXSDetector() - detector.setDetectorParameters(150, 0.05*degree, 1.5*degree, 150, 0.05*degree, 1.5*degree) + detector = IsGISAXSDetector(150, 0.05*degree, 1.5*degree, 150, 0.05*degree, 1.5*degree) simulation.setDetector(detector) simulation.setBeamParameters(1.0 * angstrom, 0.2 * degree, 0.0 * degree) diff --git a/dev-tools/python-bindings/settings_core.py b/dev-tools/python-bindings/settings_core.py index 2953dec293eb10740d79093b1217e9e8c36205bb..ad00cfd5d53279f50b5001e123537989110d0c64 100644 --- a/dev-tools/python-bindings/settings_core.py +++ b/dev-tools/python-bindings/settings_core.py @@ -387,7 +387,6 @@ def ManualClassTunings(mb): cl.member_function("createOutputData").call_policies = call_policies.return_value_policy(call_policies.manage_new_object) cl.member_function("createRelativeDifferenceHistogram").call_policies = call_policies.return_value_policy(call_policies.manage_new_object) - cl = mb.class_("Histogram1D") cl.member_function("getBinCenters").exclude() cl.member_function("getBinValues").exclude() @@ -399,7 +398,6 @@ def ManualClassTunings(mb): cl.member_function("getBinValuesNumpy").alias = "getBinValues" cl.member_function("getBinErrorsNumpy").alias = "getBinErrors" - # cl = mb.class_("Histogram2D") for fun in cl.member_functions(): @@ -413,6 +411,9 @@ def ManualClassTunings(mb): # cl.member_function("readHistogram").call_policies = call_policies.return_value_policy(call_policies.manage_new_object) cl.member_function("readIntensityData").call_policies = call_policies.return_value_policy(call_policies.manage_new_object) + cl = mb.class_("IDetector2D") + cl.member_function("setDetectorParameters").exclude() + # excluding specific member functions def ManualExcludeMemberFunctions(mb):