Replies: 3 comments
-
Hi, @tkt28nz! For sharing the code, you can use GitHub Gist and post links here. But I would recommend to first reduce your code to a minimal working example, and then it should comfortably fit here without problems (using standard formatting starting with From the first file, it looks like you use one method to do a forward transform and then another method to do an inverse transform of the result. This will, of course, accumulate the errors of both methods. If you want to test how a particular method performs a forward or an inverse transform, it would make more sense to take some analytically transformable function and then compare the method results with the analytical counterpart, like: # forward:
test = abel.tools.analytical.GaussianAnalytical(...)
transform = abel.direct.direct_transform(test.func, direction='forward')
# ^^^^
diff = transform - test.abel
# ^^^^
# inverse:
test = abel.tools.analytical.GaussianAnalytical(...)
transform = abel.direct.direct_transform(test.abel, direction='inverse')
# ^^^^
diff = transform - test.func
# ^^^^ For the second file, I don't understand what's going on there... :–( Maybe focusing one some single method would help to demonstrate that? |
Beta Was this translation helpful? Give feedback.
-
Hi Mikhail, thanks for getting back to me. Sorry, I am a little new to all this, will try and make things a little clearer! I had it coded so I could select any of the range of transform methods, but I can see how that makes things a bit cluttered, will simplify things down to one from now on. My aim here was to test out each of the inverse Abel transforms to determine which one gave the most accurate reconstruction. I was hoping to repeat the results of the paper mentioned above, but the results I was getting were quite different. But this is quite apparent as to why now, as I wasn't actually comparing the result to the analytical solution, rather was using the forward and inverse transform and hoping to get back to where I started, and getting errors from both the steps. I hadn't looked into the analytical module yet, but clearly this is what I need to be using for this experiment I am runnning here. Thanks for clearing this up for me, an easy fix it seems. Thanks! |
Beta Was this translation helpful? Give feedback.
-
OK, don't hesitate to ask more questions if they appear (we can keep this issue open as long as needed)! Regarding this:
It might be not necessarily true for every method. Some methods do the forward/inverse transform by applying correspondingly their transform matrix or its (matrix) inverse, so their “roundtrip” result indeed must match the original distribution within floating-point errors. Some methods don't implement the forward transform at all, so there is nothing to compare. But some methods use calculations that are not exactly inverses of each other. |
Beta Was this translation helpful? Give feedback.
-
I have been trying to replicate the results of Hickstein et al. "A direct comparison of high-speed methods for the numerical Abel transform" (2019), using a one-sided 1D Gaussian function to test the performance of each transform method in the PyAbel package. I use the forward Abel transform to generate the projection data, then the inverse Abel transform to reconstruct the original Gaussian distribution.
However I am finding reconstruction errors of up to 4% for the first few r values when I compare the reconstructed distribution back to the original distribution, for most of the transform methods. This difference appears to be much larger than indicated in the paper.
I did a quick comparison of my code to the code used in the paper (https://github.com/PyAbel/PyAbel/tree/master/doc/transform_methods/comparison, under the doc/transform_methods/comparison/fig_gaussian/gaussian.py section). The major difference I find is that using the forward Abel transform produces a different projection than to using: proj = ref.abel
Unfortunately I am relatively new to coding in python, so it is quite possible I am missing some of the subtleties of of python here. What is the difference between the two? I presume the forwards transform followed by the inverse transform should reproduce the original distribution, so am I making some fundamental errors in how I am using PyAbel here?
Any help to figure out what is going wrong here would be much appreciated. The code I used to test the PyAbel reconstruction accuracy, and the code I used to compare my results to the one in the paper are uploaded as .txt files below (couldn't get it to copy neatly into GitHub). Cheers!
TT_PyAbelRecon.txt
TTvPyAbelComp.txt
Beta Was this translation helpful? Give feedback.
All reactions