Commit a6c3ff8c authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

corr line length

parent 0af6dc37
Pipeline #33381 passed with stage
in 28 minutes and 46 seconds
......@@ -21,7 +21,8 @@ def fake_data():
# Draw noisy data
np.random.seed(0)
data = np.random.normal(theory, np.sqrt(theory)) + np.random.poisson(bg, theory.shape)
data = np.random.normal(theory, np.sqrt(theory)) + np.random.poisson(
bg, theory.shape)
# Save to numpy
np.savetxt("gisas-model1.txt.gz", data)
......
......@@ -17,8 +17,9 @@ def run_fitting():
fit_objective = ba.FitObjective()
fit_objective.addSimulationAndData(model.get_simulation, real_data)
fit_objective.initPrint(10) # Print on every 10th iteration.
fit_objective.initPlot(10) # Plot on every 10th iteration. Will slow down the fit.
fit_objective.initPrint(10) # Print on every 10th iteration.
fit_objective.initPlot(
10) # Plot on every 10th iteration. Will slow down the fit.
minimizer = ba.Minimizer()
params = model.start_parameters_1()
......
......@@ -6,7 +6,6 @@ Dilute cylinders on a substrate.
import bornagain as ba
from bornagain import deg, nm
mat_vacuum = ba.HomogeneousMaterial("Vacuum", 0, 0)
mat_substrate = ba.HomogeneousMaterial("Substrate", 6e-6, 2e-8)
mat_particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-8)
......@@ -33,13 +32,15 @@ def get_sample(params):
def get_simulation(params):
beam = ba.Beam(10**params['lg(intensity)'], 0.1*nm, ba.Direction(0.2*deg, 0))
beam = ba.Beam(10**params['lg(intensity)'], 0.1*nm,
ba.Direction(0.2*deg, 0))
det = ba.SphericalDetector(100, -1.5*deg, 1.5*deg, 100, 0, 3*deg)
sample = get_sample(params)
simulation = ba.GISASSimulation(beam, sample, det)
if 'lg(background)' in params:
simulation.setBackground(ba.ConstantBackground(10**params['lg(background)']))
simulation.setBackground(
ba.ConstantBackground(10**params['lg(background)']))
return simulation
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment