Closed SchrodingersCattt closed 1 month ago
Thanks very much for your interest in Dans_Diffraction :)
I'm afraid the rotation function is a little hidden in this context, but what xtl.Cell.orientation.rotate_6circle(mu=tth/2)
is doing is rotating the crystal with respect to the lab frame, where the detector is defined. This appears in the detector_image
function in the line:
qxqyqz = self.xtl.Cell.calculateQ(hkl)
Which calculates the reflection positions in the lab frame, because the unit cell of the crystal is rotated in the lab frame: https://github.com/DanPorter/Dans_Diffraction/blob/4665a159bc8704f3a027ca5c861b5336fb48d07e/Dans_Diffraction/classes_crystal.py#L639-L650
This uses Cell.UVstar()
- the reciprocal unit cell, defined by the unit cell in cell.UV()
which shows that the unit cell is rotated by 'Cell.orientation':
https://github.com/DanPorter/Dans_Diffraction/blob/4665a159bc8704f3a027ca5c861b5336fb48d07e/Dans_Diffraction/classes_crystal.py#L588-L593
I hope this clears thing up for you, but if not or if you have any other questions please ask!
I'll close this issue in a few days otherwise (or feel free to close yourself).
Thank you very much for the reply. It helps a lot!
Hi, Dan,
I hope this message finds you well.
I am currently studying diffraction simulation using your code and have encountered a few questions.
In the example
example_detector_image.py
, you passmu
as follows:Upon examining the function
rotate_6circle
, I noticed that it only affects therotation
attribute instead of thelabframe
. However, in thedetector_image
function, it appears that therotation
attribute does not influence the result. Instead, thelabframe
seems to affect theposition_mm
and ultimately the generated image.Could you please help me understand this discrepancy?
Thank you very much for your assistance.
Best regards!