Skip to content
Snippets Groups Projects
Commit 5315ff2a authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Fitting examples fixed for missed beam intensity

parent 48dc6a07
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
Working with sample parameters.
Variation of SampleParameterIntro.py with the difference that parameter change
is going via assembled simulation object.
is going via top level simulation object.
"""
from __future__ import print_function
......
......@@ -60,6 +60,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -5,7 +5,8 @@ import bornagain as ba
from bornagain import deg, angstrom, nm
def get_sample():
def get_sample(cylinder_height=5.0*nm, cylinder_radius=5.0*nm,
prism_length=5.0*nm, prism_height=5.0*nm):
"""
Returns a sample with uncorrelated cylinders and prisms on a substrate.
"""
......@@ -15,9 +16,9 @@ def get_sample():
m_particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-8)
# collection of particles
cylinder_ff = ba.FormFactorCylinder(1.0*nm, 1.0*nm)
cylinder_ff = ba.FormFactorCylinder(cylinder_radius, cylinder_height)
cylinder = ba.Particle(m_particle, cylinder_ff)
prism_ff = ba.FormFactorPrism3(1.0*nm, 1.0*nm)
prism_ff = ba.FormFactorPrism3(prism_length, prism_height)
prism = ba.Particle(m_particle, prism_ff)
particle_layout = ba.ParticleLayout()
particle_layout.addParticle(cylinder, 0.5)
......@@ -43,6 +44,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -69,8 +69,7 @@ def create_real_data():
real_data.setBinContent(i, noisy_amplitude)
# uncomment line to save generated data on disk
#IntensityDataIOFactory.writeIntensityData(
# real_data, 'refdata_fitcylinderprisms.int')
#ba.IntensityDataIOFactory.writeIntensityData(real_data, 'refdata_fitcylinderprisms.int.gz')
return real_data
......@@ -82,6 +81,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment