Skip to content
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

Add nrc_ta_image_comparison function to trending tools #789

Merged
merged 4 commits into from
Jan 22, 2024

Conversation

mperrin
Copy link
Collaborator

@mperrin mperrin commented Jan 20, 2024

This adds a function nrc_ta_image_comparison which retrieves the TA image for a given visit, generates a matching simulation, and displays their difference. Useful as a check for binary.

For example, in particular 4502:126...

Screenshot 2024-01-20 at 1 21 46 PM

@mperrin mperrin added the enhancement New feature or request label Jan 20, 2024
@mperrin mperrin requested a review from obi-wan76 January 20, 2024 18:23
@mperrin mperrin self-assigned this Jan 20, 2024
Copy link

codecov bot commented Jan 20, 2024

Codecov Report

Attention: 58 lines in your changes are missing coverage. Please review.

Comparison is base (55381cd) 54.78% compared to head (457bdf1) 54.34%.

Files Patch % Lines
webbpsf/trending.py 4.25% 45 Missing ⚠️
webbpsf/mast_wss.py 18.75% 13 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #789      +/-   ##
===========================================
- Coverage    54.78%   54.34%   -0.45%     
===========================================
  Files           16       16              
  Lines         6558     6621      +63     
===========================================
+ Hits          3593     3598       +5     
- Misses        2965     3023      +58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@obi-wan76 obi-wan76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good and it works as expected. I have a similar "residual" function that uses make_residual_image from PSFPhotometry in photutils.psf. I wonder if there is a way to quantify the residual image beside the visual inspection (stdev?)

@mperrin
Copy link
Collaborator Author

mperrin commented Jan 22, 2024

To quantify, a straightforward step would be to compute Chi^2, using the pipeline ERR extension estimate of the uncertainties.

@mperrin
Copy link
Collaborator Author

mperrin commented Jan 22, 2024

Yeah that was pretty easy to add. Now it looks like this. Note annotation text in rightmost panel:

Unknown-7
Unknown-8

Copy link
Collaborator

@obi-wan76 obi-wan76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, nice addition. Thanks!

@mperrin mperrin marked this pull request as ready for review January 22, 2024 23:12
@mperrin mperrin merged commit a6274e9 into spacetelescope:develop Jan 22, 2024
7 of 9 checks passed
@Skyhawk172
Copy link
Collaborator

Skyhawk172 commented Jan 30, 2024

I ran this function on all of WFS&C observations and found that, sometimes, the chi^2 does not catch all binaries, if that's its main purpose. I'm looking into other options.

Screenshot 2024-01-30 at 12 14 11 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants