-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update C code to reproduce Drizzlepac results #136
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #136 +/- ##
=======================================
Coverage 75.29% 75.29%
=======================================
Files 7 7
Lines 344 344
=======================================
Hits 259 259
Misses 85 85 ☔ View full report in Codecov by Sentry. |
That's strange... First, no unit tests are failing which indicates that we need unit tests to catch this bug. Second, do these changes affect only |
fa88270
to
69a8ab8
Compare
My original testing running this modified code to create output images and comparing those drizzled images to ones created by drizzlepac using the same parameters (kernel, pixfrac, stepsize,...) showed that this code was able to reproduce the drizzlepac results. The comparisons were originally done for all kernels with this modified code. However, it turns out that when using a subarray instead of a full image uncovered differences in the drizzle code even with these corrections for subarrays. The tests I have just added not only demonstrate that, but provide a way to verify whether any further investigations and corrections to the drizzle code result in closer agreement with drizzlepac. It turns out that part of the differences stem from what look to be 'edge effects'. This makes some sense given how VERY DIFFERENTLY drizzle computes the bounding box for the inputs and outputs from the more empirical, on-the-fly checks that are done in drizzlepac. So, although these code changes may not fix everything as originally reported, hopefully these new tests will make it easy to track down the remaining differences in results. |
e63a245
to
a2079cc
Compare
My original question stemmed from discussions offline about discrepancies between Even so, I still wonder whether this "subarray-specific" bug that you are fixing here affects the square and the lanczos kernel??? For example, you are fixing the turbo kernel but not the square kernel which is closely related to the square kernel (the turbo). Are square and lanczos kernels not affected by this bug?
I fail to see how 0.5 or 1 pixel shifts in subarrays can be related to edge effects. Even if edge effects exist, they should be limited to being near edges and not affect the middle of the image (away from borders) and thus there should not be any shifts in the middle. |
Also, I cloned your branch and undid proposed code changes in the |
Given the difficulties in understanding the differences between drizzle and drizzlepac algorithms, I am withdrawing this PR at this time. Another PR will be needed later that more clearly identifies the cause of the differences and tracks changes in that code with more focused tests. |
These changes correct differences between the C code used in this package with the original C code from drizzlepac which serves as the reference implementation for this algorithm. It insures that, for subarrays in particular, the distortion model gets applied to the correct input pixels as opposed to being off by (usually) 1.