diff --git a/Examples/python/simulation/ex06_Reflectometry/BasicSpecularSimulation.py b/Examples/python/simulation/ex06_Reflectometry/BasicSpecularSimulation.py index 18334817c558fef792b9ce2f3460ee8269d895a1..3ede043d668859f2aa6127748480a7dd8c85aa39 100644 --- a/Examples/python/simulation/ex06_Reflectometry/BasicSpecularSimulation.py +++ b/Examples/python/simulation/ex06_Reflectometry/BasicSpecularSimulation.py @@ -34,12 +34,12 @@ def get_sample(): return multi_layer -def get_simulation(): +def get_simulation(scan_size=500): """ Defines and returns a specular simulation. """ simulation = ba.SpecularSimulation() - scan = ba.AngularSpecScan(1.54 * angstrom, 500, + scan = ba.AngularSpecScan(1.54 * angstrom, scan_size, 0.0 * deg, 2.0 * deg) simulation.setScan(scan) return simulation diff --git a/Examples/python/simulation/ex06_Reflectometry/BeamAngularDivergence.py b/Examples/python/simulation/ex06_Reflectometry/BeamAngularDivergence.py index eb30e07e0f5852dd4a364a6a61a65ecda4da36e1..dd3c240875937f9203738f473a5e846cd01290ee 100644 --- a/Examples/python/simulation/ex06_Reflectometry/BeamAngularDivergence.py +++ b/Examples/python/simulation/ex06_Reflectometry/BeamAngularDivergence.py @@ -13,7 +13,6 @@ wavelength = 1.54 * ba.angstrom alpha_i_min = 0.0 * ba.deg # min incident angle, deg alpha_i_max = 2.0 * ba.deg # max incident angle, rad beam_sample_ratio = 0.01 # beam-to-sample size ratio -n_bins = 500 # number of bins in the reflectivity curve # convolution parameters d_ang = 0.01 * ba.deg # spread width for incident angle @@ -67,7 +66,7 @@ def create_real_data(): return ax_values, real_data -def get_simulation(): +def get_simulation(scan_size=500): """ Returns a specular simulation with beam and detector defined. """ @@ -76,7 +75,7 @@ def get_simulation(): # exception is thrown. footprint = ba.FootprintFactorSquare(beam_sample_ratio) - scan = ba.AngularSpecScan(wavelength, n_bins, alpha_i_min, alpha_i_max) + scan = ba.AngularSpecScan(wavelength, scan_size, alpha_i_min, alpha_i_max) scan.setFootprintFactor(footprint) simulation = ba.SpecularSimulation() diff --git a/Examples/python/simulation/ex06_Reflectometry/BeamFullDivergence.py b/Examples/python/simulation/ex06_Reflectometry/BeamFullDivergence.py index 977ea7b663da8ef3b508f831d4a6eaf613df40e3..fc410937be8880cbd05d796670a77ebcdd0aadc6 100644 --- a/Examples/python/simulation/ex06_Reflectometry/BeamFullDivergence.py +++ b/Examples/python/simulation/ex06_Reflectometry/BeamFullDivergence.py @@ -9,7 +9,6 @@ import bornagain as ba wavelength = 1.54 * ba.angstrom alpha_i_min = 0.0 * ba.deg # min incident angle, deg alpha_i_max = 2.0 * ba.deg # max incident angle, rad -n_bins = 500 # number of bins in the reflectivity curve # convolution parameters d_wl = 0.01 * wavelength # spread width for wavelength @@ -51,7 +50,7 @@ def get_sample(): return multi_layer -def get_simulation(): +def get_simulation(scan_size=500): """ Returns a specular simulation with beam and detector defined. """ @@ -62,7 +61,7 @@ def get_simulation(): alpha_distr = ba.DistributionGaussian(0.0, d_ang) wavelength_distr = ba.DistributionGaussian(wavelength, d_wl) simulation = ba.SpecularSimulation() - scan = ba.AngularSpecScan(wavelength, n_bins, alpha_i_min, alpha_i_max) + scan = ba.AngularSpecScan(wavelength, scan_size, alpha_i_min, alpha_i_max) simulation.setScan(scan) simulation.addParameterDistribution("*/Beam/InclinationAngle", alpha_distr, n_points, n_sig) diff --git a/Tests/Functional/Python/PyPersistence/example_template.py b/Tests/Functional/Python/PyPersistence/example_template.py index b70007e130530dc2a192e9271f45613fc3bee1db..390fcfead8fd240c16537440eae7275241e46c68 100644 --- a/Tests/Functional/Python/PyPersistence/example_template.py +++ b/Tests/Functional/Python/PyPersistence/example_template.py @@ -25,13 +25,7 @@ def get_simulation_SpecularSimulation(): """ Returns custom simulation for SpecularSimulation.py. """ - simulation = example.get_simulation() - beam = simulation.getInstrument().getBeam() - wavelength = beam.getWavelength() - axis = simulation.coordinateAxis() - footprint = simulation.footprintFactor() - simulation.setBeamParameters( - wavelength, 10, axis.getMin(), axis.getMax(), footprint) + simulation = example.get_simulation(scan_size=10) return simulation