8000 JP-3551: Exclude overlapping background candidates by melanieclarke · Pull Request #8744 · spacetelescope/jwst · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JP-3551: Exclude overlapping background candidates #8744

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

Merged
merged 12 commits into from
Sep 17, 2024

Conversation

melanieclarke
Copy link
Collaborator
@melanieclarke melanieclarke commented Aug 30, 2024

Resolves JP-3551

Closes #8301

Update association files for S1600A1 with 5-point dithers to exclude the background candidate in the nearest dithers to the science.

Matching is done by primary dither position (computed from PATT_NUM and SUBPXPTS) since that is the information currently available in the pool. Background candidates with primary position <= 1 away from the science position are excluded from the pool. For example, if science is position 1, background at position 2 is excluded. If science is at position 3, backgrounds at position 2 and 4 are excluded. This depends on the 5-point dither retaining a fixed sequence of dither position order.

In this PR, I also moved the make_nod_asns function from the base class to the AsnMixin_Lv2Nod mix-in class, since it is only called in that case.

Checklist for PR authors (skip items if you don't have permissions or they are not applicable)

  • added entry in CHANGES.rst within the relevant release section
  • updated or added relevant tests
  • updated relevant documentation
  • added relevant milestone
  • added relevant label(s)
  • ran regression tests, post a link to the Jenkins job below.
    How to run regression tests on a PR
  • All comments are resolved
  • Make sure the JIRA ticket is resolved prope 8000 rly

Copy link
codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 91.54930% with 6 lines in your changes missing coverage. Please review.

Project coverage is 61.76%. Comparing base (bc0abc2) to head (c6312af).

Files with missing lines Patch % Lines
jwst/associations/lib/rules_level2_base.py 91.54% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8744      +/-   ##
==========================================
+ Coverage   60.75%   61.76%   +1.01%     
==========================================
  Files         375      377       +2     
  Lines       38367    38743     +376     
==========================================
+ Hits        23308    23929     +621     
+ Misses      15059    14814     -245     

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

Copy link
Contributor
@hayescr hayescr left a comment

Choose a reason for hiding this comment

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

8000

I left a couple comments about how sub-pixel dithered data might be handled. I don't think there is any good data examples to test it on for the S1600A1 5-point nodded data, but I see that some examples were added on the issue/ticket that give a general sense of the dither pattern behavior for sub-pixel dithers. Let me know if any other examples would help.

@melanieclarke
Copy link
Collaborator Author

@hayescr - I think I have the logic right for subpixel dithers now. I consolidated the S1600A1 overlap check with the existing check on primary dither position, so it's all in the same place now, and added some unit tests specifically for this condition. Let me know if you think this is sufficient now.

@melanieclarke
Copy link
Collaborator Author

@melanieclarke melanieclarke marked this pull request as ready for review September 6, 2024 15:41
@melanieclarke melanieclarke requested a review from a team as a code owner September 6, 2024 15:41
@hayescr
Copy link
Contributor
hayescr commented Sep 6, 2024

@melanieclarke the changes look good to me!

@melanieclarke
Copy link
Collaborator Author

Report generation failed for the regression tests, but looking at the detailed output, I think this is the only real failure:
test_against_standard[jw01678_20240721t195707_pool]

This is the pool file I added to test these changes: the new association files for 5 point dithers with S1600A1 are subsets of the previous ones.

Copy link
Contributor
@penaguerrero penaguerrero left a comment

Choose a reason for hiding this comment

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

Other than that minor change to catch and avoid the None values, the code looks good to me!

Copy link
Contributor
@penaguerrero penaguerrero left a comment

Choose a reason for hiding this comment

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

You are right, I don't believe we will encounter the situation with a None in a subtraction. LGTM!

@melanieclarke
Copy link
Collaborator Author

Started regression tests on Jenkins here:
https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1716/

@stscieisenhamer stscieisenhamer self-requested a review September 17, 2024 01:12
@tapastro tapastro merged commit 5b49c08 into spacetelescope:master Sep 17, 2024
23 checks passed
@melanieclarke melanieclarke deleted the jp-3551 branch September 17, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Background subtraction of 5 point nods in S1600A1 subtracts too much source flux
5 participants
0