Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
378d61e
WIP: Model based on new temgym_core
uellue Sep 2, 2025
a69a795
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 2, 2025
adf506f
Connect model with existing LiberTEM conventions
uellue Sep 3, 2025
3d0effd
Get to the bottom of rotation direction
uellue Sep 4, 2025
7fb8f4a
Adapt to changes in TemGymCore; fix error in scan pos; comprehensive …
uellue Sep 8, 2025
64b9360
Convert to single coordinate types
uellue Sep 9, 2025
b401385
Replace individual center coordinates with `PixelYX`
uellue Sep 9, 2025
5bd9bd7
Make sure model is differentiable
uellue Sep 9, 2025
0a5430d
WIP forward simulation
uellue Sep 9, 2025
4da32e3
Introduce optional additional coordinate mapping function for simulation
uellue Sep 10, 2025
829eeed
Solve precision issues
uellue Sep 11, 2025
40e0bab
WIP saving backprojection work
uellue Sep 11, 2025
8c51963
WIP saving progress
uellue Sep 15, 2025
ba97698
Got previous status quo working
uellue Sep 16, 2025
e2fdeb4
Example solve for descan error
uellue Sep 16, 2025
870604a
Continue work on solvers
uellue Sep 16, 2025
2146a19
WIP transformations on descan error
uellue Sep 17, 2025
0b600cd
Methods to adjust parameters while keeping the effective descan error
uellue Sep 18, 2025
99f1be3
Solving for descan error
uellue Sep 19, 2025
087865b
Add optimistix dependency
matbryan52 Oct 1, 2025
ec7211f
Use current main for installation / CI
matbryan52 Oct 1, 2025
60c2243
Drop python 3.9
matbryan52 Oct 1, 2025
8f01796
Add optax dendency
matbryan52 Oct 1, 2025
fb49aa7
Don't cancel-in-progress in CI
matbryan52 Oct 1, 2025
23f8d0d
Don't fail-fast, instead
matbryan52 Oct 1, 2025
f8d3b4c
Skip using condition
matbryan52 Oct 1, 2025
75119a1
WIP GUI and camera length calibration
uellue Oct 27, 2025
586cbca
Descan error tilt optimization from reference points
uellue Oct 27, 2025
da6a670
Avoid migration from float to jax types
uellue Oct 27, 2025
848aefc
Intermediate save
uellue Oct 27, 2025
3f8d641
Save point: Correction based on cross correlation
uellue Oct 28, 2025
f844218
WIP scale bar works
uellue Oct 28, 2025
631328a
WIP GUI in a class; work towards overfocus
uellue Oct 31, 2025
dc555a3
WIP GUI building
uellue Nov 3, 2025
98c2bc0
GUI split up in two steps
uellue Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ concurrency:
jobs:
tests:
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
python_version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-14]
exclude:
- os: macos-14
python_version: "3.9"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
Expand All @@ -39,6 +37,7 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

pinned-requirements:
if: false # skip job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Expand All @@ -52,6 +51,7 @@ jobs:
run: pytest --cov=microscope_calibration --cov-report=xml --cov-report=term tests/

numba_coverage:
if: false # skip job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
exclude: prototypes/clcalib.ipynb
- repo: https://github.com/pycqa/flake8
rev: 7.3.0
hooks:
Expand Down
75 changes: 45 additions & 30 deletions examples/generate.ipynb

Large diffs are not rendered by default.

270 changes: 158 additions & 112 deletions examples/stem_overfocus.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions prototypes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.npy
85 changes: 85 additions & 0 deletions prototypes/BiFeO3EntryWithCollCode29921.cif
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

#(C) 2025 by FIZ Karlsruhe - Leibniz Institute for Information Infrastructure. All rights reserved.
data_29921-ICSD
_database_code_ICSD 29921
_audit_creation_date 2021-08-01
_chemical_name_common 'Bismuth ferrite'
_chemical_formula_structural 'Bi Fe O3'
_chemical_formula_sum 'Bi1 Fe1 O3'
_chemical_name_structure_type LiNbO3
_exptl_crystal_density_diffrn 8.34
_citation_title

;
Rietveld study of the changes of phase composition, crystal structure, and
morphology of BiFeO$_3$ by partial substitution of bismuth with rare-earth
ions
;
loop_
_citation_id
_citation_journal_full
_citation_year
_citation_journal_volume
_citation_page_first
_citation_page_last
_citation_journal_id_ASTM
primary 'Minerals (Basel, Switzerland)' 2021 11 1 11 MBSIBI
loop_
_citation_author_citation_id
_citation_author_name
primary 'Kireva, Maria'
primary 'Tumbalev, Ventsislav'
primary 'Kostov-Kytin, Vladislav'
primary 'Tzvetkov, Peter'
primary 'Kovacheva, Daniela'
_cell_length_a 5.5785(2)
_cell_length_b 5.5785(2)
_cell_length_c 13.8696(5)
_cell_angle_alpha 90.
_cell_angle_beta 90.
_cell_angle_gamma 120.
_cell_volume 373.79
_cell_formula_units_Z 6
_space_group_name_H-M_alt 'R 3 c H'
_space_group_IT_number 161
loop_
_space_group_symop_id
_space_group_symop_operation_xyz
1 '-x+y, y, z+1/2'
2 'x, x-y, z+1/2'
3 '-y, -x, z+1/2'
4 '-x+y, -x, z'
5 '-y, x-y, z'
6 'x, y, z'
7 '-x+y+2/3, y+1/3, z+5/6'
8 'x+2/3, x-y+1/3, z+5/6'
9 '-y+2/3, -x+1/3, z+5/6'
10 '-x+y+2/3, -x+1/3, z+1/3'
11 '-y+2/3, x-y+1/3, z+1/3'
12 'x+2/3, y+1/3, z+1/3'
13 '-x+y+1/3, y+2/3, z+1/6'
14 'x+1/3, x-y+2/3, z+1/6'
15 '-y+1/3, -x+2/3, z+1/6'
16 '-x+y+1/3, -x+2/3, z+2/3'
17 '-y+1/3, x-y+2/3, z+2/3'
18 'x+1/3, y+2/3, z+2/3'
loop_
_atom_type_symbol
_atom_type_oxidation_number
Bi3+ 3
Fe3+ 3
O2- -2
loop_
_atom_site_label
_atom_site_type_symbol
_atom_site_symmetry_multiplicity
_atom_site_Wyckoff_symbol
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_B_iso_or_equiv
_atom_site_occupancy
Bi1 Bi3+ 6 a 0 0 0 1.30(1) 1.
Fe1 Fe3+ 6 a 0 0 0.2206(1) 1.41(1) 1.
O1 O2- 18 b 0.446(4) 0.021(1) 0.9504(3) 1.3(1) 1.
#End of TTdata_29921-ICSD
250 changes: 250 additions & 0 deletions prototypes/EntryWithCollCode163723.cif
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@

#(C) 2025 by FIZ Karlsruhe - Leibniz Institute for Information Infrastructure. All rights reserved.
data_163723-ICSD
_database_code_ICSD 163723
_audit_creation_date 2009-08-01
_chemical_name_common Gold
_chemical_formula_structural Au
_chemical_formula_sum Au1
_chemical_name_structure_type Cu
_exptl_crystal_density_diffrn 19.39
_citation_title 'Isothermal section of the Ce - Au - Sb system at 870 K'
loop_
_citation_id
_citation_journal_full
_citation_year
_citation_journal_volume
_citation_page_first
_citation_page_last
_citation_journal_id_ASTM
primary 'Journal of Alloys and Compounds' 2009 479 184 188 JALCEU
loop_
_citation_author_citation_id
_citation_author_name
primary 'Salamakha, L.P.'
primary 'Bauer, E.'
primary 'Mudryi, S.I.'
primary 'Goncalves, A.P.'
primary 'Almeida, M.'
primary 'Noel, H.'
_cell_length_a 4.0709(2)
_cell_length_b 4.0709(2)
_cell_length_c 4.0709(2)
_cell_angle_alpha 90.
_cell_angle_beta 90.
_cell_angle_gamma 90.
_cell_volume 67.46
_cell_formula_units_Z 4
_space_group_name_H-M_alt 'F m -3 m'
_space_group_IT_number 225
loop_
_space_group_symop_id
_space_group_symop_operation_xyz
1 'z, y, -x'
2 'y, x, -z'
3 'x, z, -y'
4 'z, x, -y'
5 'y, z, -x'
6 'x, y, -z'
7 'z, -y, x'
8 'y, -x, z'
9 'x, -z, y'
10 'z, -x, y'
11 'y, -z, x'
12 'x, -y, z'
13 '-z, y, x'
14 '-y, x, z'
15 '-x, z, y'
16 '-z, x, y'
17 '-y, z, x'
18 '-x, y, z'
19 '-z, -y, -x'
20 '-y, -x, -z'
21 '-x, -z, -y'
22 '-z, -x, -y'
23 '-y, -z, -x'
24 '-x, -y, -z'
25 '-z, -y, x'
26 '-y, -x, z'
27 '-x, -z, y'
28 '-z, -x, y'
29 '-y, -z, x'
30 '-x, -y, z'
31 '-z, y, -x'
32 '-y, x, -z'
33 '-x, z, -y'
34 '-z, x, -y'
35 '-y, z, -x'
36 '-x, y, -z'
37 'z, -y, -x'
38 'y, -x, -z'
39 'x, -z, -y'
40 'z, -x, -y'
41 'y, -z, -x'
42 'x, -y, -z'
43 'z, y, x'
44 'y, x, z'
45 'x, z, y'
46 'z, x, y'
47 'y, z, x'
48 'x, y, z'
49 'z, y+1/2, -x+1/2'
50 'y, x+1/2, -z+1/2'
51 'x, z+1/2, -y+1/2'
52 'z, x+1/2, -y+1/2'
53 'y, z+1/2, -x+1/2'
54 'x, y+1/2, -z+1/2'
55 'z, -y+1/2, x+1/2'
56 'y, -x+1/2, z+1/2'
57 'x, -z+1/2, y+1/2'
58 'z, -x+1/2, y+1/2'
59 'y, -z+1/2, x+1/2'
60 'x, -y+1/2, z+1/2'
61 '-z, y+1/2, x+1/2'
62 '-y, x+1/2, z+1/2'
63 '-x, z+1/2, y+1/2'
64 '-z, x+1/2, y+1/2'
65 '-y, z+1/2, x+1/2'
66 '-x, y+1/2, z+1/2'
67 '-z, -y+1/2, -x+1/2'
68 '-y, -x+1/2, -z+1/2'
69 '-x, -z+1/2, -y+1/2'
70 '-z, -x+1/2, -y+1/2'
71 '-y, -z+1/2, -x+1/2'
72 '-x, -y+1/2, -z+1/2'
73 '-z, -y+1/2, x+1/2'
74 '-y, -x+1/2, z+1/2'
75 '-x, -z+1/2, y+1/2'
76 '-z, -x+1/2, y+1/2'
77 '-y, -z+1/2, x+1/2'
78 '-x, -y+1/2, z+1/2'
79 '-z, y+1/2, -x+1/2'
80 '-y, x+1/2, -z+1/2'
81 '-x, z+1/2, -y+1/2'
82 '-z, x+1/2, -y+1/2'
83 '-y, z+1/2, -x+1/2'
84 '-x, y+1/2, -z+1/2'
85 'z, -y+1/2, -x+1/2'
86 'y, -x+1/2, -z+1/2'
87 'x, -z+1/2, -y+1/2'
88 'z, -x+1/2, -y+1/2'
89 'y, -z+1/2, -x+1/2'
90 'x, -y+1/2, -z+1/2'
91 'z, y+1/2, x+1/2'
92 'y, x+1/2, z+1/2'
93 'x, z+1/2, y+1/2'
94 'z, x+1/2, y+1/2'
95 'y, z+1/2, x+1/2'
96 'x, y+1/2, z+1/2'
97 'z+1/2, y, -x+1/2'
98 'y+1/2, x, -z+1/2'
99 'x+1/2, z, -y+1/2'
100 'z+1/2, x, -y+1/2'
101 'y+1/2, z, -x+1/2'
102 'x+1/2, y, -z+1/2'
103 'z+1/2, -y, x+1/2'
104 'y+1/2, -x, z+1/2'
105 'x+1/2, -z, y+1/2'
106 'z+1/2, -x, y+1/2'
107 'y+1/2, -z, x+1/2'
108 'x+1/2, -y, z+1/2'
109 '-z+1/2, y, x+1/2'
110 '-y+1/2, x, z+1/2'
111 '-x+1/2, z, y+1/2'
112 '-z+1/2, x, y+1/2'
113 '-y+1/2, z, x+1/2'
114 '-x+1/2, y, z+1/2'
115 '-z+1/2, -y, -x+1/2'
116 '-y+1/2, -x, -z+1/2'
117 '-x+1/2, -z, -y+1/2'
118 '-z+1/2, -x, -y+1/2'
119 '-y+1/2, -z, -x+1/2'
120 '-x+1/2, -y, -z+1/2'
121 '-z+1/2, -y, x+1/2'
122 '-y+1/2, -x, z+1/2'
123 '-x+1/2, -z, y+1/2'
124 '-z+1/2, -x, y+1/2'
125 '-y+1/2, -z, x+1/2'
126 '-x+1/2, -y, z+1/2'
127 '-z+1/2, y, -x+1/2'
128 '-y+1/2, x, -z+1/2'
129 '-x+1/2, z, -y+1/2'
130 '-z+1/2, x, -y+1/2'
131 '-y+1/2, z, -x+1/2'
132 '-x+1/2, y, -z+1/2'
133 'z+1/2, -y, -x+1/2'
134 'y+1/2, -x, -z+1/2'
135 'x+1/2, -z, -y+1/2'
136 'z+1/2, -x, -y+1/2'
137 'y+1/2, -z, -x+1/2'
138 'x+1/2, -y, -z+1/2'
139 'z+1/2, y, x+1/2'
140 'y+1/2, x, z+1/2'
141 'x+1/2, z, y+1/2'
142 'z+1/2, x, y+1/2'
143 'y+1/2, z, x+1/2'
144 'x+1/2, y, z+1/2'
145 'z+1/2, y+1/2, -x'
146 'y+1/2, x+1/2, -z'
147 'x+1/2, z+1/2, -y'
148 'z+1/2, x+1/2, -y'
149 'y+1/2, z+1/2, -x'
150 'x+1/2, y+1/2, -z'
151 'z+1/2, -y+1/2, x'
152 'y+1/2, -x+1/2, z'
153 'x+1/2, -z+1/2, y'
154 'z+1/2, -x+1/2, y'
155 'y+1/2, -z+1/2, x'
156 'x+1/2, -y+1/2, z'
157 '-z+1/2, y+1/2, x'
158 '-y+1/2, x+1/2, z'
159 '-x+1/2, z+1/2, y'
160 '-z+1/2, x+1/2, y'
161 '-y+1/2, z+1/2, x'
162 '-x+1/2, y+1/2, z'
163 '-z+1/2, -y+1/2, -x'
164 '-y+1/2, -x+1/2, -z'
165 '-x+1/2, -z+1/2, -y'
166 '-z+1/2, -x+1/2, -y'
167 '-y+1/2, -z+1/2, -x'
168 '-x+1/2, -y+1/2, -z'
169 '-z+1/2, -y+1/2, x'
170 '-y+1/2, -x+1/2, z'
171 '-x+1/2, -z+1/2, y'
172 '-z+1/2, -x+1/2, y'
173 '-y+1/2, -z+1/2, x'
174 '-x+1/2, -y+1/2, z'
175 '-z+1/2, y+1/2, -x'
176 '-y+1/2, x+1/2, -z'
177 '-x+1/2, z+1/2, -y'
178 '-z+1/2, x+1/2, -y'
179 '-y+1/2, z+1/2, -x'
180 '-x+1/2, y+1/2, -z'
181 'z+1/2, -y+1/2, -x'
182 'y+1/2, -x+1/2, -z'
183 'x+1/2, -z+1/2, -y'
184 'z+1/2, -x+1/2, -y'
185 'y+1/2, -z+1/2, -x'
186 'x+1/2, -y+1/2, -z'
187 'z+1/2, y+1/2, x'
188 'y+1/2, x+1/2, z'
189 'x+1/2, z+1/2, y'
190 'z+1/2, x+1/2, y'
191 'y+1/2, z+1/2, x'
192 'x+1/2, y+1/2, z'
loop_
_atom_type_symbol
_atom_type_oxidation_number
Au0+ 0
loop_
_atom_site_label
_atom_site_type_symbol
_atom_site_symmetry_multiplicity
_atom_site_Wyckoff_symbol
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_B_iso_or_equiv
_atom_site_occupancy
Au1 Au0+ 4 a 0 0 0 . 1.
#End of TTdata_163723-ICSD
Loading
Loading