-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is diffractometer configuration saved by NXWriter? #985
Comments
Answer: The diffractometer configuration is not saved by the NXWriter at this time. While the information is present in the descriptor document when the diffractometer is added to the detector list, the NXWriter does not look for it in that location. |
Example: 'sixc': {'data': {'sixc_U': array([[-1.22173048e-05, -1.22173048e-05, -1.00000000e+00],
[ 0.00000000e+00, -1.00000000e+00, 1.22173048e-05],
[-1.00000000e+00, 1.49262536e-10, 1.22173048e-05]]),
'sixc_UB': array([[-1.41342846e-05, -1.41342846e-05, -1.15690694e+00],
[ 0.00000000e+00, -1.15690694e+00, 1.41342846e-05],
[-1.15690694e+00, 1.72682934e-10, 1.41342846e-05]]),
'sixc__constraints': array([[-180. , 180. , 0. , 1. ],
[-180. , 180. , 20.32128858, 1. ],
[-180. , 180. , 24.09484255, 1. ],
[-180. , 180. , 0. , 1. ],
[-180. , 180. , 0. , 1. ],
[-180. , 180. , 40.64257716, 1. ]]),
'sixc__hklpy_version': '1.1.1',
'sixc__mode': 'bissector_vertical',
'sixc__pseudos': ('h', 'k', 'l'),
'sixc__reals': ('mu',
'omega',
'chi',
'phi',
'gamma',
'delta'),
'sixc_class_name': 'SimulatedE6C',
'sixc_diffractometer_name': 'sixc',
'sixc_energy': 8.050921974025975,
'sixc_energy_offset': 0,
'sixc_energy_units': 'keV',
'sixc_energy_update_calc_flag': True,
'sixc_geometry_name': 'E6C',
'sixc_lattice': array([ 5.43102051, 5.43102051, 5.43102051, 90. , 90. ,
90. ]),
'sixc_lattice_reciprocal': (1.156906937555034,
1.156906937555034,
1.156906937555034,
90.00000000000001,
90.00000000000001,
90.00000000000001),
'sixc_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'],
'sixc_reflections_details': [{'flag': 1,
'orientation_reflection': True,
'position': {'chi': 0.0,
'delta': 69.0966,
'gamma': 0.0,
'mu': 0.0,
'omega': -145.451,
'phi': 0.0},
'reflection': {'h': 4.0,
'k': 0.0,
'l': 0.0},
'wavelength': 1.5399999999999998},
{'flag': 1,
'orientation_reflection': True,
'position': {'chi': 90.0,
'delta': 69.0966,
'gamma': 0.0,
'mu': 0.0,
'omega': -145.451,
'phi': 0.0},
'reflection': {'h': 0.0,
'k': 4.0,
'l': 0.0},
'wavelength': 1.5399999999999998}],
'sixc_sample_name': 'silicon',
'sixc_ux': -45.0,
'sixc_uy': -89.99901005102187,
'sixc_uz': 135.00000000427607}, |
This function accepts any document published by def get_hklpy_configurations(doc: dict) -> dict:
"""Diffractometer details (from hklpy) in RE descriptor documents."""
configurations = {} # zero, one, or more diffractometers are possible
for k in doc.get("configuration", {}):
record = doc["configuration"][k].get("data", {})
attrs = record.get(f"{k}_orientation_attrs", [])
if len(attrs) == 0: # no orientation information?
continue
configurations[k] = {a: record[f"{k}_{a}"] for a in attrs}
return configurations A good addition for: apstools/apstools/callbacks/callback_base.py Line 243 in 311d065
|
When using a diffractometer and hklpy, is the diffractometer orientation (UB matrix, reflections, sample lattice, ...) saved in the NeXus file?
The text was updated successfully, but these errors were encountered: