-
Notifications
You must be signed in to change notification settings - Fork 62
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
Shift distorted PSFs back to correct detector position #229
Conversation
Tables show for different detector positions, the original offset between the center of the sci and new indices (the indices we interpolate from and to respectively). The 3rd column is the value we get from the average x/y new minus the average x/y sci value. And the last column is the new offset between the center of the sci and new indices if we subtract the value in the 3rd column from the new indices. And this is the result: These show the same NIRCam PSF at detector position (0,0) before and after this change |
This looks good. Can you briefly explain / summarize the changes in algorithm you made to implement this fix? |
We should also check with @Johannes-Sahlmann about what level of precision is appropriate here. The residuals in the table above are a few parts in 1000 of a pixel, which is indeed quite small and I expect is good enough for all current or near future purposes. Yes? Eventually I'm sure someone will be doing millipixel astrometry with JWST but not soon... |
So I decided on a better/more logical way to fix this issue. Basically what happens is when the sci indices are run through the idl_to_sci transformation, the output indices are no longer exactly centered on the initially set PSF location. So what this fix does is move the sci indices back to the initial PSF location after they’ve been run through the pysiaf transformation. And I do this with the lines:
So now the center point of the sci indices matches the center point of the new indices, and you get the results below (this is for the (0,0) case): |
That makes sense. Minor question, would it make any practical difference to use mean instead of median? It seems to me that the intent of this is something along the lines of
(i.e. force the center pixel value to be the same between xsci and xpix). In practice the median value is probably very close to the mean, and to the value at the exact center of the array, so probably I'm over-thinking this. The Travis build appears to be failing because it's trying to run test cases on Python 2.7 still. If you git merge master back into your branch, or rebase on current master , then you ought to be able to get the updated .travis.yml file so that it only tries running the tests on Python 3. |
Yes, Also - my .travis.yml file is the same as the version in the spacetelescope master. Is it possible that that change is only in mperrin/webbpsf? |
Pull Request Test Coverage Report for Build 23
💛 - Coveralls |
So I wanted to check back in with this - should I use the mean to find the center location of the PSF in this case? |
As discussed in email and in person - the current implementation with median is accurate to about 0.01-0.02 pixels. That’s good enough for almost all purposes. So we’re going to go ahead and merge this now, and if more carefully handling of the centering becomes necessary in the future we’ll fix it up more precisely then. |
When distorting a PSF, now the indices we interpolate from and on to have (approximately) the same center point. This fixes issue raised in #226