Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
e9404ce
WIP: Model based on new temgym_core
uellue Sep 2, 2025
9561e6e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 2, 2025
79c6a9a
Connect model with existing LiberTEM conventions
uellue Sep 3, 2025
095f78c
Get to the bottom of rotation direction
uellue Sep 4, 2025
84adfc1
Adapt to changes in TemGymCore; fix error in scan pos; comprehensive …
uellue Sep 8, 2025
75a0efb
Convert to single coordinate types
uellue Sep 9, 2025
c11dfba
Replace individual center coordinates with `PixelYX`
uellue Sep 9, 2025
aef7c8e
Make sure model is differentiable
uellue Sep 9, 2025
d22177f
WIP forward simulation
uellue Sep 9, 2025
f3cd591
Introduce optional additional coordinate mapping function for simulation
uellue Sep 10, 2025
8bc9d18
Solve precision issues
uellue Sep 11, 2025
71054cb
WIP saving backprojection work
uellue Sep 11, 2025
da41e48
WIP saving progress
uellue Sep 15, 2025
b5f628d
Got previous status quo working
uellue Sep 16, 2025
db16fb3
Example solve for descan error
uellue Sep 16, 2025
fda49a9
Continue work on solvers
uellue Sep 16, 2025
0b5d4e9
WIP transformations on descan error
uellue Sep 17, 2025
f8f4d38
Methods to adjust parameters while keeping the effective descan error
uellue Sep 18, 2025
5ed1e75
Solving for descan error
uellue Sep 19, 2025
9535541
Add optimistix dependency
matbryan52 Oct 1, 2025
6c791a8
Use current main for installation / CI
matbryan52 Oct 1, 2025
9d182df
Drop python 3.9
matbryan52 Oct 1, 2025
047e1a0
Add optax dendency
matbryan52 Oct 1, 2025
0e366a8
Don't cancel-in-progress in CI
matbryan52 Oct 1, 2025
b2551e9
Don't fail-fast, instead
matbryan52 Oct 1, 2025
9927119
Skip using condition
matbryan52 Oct 1, 2025
899fb48
WIP GUI and camera length calibration
uellue Oct 27, 2025
d97b74b
Descan error tilt optimization from reference points
uellue Oct 27, 2025
80d6d8b
Avoid migration from float to jax types
uellue Oct 27, 2025
814a368
Intermediate save
uellue Oct 27, 2025
a27d507
Save point: Correction based on cross correlation
uellue Oct 28, 2025
1ee7603
WIP scale bar works
uellue Oct 28, 2025
8478663
WIP GUI in a class; work towards overfocus
uellue Oct 31, 2025
7858b8b
WIP GUI building
uellue Nov 3, 2025
ddee9e0
GUI split up in two steps
uellue Nov 4, 2025
c0dc2c3
Intermediate save GUI work WIP
uellue Feb 10, 2026
c957d15
Refactor and simplify in preparation of SymPy transition
uellue Mar 16, 2026
c677793
Rename Params4DSTEM to Model4DSTEM
uellue Mar 16, 2026
047adff
Rename params variables to model to be consistent with class name change
uellue Mar 16, 2026
6c05860
Fix the tests to work with sympy and add ray equality operator to the…
Margus2004 Mar 18, 2026
43512ed
Integrate lambdify into tests, insert sympy functions into util/sympy
Margus2004 Mar 19, 2026
62a01d2
Fix some test failure
uellue Mar 18, 2026
3716024
WIP clear up after lambdify changes
uellue Sep 1, 2026
acc9762
Tests pass
uellue Sep 1, 2026
c09932c
Got GUI to work as well
uellue Sep 1, 2026
621825b
WIP fix dependencies to match changes
uellue Sep 2, 2026
7332390
Use lambdify here as well
uellue Sep 2, 2026
7a24fbc
WIP getting the notebook to work
uellue Sep 2, 2026
1ec6f9f
Complete analysis pass
uellue Sep 2, 2026
b19702d
Various fixes from practical testing
uellue Sep 3, 2026
de02454
Fix twotheta calculation
uellue Sep 3, 2026
a002ea1
Utilities for 4DSTEM DM4 files acquired at JEOL NeoARM at CEA
uellue Sep 4, 2026
731f846
GUI refinement
uellue Sep 4, 2026
695b371
Towards practical workflows
uellue Sep 7, 2026
af5ac08
Fix inverted focus
uellue Sep 9, 2026
f096b0e
Invert focus button
uellue Oct 1, 2026
fd0149b
Clean start: Python 3.14
uellue Oct 1, 2026
088eb94
Didn't run any tests for some reason -- investigating
uellue Oct 1, 2026
0f462a4
Fix and restructure dependencies
uellue Oct 1, 2026
faf01e7
Exercise UI in tests
uellue Oct 2, 2026
211e713
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2026
bb61856
Sweeping formatting change
uellue Oct 2, 2026
6863f84
Keep flake8 config
uellue Oct 2, 2026
66f458a
Specify correct version of LiberTEM-panel-ui
uellue Oct 2, 2026
89ce9bf
Fix some deprecation warnings
uellue Oct 2, 2026
7ddde87
Run selected tests without Numba
uellue Oct 2, 2026
b4c663a
Add basic test for smiley
uellue Oct 2, 2026
67dcf20
Test CorrectedPickUDF
uellue Oct 2, 2026
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
20 changes: 10 additions & 10 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.10", "3.11", "3.12"]
python_version: ["3.14", ]
os: [ubuntu-latest, windows-latest, macos-14]
exclude:
- os: macos-14
python_version: "3.9"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
Expand All @@ -30,7 +28,7 @@ jobs:
with:
python-version: '${{ matrix.python_version }}'
- name: install the package
run: python3 -m pip install uv && uv pip install --system .[test]
run: python3 -m pip install uv && uv pip install --system .[test,common,diffraction,gui]
- name: run pytest
run: pytest --cov=microscope_calibration --cov-report=xml --cov-report=term tests/
- name: submit code coverage
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@v7
Expand All @@ -47,22 +46,23 @@ jobs:
with:
python-version: '3.11'
- name: install the package
run: python3 -m pip install uv && uv pip install --system .[test] -r packaging/requirements.txt
run: python3 -m pip install uv && uv pip install --system .[test,common,diffraction,gui] -r packaging/requirements.txt
- name: run pytest
run: pytest --cov=microscope_calibration --cov-report=xml --cov-report=term tests/

numba_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: 'Choose Python version 3.12'
- name: 'Choose Python version 3.14'
uses: actions/setup-python@v7
with:
python-version: '3.12'
python-version: '3.14'
- name: install the package
run: python3 -m pip install uv && uv pip install --system .[test]
run: python3 -m pip install uv && uv pip install --system .[test,common,diffraction,gui]
- name: run pytest
run: NUMBA_DISABLE_JIT=1 pytest --cov=microscope_calibration --cov-report=xml --cov-report=term tests/
# Run only marked tests since many functional tests are very slow without Numba
run: NUMBA_DISABLE_JIT=1 pytest --cov=microscope_calibration --cov-report=xml --cov-report=term -m with_numba tests/
- name: submit code coverage
uses: codecov/codecov-action@v7
env:
Expand Down
11 changes: 7 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pycqa/flake8
rev: 7.4.1
exclude: prototypes/clcalib.ipynb
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.10
hooks:
- id: flake8
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: ["--py39-plus"]
args: ["--py314-plus"]
250 changes: 250 additions & 0 deletions examples/AuEntryWithCollCode163723.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
1 change: 1 addition & 0 deletions examples/defocused_wide.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"0": "/storage/er-c-data/adhoc/livecalibration/2026-08-27-CEA-JEOL/raw/MicroscopeCal/mag60kX_cl80cm_ca150um_z150um_roi.dm4", "1": {"overfocus": 0.00012542767535846512, "scan_pixel_pitch": 2.2362875995440845e-08, "scan_center": {"y": 64.0, "x": 64.0}, "scan_rotation": 0.0, "camera_length": 1.26, "detector_pixel_pitch": 5.9999999999999995e-05, "detector_center": {"y": 256.0, "x": 256.0}, "semiconv": 0.001, "flip_factor": 0.9993577283544929, "descan_error": {"pxo_pxi": 0.0, "pxo_pyi": 0.0, "pyo_pxi": 0.0, "pyo_pyi": 0.0, "sxo_pxi": -1148.5746728148993, "sxo_pyi": 62.21862729837022, "syo_pxi": -78.29870984334525, "syo_pyi": -1417.6246735609502, "offpxi": 0.0, "offpyi": 0.0, "offsxi": -0.00042827525992734233, "offsyi": 0.0007292625394919069}, "detector_rotation": -0.7305988596863205}}
Loading
Loading