Skip to content

Commit

Permalink
Merge pull request #279 from bluesky/256-orientation-dict
Browse files Browse the repository at this point in the history
standardize export & restore of diffractometer configuration

Thanks, all, for comments, contributions, and reviews.  This masterpiece is ready to be merged.
  • Loading branch information
prjemian authored Nov 2, 2023
2 parents 360609e + 82eb9b5 commit e7abba8
Show file tree
Hide file tree
Showing 21 changed files with 2,107 additions and 87 deletions.
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ include pyproject.toml
include pytest.ini

recursive-include docs *.rst conf.py Makefile make.bat
recursive-include Makefile README.md *.ipynb resources/*
recursive-include . Makefile README.md *.ipynb resources/*
recursive-include . e4c-config.json
recursive-include . e4c-config.yml

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
16 changes: 16 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ v1.1 (expected 2023-12)

Add new geometries from upstream *libhkl*.

New Features and/or Enhancements
--------------------------------

* Add ``DiffractometerConfiguration`` to export & restore configuration and orientation.
* Add ``Petra3_p23_4c`` diffractometer geometry.
* Add ``Petra3_p23_6c`` diffractometer geometry.
* Add ``SoleilNanoscopiumRobot`` diffractometer geometry.
* Add ``SoleilSixsMed2p3v2`` diffractometer geometry.
* Export and reload diffractometer configuration as JSON string, YAML string, or Python dictionary.

Fixes
-----

Expand All @@ -29,6 +39,12 @@ Fixes
Maintenance
-----------

* Add pre-commit checks.
* Add ``apischema`` to package requirements.
* Add test for ``or_swap()``.
* Expand testing to to Py3.8 - Py3.11.
* Fix code in ``util.restore_reflections()`` that failed unit tests locally.
* Make it easier to find the SPEC command cross-reference table.
* Update packaging to latest PyPA recommendations.

v1.0.4 (released 2023-10-06)
Expand Down
200 changes: 200 additions & 0 deletions docs/source/_static/e4c-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"geometry": "E4CV",
"engine": "hkl",
"library": "gi.repository.Hkl",
"mode": "bissector",
"canonical_axes": [
"omega",
"chi",
"phi",
"tth"
],
"real_axes": [
"omega",
"chi",
"phi",
"tth"
],
"reciprocal_axes": [
"h",
"k",
"l"
],
"constraints": {
"omega": {
"low_limit": -180.0,
"high_limit": 180.0,
"value": 0.0,
"fit": true
},
"chi": {
"low_limit": -180.0,
"high_limit": 180.0,
"value": 0.0,
"fit": true
},
"phi": {
"low_limit": -180.0,
"high_limit": 180.0,
"value": 0.0,
"fit": true
},
"tth": {
"low_limit": -180.0,
"high_limit": 180.0,
"value": 0.0,
"fit": true
}
},
"samples": {
"main": {
"name": "main",
"lattice": {
"a": 1.54,
"b": 1.54,
"c": 1.54,
"alpha": 90.0,
"beta": 90.0,
"gamma": 90.0
},
"reflections": [],
"UB": [
[
4.079990459207523,
-2.4982736282101165e-16,
-2.4982736282101165e-16
],
[
0.0,
4.079990459207523,
-2.4982736282101165e-16
],
[
0.0,
0.0,
4.079990459207523
]
],
"U": [
[
1.0,
0.0,
0.0
],
[
0.0,
1.0,
0.0
],
[
0.0,
0.0,
1.0
]
]
},
"vibranium": {
"name": "vibranium",
"lattice": {
"a": 6.283185307179586,
"b": 6.283185307179586,
"c": 6.283185307179586,
"alpha": 90.0,
"beta": 90.0,
"gamma": 90.0
},
"reflections": [
{
"reflection": {
"h": 4.0,
"k": 0.0,
"l": 0.0
},
"position": {
"omega": -145.451,
"chi": 0.0,
"phi": 0.0,
"tth": 69.0966
},
"wavelength": 1.54,
"orientation_reflection": false,
"flag": 1
},
{
"reflection": {
"h": 0.0,
"k": 4.0,
"l": 0.0
},
"position": {
"omega": -145.451,
"chi": 0.0,
"phi": 90.0,
"tth": 69.0966
},
"wavelength": 1.54,
"orientation_reflection": true,
"flag": 1
},
{
"reflection": {
"h": 0.0,
"k": 0.0,
"l": 4.0
},
"position": {
"omega": -145.451,
"chi": 90.0,
"phi": 0.0,
"tth": 69.0966
},
"wavelength": 1.54,
"orientation_reflection": true,
"flag": 1
}
],
"UB": [
[
1.2217304763701863e-05,
-0.9999999999253688,
-1.7623547209572502e-15
],
[
-1.4926257043558267e-10,
-1.4349296274686127e-42,
-1.0000000000000002
],
[
0.9999999999253688,
1.221730476364063e-05,
-1.492626316575311e-10
]
],
"U": [
[
1.2217304763701863e-05,
-0.9999999999253688,
-1.8235863128158895e-15
],
[
-1.4926257043558267e-10,
-9.139696455822134e-27,
-1.0000000000000002
],
[
0.9999999999253688,
1.2217304763701863e-05,
-1.4926257042444305e-10
]
]
}
},
"name": "e4c",
"datetime": "2023-11-01 16:11:39.049412",
"wavelength_angstrom": 1.54,
"energy_keV": 8.050921974025975,
"hklpy_version": "1.0.5.dev122+g473f61f",
"library_version": "v5.0.0.3001",
"python_class": "SimulatedE4CV",
"other": {}
}
144 changes: 144 additions & 0 deletions docs/source/_static/e4c-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
geometry: E4CV
engine: hkl
library: gi.repository.Hkl
mode: bissector
canonical_axes:
- omega
- chi
- phi
- tth
real_axes:
- omega
- chi
- phi
- tth
reciprocal_axes:
- h
- k
- l
constraints:
omega:
low_limit: -180.0
high_limit: 180.0
value: 0.0
fit: true
chi:
low_limit: -180.0
high_limit: 180.0
value: 0.0
fit: true
phi:
low_limit: -180.0
high_limit: 180.0
value: 0.0
fit: true
tth:
low_limit: -180.0
high_limit: 180.0
value: 0.0
fit: true
samples:
main:
name: main
lattice:
a: 1.54
b: 1.54
c: 1.54
alpha: 90.0
beta: 90.0
gamma: 90.0
reflections: []
UB:
- - 4.079990459207523
- -2.4982736282101165e-16
- -2.4982736282101165e-16
- - 0.0
- 4.079990459207523
- -2.4982736282101165e-16
- - 0.0
- 0.0
- 4.079990459207523
U:
- - 1.0
- 0.0
- 0.0
- - 0.0
- 1.0
- 0.0
- - 0.0
- 0.0
- 1.0
vibranium:
name: vibranium
lattice:
a: 6.283185307179586
b: 6.283185307179586
c: 6.283185307179586
alpha: 90.0
beta: 90.0
gamma: 90.0
reflections:
- reflection:
h: 4.0
k: 0.0
l: 0.0
position:
omega: -145.451
chi: 0.0
phi: 0.0
tth: 69.0966
wavelength: 1.54
orientation_reflection: false
flag: 1
- reflection:
h: 0.0
k: 4.0
l: 0.0
position:
omega: -145.451
chi: 0.0
phi: 90.0
tth: 69.0966
wavelength: 1.54
orientation_reflection: true
flag: 1
- reflection:
h: 0.0
k: 0.0
l: 4.0
position:
omega: -145.451
chi: 90.0
phi: 0.0
tth: 69.0966
wavelength: 1.54
orientation_reflection: true
flag: 1
UB:
- - 1.2217304763701863e-05
- -0.9999999999253688
- -1.7623547209572502e-15
- - -1.4926257043558267e-10
- -1.4349296274686127e-42
- -1.0000000000000002
- - 0.9999999999253688
- 1.221730476364063e-05
- -1.492626316575311e-10
U:
- - 1.2217304763701863e-05
- -0.9999999999253688
- -1.8235863128158895e-15
- - -1.4926257043558267e-10
- -9.139696455822134e-27
- -1.0000000000000002
- - 0.9999999999253688
- 1.2217304763701863e-05
- -1.4926257042444305e-10
name: e4c
datetime: '2023-11-01 16:13:24.744943'
wavelength_angstrom: 1.54
energy_keV: 8.050921974025975
hklpy_version: 1.0.5.dev122+g473f61f
library_version: v5.0.0.3001
python_class: SimulatedE4CV
other: {}
1 change: 1 addition & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ API Reference
:glob:

calc
configuration
context
diffract
engine
Expand Down
Loading

0 comments on commit e7abba8

Please sign in to comment.