-
Notifications
You must be signed in to change notification settings - Fork 36
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
rBasex, a better pBasex #270
Conversation
Allowing selective cache cleanup.
Added "orders" list to Distributions.Results.
Corrected format strings.
Addendum: some small changes to the |
This is neat! I will examine the method for some VMI images that have an ion-beam (MCP depleted gain) hole. |
This is super rad! I will proofread the code more when time allows. For now, I'm going to close and re-open this PR to see if I can trigger the readthedocs check. EDIT: Cool, closing and re-opening seems to have the desired effect. Readthedocs build in progress... |
@DanHickstein, great! Now the docs are available.
Proofread the documentation, please! :–) Grammar, awkward wording and if something isn't clear... In the meantime I'll think about adding more unit tests (basis, caching, image shape and that higher orders work correctly). |
This looks awesome Mikhail! Sorry to take so long to review it. I should have some time over the next few days. |
The comparison with the other methods looks nice! https://gist.github.com/DanHickstein/5874a3bee2dc0eb37cc724049937fcc4 |
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.
I made it part-way through a review. Will return tomorrow :)
Wow. I am more and more impressed with this work. I was going to ask if you were going to write a paper about it, but it looks like you've already written one! :) https://pyabel--270.org.readthedocs.build/en/270/transform_methods/rbasex-math.html#rbasexmath |
Thanks, Dan! I'll wait for you to finish your review (please also make any corrections to the text!) and for Steve's review (@stggh, it's sad that you've got a flu, but hopefully it is less dangerous than this new coronavirus. Get well soon!), and then I'm going to make the edits.
Well, this was a practice for a real one, which I hope to publish eventually (about the original method and this faster version). When I get time to work on it... |
Amazing and very impressive work @MikhailRyazanov! The only issue that has appeared in my analysis is a factor of π between the radial intensity yielded by im = np.loadtxt('O2-ANU1024.txt.bz2')
imc = abel.tools.center.center_image(im, method='slice')
rbasex = abel.Transform(imc, method='rbasex', angular_integration=True)
rb, rp, rp1 = rbasex.distr.rIbeta()
radial, pes = rbasex.angular_integration Here is the O2- PES, that includes the factor 1/π for the The same π scaling factor applies for other species, e.g. C2H-: |
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.
rbasex
sets a new standard for velocity-mapped image analysis. Thanks @MikhailRyazanov for your mammoth effort in implementing, and perfecting this method for PyAbel
.
@stggh, we did discuss the π factor in #257. Basically, Can you please do C2H− with |
Oh, that is right, thanks for the reminder.
Yes, this works very well.
Note in this example I will send you the (unpublished) VMI image data via Cloudstor, in case you want to play without the delay of waiting for me to run your nice |
Thanks for sending the data! Now I see that the negative dip at small radii is due to a dark spot near the image center: In any case, it is interesting to see (more obviously in your plots) how the positivity constraints clean up the 300–360 region, such that the peak near 320 becomes apparent. Do you know whether it is real? |
Excellent! Thanks for taking a look at the data. The centre line is due to the two CMOS sensors of the camera. The MCP gain depletion results from the ion-beam, in our coaxial spectrometer, which is present during set-up, but switched out, when collecting photoelectrons, although, the gain depletion remains. You make some good observations, thanks to the (r)basex regularization analysis. Off-hand I cannot easily say anything about the possibility of a transition near 320 radius. There are many transitions in this region, and it is heavily perturbed. However, I will take a look, in relation to the assignments that have been made. It may take a little time. |
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.
Here are a few more comments. I'll continue to work on this when I get a chance tomorrow. still looking awesome!
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.
I made some suggestions for the rBasex documentation. Otherwise, this looks awesome!
Thanks, @DanHickstein! I have made some changes and asked about less trivial ones, please take a look. |
Okay, I went through and replied to your questions and comments. Please let me know if I missed any. It looks like there are still some changes that you still need to make. |
…method. Documentation improvements.
@DanHickstein, I have more or less implemented your suggestions: restructured “How to use it” to start from Most importantly, I have added a check to If everything looks fine, maybe let's merge this? The few remaining issues, like restructuring the documentation, can be addressed later (I'm planning to do some other additions to the method anyway). |
@MikhailRyazanov, I had a look at the most recent changes that you've made and they look great! I think that having Transform raise an error is the right way to go. The error messages are descriptive and should be quite helpful for users. I think that you can go ahead and merge. Thank you for this fantastic addition! |
Thanks! |
Great work! |
Here is a new method for analyzing velocity-mapping images, similar to pBasex, but implemented more efficiently.
The main idea is that the Abel transform of f(r) cosn θ is Fn(r) cosn θ, with some other radial part Fn (different for different powers n) but the same angular dependence. And if a suitable basis is chosen for the radial part, the forward transforms f(r) → Fn(r) can be computed analytically for all n. The rest is as usual in all “BASEX”-type methods.
That is, to perform a forward or inverse Abel transform of an image, it is sufficient to extract from it the radial profiles of all cosn θ terms, transform these radial profiles (which is much faster that transforming the whole image) and, if needed, construct the transformed image from the transformed profiles. The transformed radial profiles also directly give various radial distributions needed in VMI studies, thus if the transformed image itself is not needed, the last step can be skipped, making the analysis even faster.
An example of speed comparison with
two_point
, the fastest of current methods:(here
rbasex(None)
means that the output image is not constructed)And, for completeness, the time that must be added to the
two_point
transform to extract radial distributions from the image:So when only the radial distributions are needed, the rBasex transform is almost free. Otherwise, when the transformed image is also constructed,
rbasex
is competitive withtwo_point
(and other fast methods) at 1 megapixel (the typical image size) and wins at larger image sizes. The best thing is that the time complexity scales only quadratically with the image radius, in contrast to the cubic scaling in all other methods (except maybe Hansen–Law).Now let's see how the documentation will be built for this PR...
(More testing, proofreading and fact-checking about pBasex are still neded.)