APS-4ID-POLAR / APS-4ID-POLAR/ipython-polar
Issues with hklpy
- Dominant language
- Python
- Stars
- 1
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
```python
In [21]: %run start_macro.py
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File /home/sector4/4idd/2022_2/Ir_Rodolfo/start_macro.py:22, in
19 undulator.downstream.tracking.put(True)
21 orientation = run_orientation_info(cat[63])["fourc"]
---> 22 restore_orientation(orientation, fourc)
23 fourc.engine.mode = "constant_phi"
File ~/.conda/envs/bluesky_2022_2/lib/python3.9/site-packages/hkl/util.py:444, in restore_orientation(orientation, diffractometer)
432 """
433 Restore all orientation information.
434
(...)
441 Diffractometer object.
442 """
443 _check_geometry(orientation, diffractometer)
--> 444 restore_energy(orientation, diffractometer)
445 restore_sample(orientation, diffractometer)
446 restore_constraints(orientation, diffractometer)
File ~/.conda/envs/bluesky_2022_2/lib/python3.9/site-packages/hkl/util.py:381, in restore_energy(orientation, diffractometer)
367 """
368 Restore energy from orientation information.
369
(...)
378 Diffractometer object.
379 """
380 for attr in "energy energy_units energy_offset".split():
--> 381 _smart_signal_update(orientation[attr], getattr(diffractometer, attr))
KeyError: 'energy'
In [23]: orientation
Out[23]:
{'energy_units': 'keV',
'energy_offset': 0,
'geometry_name': 'E4CV',
'class_name': 'FourCircleDiffractometer',
'sample_name': 'Na2IrO3',
'lattice': [5.427, 9.395, 5.614, 90.0, 109.04, 90.0],
'lattice_reciprocal': [1.2247698817691968,
0.6687797027333248,
1.1839733075100518,
90.00000000000001,
70.96,
90.00000000000001],
'U': [[0.39704160761964563, -0.11147619865712856, 0.9110054988592351],
[0.16370892526169198, -0.9680764729221553, -0.1898086677795866],
[0.9030821389045789, 0.22450166972108723, -0.36611699043335155]],
'UB': [[0.48628460282176517, -0.07455301899975553, 1.172952300853581],
[0.20050576103732476, -0.6474298957840046, -0.14920191582564885],
[1.1060678044940344, 0.1501421599392037, -0.06094654323699006]],
'reflections_details': [{'reflection': {'h': 0.0, 'k': 2.0, 'l': 0.0},
'flag': 1,
'wavelength': 1.1169734383241103,
'position': {'omega': 0.4593000000000131,
'chi': -76.94362000000001,
'phi': -5.684341886080802e-14,
'tth': 13.71943789610387},
'orientation_reflection': False},
{'reflection': {'h': 0.0, 'k': 2.0, 'l': 0.0},
'flag': 1,
'wavelength': 1.1169734383241103,
'position': {'omega': 0.4593000000000131,
'chi': -76.94362000000001,
'phi': -5.684341886080802e-14,
'tth': 13.71943789610387},
'orientation_reflection': True},
{'reflection': {'h': 2.0, 'k': 0.0, 'l': 0.0},
'flag': 1,
'wavelength': 1.1169734383241103,
'position': {'omega': -8.208399999999983,
'chi': -47.47651999999994,
'phi': -5.684341886080802e-14,
'tth': 25.09473789610388},
'orientation_reflection': False},
{'reflection': {'h': 1.0, 'k': 3.0, 'l': -1.0},
'flag': 1,
'wavelength': 1.1169734383241103,
'position': {'omega': -8.208399999999983,
'chi': -47.47651999999994,
'phi': -5.684341886080802e-14,
'tth': 25.09473789610388},
'orientation_reflection': False},
{'reflection': {'h': 1.0, 'k': -3.0, 'l': -1.0},
'flag': 1,
'wavelength': 1.1169734383241103,
'position': {'omega': -8.208399999999983,
'chi': -47.47651999999994,
'phi': -5.684341886080802e-14,
'tth': 25.09473789610388},
'orientation_reflection': False},
{'reflection': {'h': 1.0, 'k': 3.0, 'l': -1.0},
'flag': 1,
'wavelength': 1.1169734383241103,
'position': {'omega': -8.208399999999983,
'chi': -47.47651999999994,
'phi': -5.684341886080802e-14,
'tth': 25.09473789610388},
'orientation_reflection': True}],
'ux': 152.5960965960107,
'uy': 65.64467593378099,
'uz': 15.682991677770966,
'diffractometer_name': 'fourc',
'_hklpy_version': '1.0.1',
'_pseudos': ['h', 'k', 'l'],
'_reals': ['theta', 'chi', 'phi', 'tth'],
'_constraints': [[-180.0, 180.0, -3.5, 1.0],
[-180.0, 180.0, -54.57585999999992, 1.0],
[-180.0, 180.0, -5.684341886080802e-14, 1.0],
[-180.0, 180.0, 25.072637896103885, 1.0]],
'_mode': 'constant_phi',
'orientation_attrs': ['orientation_attrs',
'geometry_name',
'class_name',
'UB',
'U',
'ux',
'uy',
'uz',
'energy',
'energy_units',
'energy_offset',
'sample_name',
'lattice',
'lattice_reciprocal',
'reflections_details',
'_pseudos',
'_reals',
'_constraints',
'_mode',
'diffractometer_name',
'_hklpy_version'],
'theta_user_offset_dir': 0,
'chi_user_offset': -1175.63732,
'phi_acceleration': 0.25,
'tth_velocity': 0.5,
'x_velocity': 200.0,
'y_motor_egu': 'microns',
'z_velocity': 100.0,
'baseth_user_offset': -179.5502,
'basetth_velocity': 0.4,
'tablex_user_offset': 94.14855,
'tabley_user_offset_dir': 0,
'ath_acceleration': 0.25,
'achi_velocity': 4.0,
'atth_velocity': 4.0}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.