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
Merge requests
!2565
start opaque profile example
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
start opaque profile example
opaque_test1
into
main
Overview
0
Commits
4
Pipelines
1
Changes
1
Merged
Wuttke, Joachim
requested to merge
opaque_test1
into
main
8 months ago
Overview
0
Commits
4
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
cb6e8694
4 commits,
8 months ago
1 file
+
60
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
rawEx/varia/OpaqueProfile1.py
0 → 100755
+
60
−
0
Options
#!/usr/bin/env python3
"""
Depth profile of an opaque sample.
"""
import
bornagain
as
ba
from
bornagain
import
angstrom
,
ba_plot
as
bp
,
deg
,
nm
# beam data
ai_min
=
0
# minimum incident angle
ai_max
=
1
*
deg
# maximum incident angle
wl
=
0.03
*
nm
# wavelength in angstroms
# depth position span
z_min
=
-
400
*
nm
z_max
=
100
*
nm
def
get_sample
():
# Define materials
material_vac
=
ba
.
RefractiveMaterial
(
"
Vac
"
,
0
,
0
)
material_A
=
ba
.
RefractiveMaterial
(
"
A
"
,
1e-5
,
3e-6
)
# Define layers
layer_top
=
ba
.
Layer
(
material_vac
)
layer_1
=
ba
.
Layer
(
material_A
,
300
*
nm
)
layer_bot
=
ba
.
Layer
(
material_vac
)
# Define sample
sample
=
ba
.
MultiLayer
()
sample
.
addLayer
(
layer_top
)
sample
.
addLayer
(
layer_1
)
sample
.
addLayer
(
layer_bot
)
return
sample
def
get_simulation
(
sample
):
"""
Returns a depth-probe simulation.
"""
nz
=
bp
.
simargs
[
'
n
'
]
na
=
10
*
nz
scan
=
ba
.
AlphaScan
(
na
,
ai_min
,
ai_max
)
scan
.
setWavelength
(
wl
)
footprint
=
ba
.
FootprintSquare
(
0.01
)
scan
.
setFootprint
(
footprint
)
z_axis
=
ba
.
FixedBinAxis
(
"
z
"
,
nz
,
z_min
,
z_max
)
simulation
=
ba
.
DepthprobeSimulation
(
scan
,
sample
,
z_axis
)
return
simulation
if
__name__
==
'
__main__
'
:
bp
.
parse_args
(
sim_n
=
500
,
aspect
=
'
auto
'
,
intensity_max
=
1
,
intensity_min
=
1e-200
)
sample
=
get_sample
()
simulation
=
get_simulation
(
sample
)
result
=
simulation
.
simulate
()
bp
.
plot_simulation_result
(
result
)
Loading