[PIPE2D-643] Precise alignment of PSFs to input science image Created: 13/Oct/20 Updated: 15/Oct/20 Resolved: 15/Oct/20 |
|
| Status: | Done |
| Project: | DRP 2-D Pipeline |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Story | Priority: | Normal |
| Reporter: | Brent Belland | Assignee: | ncaplar |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Story Points: | 6 | ||||||||
| Description |
|
Alignment of PSFs to sub pixel accuracy is necessary to extract FRD to the milliradian level. While the current version of LN_PFS_single is able to find centers of PSFs accurately, there are certain cases where alignment is not accurate enough to extract out FRD. On one hand, inputting a PSF as a science image into LN_PFS_single as an input and comparing the output results in a small change in centering. In some implementations, such as inputting a uniform initial science image to generate a mock PSF, the 2D-DRP recovers centroid to ~0.001 pixels (UniformInitial_PSFshift.png). However, for some science images such as with random initial science image input, the code's fit can be a factor of a few higher (in RandomInitial_PSFshift.png, by a factor of 10, though this is on the extreme side). Even shifts of this size can complicate extraction of FRD residuals. |
| Comments |
| Comment by price [ 13/Oct/20 ] |
|
Are you using the NevenPsf? What method are you using? How do you determine the position at which to realise the PSF? |
| Comment by Brent Belland [ 13/Oct/20 ] |
|
The current code used to generate the uniform illumination example is:
To my knowledge this isn't associated with NevenPsf. This is a test to see if LN_PFS_single can reconstruct a PSF that it's created. The position of the PSF is determined by the code in the create_complete_realization function and is the issue to be investigated.
|
| Comment by price [ 13/Oct/20 ] |
|
I was worried that an important part of the 2D pipeline wasn't working for you, but apparently not. Sorry to have bothered you! |
| Comment by Brent Belland [ 13/Oct/20 ] |
|
My apologies, that's my fault for not specifying the issue precisely. Thank you very much for checking. |
| Comment by ncaplar [ 13/Oct/20 ] |
|
I have uploaded the new version of the code (internal version 0.34b). I have added a small finishing step that optimizes with Nelder-Mead method (as discussed on technical DRP 2D telecon on October 12). The reason why I did not use it at the start is that one can not put bounds on that method, and sometimes the solution would escape and crash the code. I found it easier to use scipy.shgo that uses bounds. Once when we are very close to the actual solution we can use Nelder-Mead to finish up. |
| Comment by Brent Belland [ 14/Oct/20 ] |
|
Your fix gets the center to a very high degree of precision, orders of magnitude better than before! I've uploaded v034b_UniformInitial_PSFshift.png and v034b_RandomInitial_PSFshift.png that both show residuals on the order of 1e-6, which is consistent. This works perfectly for my case, and I believe you've completed this ticket. Is this code you see being used for the 2D_DRP or does the Nelder-Mead add too much runtime? |
| Comment by rhl [ 14/Oct/20 ] |
|
No, we probably won't be using this code. Regular, and fast, centroiding is good enough but we'll have to make sure that it's consistent with the definition of the centroid for Neven's models. For now, let's use this. |
| Comment by ncaplar [ 15/Oct/20 ] |
|
I have closed this ticket. Brent Belland continue with |