-
Notifications
You must be signed in to change notification settings - Fork 12
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
wavelength units should be angstrom #23
Conversation
Note that @ambarb discussed this change previously as part of a different PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'd like to ask @ambarb to look at it as you are more closely dealing with this object.
The test failures are worrying. Were they passing before? |
I don't know. Need to look at them. |
The failures relate to tardis calculations of the forward solutions ((hkl) to motor positions). Might be affected by this code. Will apply tests on master branch to see if they are duplicate. https://travis-ci.org/github/bluesky/hklpy/builds/723607153#L1494-L1506 |
@mrakitin - I can't test this code since I do not have the example IOCs running. The error message offers some incorrect (assumed correct when it was written long ago) advice.
This search may help to locate the current way to run: https://github.com/search?q=org%3Abluesky+examples%2Fiocs&type=code Another point may be in how travis runs the test. Next place to look... |
Need to Switching to
|
Conclusion: I'll resolve those test errors in this PR. |
It should not be necessary to have EPICS PVs to test this code. It is possible to test this code with the |
Confirmed that:
Easiest thing to do now is to set the test energy to 9.31 keV (even though that energy might be unrealistic for the NSLS-II tardis diffractometer but this code tests the calculation, not the NSLS-II instrument). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, have a couple of clarifications in the comments.
I've used the bluesky simulator motors and had it working at CSX, but I didn't commit and someone deleted the file. It worked great as a replacement for spec onsim |
@prjemian, I saw your lesson on hkl in https://github.com/BCDA-APS/use_bluesky/blob/master/lessons/lesson7.ipynb, it looks great! |
I don't see anything of concern. We should start working together though so we don't have competing higher level functions to interact with HKL. Some of the things in your lesson are very nice ( print formatting and simplify setting the calculation limits), but those are higher level functions. |
I also would say that a nice part of python that you may show off is something like, which is equivalent to some of the things I picked up from spec power users: myhkl = tardis.position
myhkl_motors = tardis.real_positions` #or whatever is the actual attribute name which is nice, because then you can move the diffractometer around and later return tardis.forward(myhkl)
tardis.move(myhkl) Or use it for simulating plans prior to running them without having to edit the plans - you cannot accurately simulate relative scans using print_summary, but you can fake it with absolute scans. hh, kk, ll = myhkl
print_summary(scan([fccd, tardis], tardis.h, hh-.05, hh+.05, 21)) which in the end, is may be the way you want to write your plan so you are not needlessly thrashing around the motors to "return" to the starting point. |
Missed that detail. Thanks!
…On Fri, Sep 25, 2020, 5:47 PM Maksim Rakitin ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In hkl/calc.py
<#23 (comment)>:
> @@ -13,7 +13,9 @@
logger = logging.getLogger(__name__)
+A_KEV = 12.39842 # 12.2984244 # angstrom * keV
My point was that 12.2984244 was a wrong number, should be 12.*3*984244
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARMUMF3VA37P2CXDP3YQ23SHUMY7ANCNFSM4QT3Y2KA>
.
|
fixes #17
The wavelength units must match the same units used by the lattice parameters. When X-ray energy is specified, the computed wavelength must be in angstrom.