-
Notifications
You must be signed in to change notification settings - Fork 5
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
PSF Subtraction Step Function #280
Conversation
Hi Ell, I frequently have a negative sign uncertainty on the roll angles. I think it's ok if, for OS11, we need to apply a negative sign to get the roll angles right. Hopefully we can get this right after we figure out the ROLL keywords in real CGI headers, but for now, I think having to apply a negative sign for OS11 is fine. |
Thanks @semaphoreP ! |
Can you clarify the statement "fits headers default to storing the PC version"? How are the fits headers being created?
Pyklip can internally make wcs headers from roll angles and centers using the wcsgen module it has, in case that's useful.
…________________________________
From: Ell Bogat ***@***.***>
Sent: Friday, January 31, 2025 10:48 AM
To: roman-corgi/corgidrp ***@***.***>
Cc: Jason Wang ***@***.***>; Mention ***@***.***>
Subject: Re: [roman-corgi/corgidrp] PSF Subtraction Step Function (PR #280)
Thanks @semaphoreP<https://urldefense.com/v3/__https://github.com/semaphoreP__;!!Dq0X2DkFhyF93HkjWTBQKhk!Wgj0KvmVAgbRCM4nmi31-Kct5FbAprhkAjlqpDX73mSSU8iecnPZKn-m3n69R8GFVbG9RgB7gc9wiGoJ66KfYHzRN6_2stgU$> !
The main issue I'm running into now is in the WCS info. My current understanding is there are two ways to store the coordinate transformation, either using a CD-matrix or a PC-matrix + a CDELT matrix (still figuring out exactly what those are). And the fits headers default to storing the PC version, while pyKLIP expects the CD version. For some reason it was working anyway before I updated to the same software versions that the github testing environment uses, but now I'm getting a "no cd present" angry message from pyKLIP causing the tests to fail. Also if I just overwrite the WCS header to None so that pyKLIP ignores it, we don't get the correct psf subtraction result anymore. Is there a simple way to convert from PC to CD? Do we need to tackle generating the correct WCS header info first?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/roman-corgi/corgidrp/pull/280*issuecomment-2627791200__;Iw!!Dq0X2DkFhyF93HkjWTBQKhk!Wgj0KvmVAgbRCM4nmi31-Kct5FbAprhkAjlqpDX73mSSU8iecnPZKn-m3n69R8GFVbG9RgB7gc9wiGoJ66KfYHzRN1yDgTNH$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAREI3DKAIMMVUIQPGD5H4D2NOSOTAVCNFSM6AAAAABUV6NUBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRXG44TCMRQGA__;!!Dq0X2DkFhyF93HkjWTBQKhk!Wgj0KvmVAgbRCM4nmi31-Kct5FbAprhkAjlqpDX73mSSU8iecnPZKn-m3n69R8GFVbG9RgB7gc9wiGoJ66KfYHzRNx9Yw4EB$>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Basically any time you use the method to convert a WCS object to a fits header, it is saved using the PC formalism.
If I then call the wcs.to_header() function to store it in the extension header it produces this:
|
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.
Hi all,
This is looking overall nice to me. Please see the comments attached here and let me know if anything is unclear or if you want to discuss any of them further. Always happy to iterate.
Cheers,
Max
Ready for re-review! Right now here are the tasks that I think should be follow-up issues:
|
Describe your changes
Results using OS11 simulations:



Testing using gaussian stellar & planetary PSFs:



Note: I'm only comparing to the "analytical" result outside of the IWA, as there is increased deviation as you approach the mask center. Also, there is offset between the corgidrp and analytical result equal to the median of the corgidrp output, so if you subtract the median (on the order of -1e-4) then they match much more precisely (order 1e-6 or less).
Output header keywords:
Still to do:
Future PRs:
Type of change
Reference any relevant issues (don't forget the #)
Issue #8 : Produce Calibrated PSF Subtracted Images with pyKLIP
Checklist before requesting a review