Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BOZcalc
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
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SCS
BOZcalc
Compare revisions
ba61ee617d692a0df0f48959b990538e3c777b68 to 16b7311c6992d865e033bbd40e600d01503c195f
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
SCS/bozcalc
Select target project
No results found
16b7311c6992d865e033bbd40e600d01503c195f
Select Git revision
Branches
fileupload
master
Swap
Target
SCS/bozcalc
Select target project
SCS/bozcalc
1 result
ba61ee617d692a0df0f48959b990538e3c777b68
Select Git revision
Branches
fileupload
master
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Adds subfigures options
· 289d0e19
Loïc Le Guyader
authored
7 months ago
289d0e19
Adds subfigures options
· 16b7311c
Loïc Le Guyader
authored
7 months ago
See merge request
!26
16b7311c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/BOZcalc/BOZcalc.py
+15
-7
15 additions, 7 deletions
src/BOZcalc/BOZcalc.py
src/BOZcalc/GeoBeams.py
+7
-4
7 additions, 4 deletions
src/BOZcalc/GeoBeams.py
with
22 additions
and
11 deletions
src/BOZcalc/BOZcalc.py
View file @
16b7311c
...
...
@@ -154,10 +154,10 @@ BOZ_CHEM_db = {
}
class
BOZcalc
():
def
__init__
(
self
):
def
__init__
(
self
,
fig
=
None
):
self
.
geo_beams
=
GeoBeams
()
self
.
initWidgets
()
self
.
initFig
()
self
.
initFig
(
fig
)
self
.
init_beam_transport
()
# spot sizes of all beams
...
...
@@ -187,19 +187,27 @@ class BOZcalc():
scale
=
1e6
self
.
widgets
[
v
].
value
=
scale
*
temp
.
elems
[
v
]
def
initFig
(
self
):
def
initFig
(
self
,
fig
=
None
):
"
Creates a figure for the sample plane and detector plane images.
"
plt
.
close
(
'
BOZcalc
'
)
fig
,
(
self
.
ax_sam
,
self
.
ax_det
)
=
plt
.
subplots
(
1
,
2
,
num
=
'
BOZcalc
'
,
figsize
=
(
6
,
3
))
if
fig
is
None
:
plt
.
close
(
'
BOZcalc
'
)
self
.
fig
,
(
self
.
ax_sam
,
self
.
ax_det
)
=
plt
.
subplots
(
1
,
2
,
num
=
'
BOZcalc
'
,
figsize
=
(
6
,
3
))
else
:
self
.
fig
=
fig
self
.
ax_sam
,
self
.
ax_det
=
self
.
fig
.
subplots
(
1
,
2
)
# display scale
self
.
scale
=
1e3
# displayed distances in [mm]
self
.
ax_sam
.
set_title
(
'
Sample plane
'
)
self
.
ax_sam
.
set_xlabel
(
'
x (mm)
'
)
self
.
ax_sam
.
set_ylabel
(
'
y (mm)
'
)
self
.
ax_det
.
set_title
(
'
Detector plane
'
)
self
.
ax_det
.
set_xlabel
(
'
x (mm)
'
)
self
.
ax_det
.
set_ylabel
(
'
y (mm)
'
)
self
.
ax_sam
.
set_aspect
(
'
equal
'
)
self
.
ax_det
.
set_aspect
(
'
equal
'
)
self
.
ax_sam
.
set_xlim
([
-
2
,
2
])
...
...
This diff is collapsed.
Click to expand it.
src/BOZcalc/GeoBeams.py
View file @
16b7311c
...
...
@@ -157,11 +157,14 @@ class GeoBeams:
return
z_x
,
x
,
z_y
,
y
def
plot
(
self
,
conf1
=
None
,
conf2
=
None
):
fig
,
ax
=
plt
.
subplots
(
2
,
1
,
figsize
=
(
6
,
4
),
sharex
=
True
)
def
plot
(
self
,
conf1
=
None
,
conf2
=
None
,
fig
=
None
):
if
fig
is
None
:
fig
,
ax
=
plt
.
subplots
(
2
,
1
,
figsize
=
(
6
,
4
),
sharex
=
True
)
else
:
ax
=
fig
.
subplots
(
2
,
1
,
sharex
=
True
)
ax0in
=
ax
[
0
].
inset_axes
([
0.
1
,
0.
6
5
,
0.2
,
0.
2
5
])
ax1in
=
ax
[
1
].
inset_axes
([
0.
1
,
0.
6
5
,
0.2
,
0.
2
5
])
ax0in
=
ax
[
0
].
inset_axes
([
0.
2
,
0.
5
5
,
0.2
,
0.
3
5
])
ax1in
=
ax
[
1
].
inset_axes
([
0.
2
,
0.
5
5
,
0.2
,
0.
3
5
])
axs
=
[
ax
,
ax0in
,
ax1in
]
if
conf1
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.