Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
7f37e61c
Commit
7f37e61c
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
update & fix Examples/fit/specular/Honeycomb_fit.py
parent
3fb622ad
No related branches found
No related tags found
1 merge request
!1201
fix several fit examples
Pipeline
#83788
passed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/fit/specular/Honeycomb_fit.py
+8
-7
8 additions, 7 deletions
Examples/fit/specular/Honeycomb_fit.py
with
8 additions
and
7 deletions
Examples/fit/specular/Honeycomb_fit.py
+
8
−
7
View file @
7f37e61c
...
...
@@ -75,18 +75,16 @@ def get_sample(parameters, sign, ms150=1):
return
sample
def
get_simulation
(
q_axis
,
fitParam
s
,
sign
,
ms150
=
False
):
def
get_simulation
(
q_axis
,
parameter
s
,
sign
,
ms150
=
False
):
n_points
=
25
n_sig
=
3.0
parameters
=
dict
(
fitParams
,
**
fixedParams
)
q_distr
=
ba
.
RangedDistributionGaussian
(
n_points
,
n_sig
)
dq
=
parameters
[
"
dq
"
]
*
q_axis
scan
=
ba
.
QzScan
(
q_axis
)
scan
.
setAbsoluteQResolution
(
q_distr
,
dq
)
scan
.
setAbsoluteQ
Vector
Resolution
(
q_distr
,
dq
)
if
ms150
:
...
...
@@ -97,15 +95,18 @@ def get_simulation(q_axis, fitParams, sign, ms150=False):
sample
=
get_sample
(
parameters
=
parameters
,
sign
=
sign
,
ms150
=
1
)
simulation
=
ba
.
SpecularSimulation
(
scan
,
sample
)
simulation
.
beam
().
setIntensity
(
parameters
[
"
intensity
"
])
simulation
.
setBackground
(
ba
.
ConstantBackground
(
5e-7
))
return
simulation
def
run_simulation
(
q_axis
,
fitParams
,
*
,
sign
,
ms150
=
False
):
simulation
=
get_simulation
(
q_axis
,
fitParams
,
sign
,
ms150
)
return
simulation
.
simulate
()
parameters
=
dict
(
fitParams
,
**
fixedParams
)
simulation
=
get_simulation
(
q_axis
,
parameters
,
sign
,
ms150
)
result
=
simulation
.
simulate
()
result
.
data_field
().
scale
(
parameters
[
"
intensity
"
])
return
result
def
qr
(
result
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment