Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mlz
BornAgain
Commits
8efbc0c2
Commit
8efbc0c2
authored
Mar 14, 2021
by
Wuttke, Joachim
Browse files
synthetic data with bg + sqrt noise
parent
bb3335cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Examples/fit/gisas2d/fake.py
View file @
8efbc0c2
...
...
@@ -24,13 +24,11 @@ def fake_data():
# Compute model distribution
simulation
=
model
.
get_simulation
(
params
)
simulation
.
runSimulation
()
data
=
simulation
.
result
().
array
()
theory
=
simulation
.
result
().
array
()
# Draw noisy data
np
.
random
.
seed
(
0
)
noise_factor
=
0.1
noisy
=
np
.
random
.
normal
(
data
,
noise_factor
*
np
.
sqrt
(
data
))
noisy
[
noisy
<
0.1
]
=
0.1
data
=
np
.
random
.
normal
(
theory
,
np
.
sqrt
(
theory
))
+
np
.
random
.
poisson
(
3.57
,
theory
.
shape
)
# Save to numpy
np
.
savetxt
(
"gisas-model1.txt.gz"
,
data
)
...
...
Examples/fit/gisas2d/gisas_fit2d.py
View file @
8efbc0c2
...
...
@@ -47,7 +47,7 @@ def get_simulation(params):
"""
Returns a GISAXS simulation with beam and detector defined
"""
intensity
=
1e
8
intensity
=
1e
6
beam
=
ba
.
Beam
(
intensity
,
0.1
*
nm
,
ba
.
Direction
(
0.2
*
deg
,
0
))
det
=
ba
.
SphericalDetector
(
100
,
-
1
*
deg
,
1
*
deg
,
100
,
0
,
2
*
deg
)
sample
=
get_sample
(
params
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment