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

HLA-1161: MagErrAp2 and other magnitude errors in HAP catalogs have incorrect negative values #1700

Merged

Conversation

s-goldman
Copy link
Collaborator

@s-goldman s-goldman commented Nov 14, 2023

Resolves HLA-1161

This PR addresses an issue (#1704) where (1) magnitude errors are being calculated as negative numbers, and (2) these are used for threshold calculations resulting in bad sources with good flags.

With this code we switch to calculating the good_snr threshold based on the flux error (which is always positive). We also fix the negative magnitude error issue by setting the magnitude error to infinity is the flux (and consequently the magnitude) is less than zero.

I had to change the number of expected sources for one of the regression tests because it no longer recognizes two sources with magnitudes and fluxes = -9999.

I also added dates to our new Architecture Decision Record (ADR) document.

Checklist for maintainers

  • added entry in CHANGELOG.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

Jenkins Test (Dev build failing for Numpy 2.0 issue)

@s-goldman s-goldman added bug Do Not Merge PR which should not be merged jirahub-ignore Avoid linking to Jira labels Nov 14, 2023
@s-goldman s-goldman requested review from mdlpstsci and a team as code owners November 14, 2023 16:42
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (71b66d8) 33.78% compared to head (f534432) 33.78%.

❗ Current head f534432 differs from pull request most recent head f91ab9c. Consider uploading reports for the commit f91ab9c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1700      +/-   ##
==========================================
- Coverage   33.78%   33.78%   -0.01%     
==========================================
  Files         126      126              
  Lines       31169    31172       +3     
  Branches     5715     5715              
==========================================
+ Hits        10530    10531       +1     
- Misses      19450    19451       +1     
- Partials     1189     1190       +1     

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

@s-goldman s-goldman removed the jirahub-ignore Avoid linking to Jira label Nov 27, 2023
@s-goldman
Copy link
Collaborator Author

Had to change the number of expected sources in the point source catalog for test_svm_segment_total_cat() in test_svm_ibqk07.py. Currently investigating whether that is linked to these changes.

@s-goldman s-goldman removed the Do Not Merge PR which should not be merged label Nov 30, 2023
@s-goldman s-goldman requested a review from mcara November 30, 2023 19:34
@s-goldman s-goldman changed the title [WIP] HLA-1161: MagErrAp2 and other magnitude errors in HAP catalogs have incorrect negative values HLA-1161: MagErrAp2 and other magnitude errors in HAP catalogs have incorrect negative values Nov 30, 2023
@s-goldman s-goldman requested a review from nden December 4, 2023 16:38
nden
nden previously approved these changes Dec 6, 2023
Copy link
Collaborator

@nden nden left a comment

Choose a reason for hiding this comment

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

I left a couple minor comments inline. I'm not familiar with the code but reading the discussion in the ticket, the changes here address that so I'm approving the PR.

CHANGELOG.rst Outdated Show resolved Hide resolved
drizzlepac/haputils/hla_flag_filter.py Outdated Show resolved Hide resolved
@s-goldman s-goldman requested a review from nden December 6, 2023 21:40
@s-goldman s-goldman merged commit 5cbec8d into spacetelescope:master Dec 7, 2023
13 of 14 checks passed
@s-goldman s-goldman deleted the HLA-1161_negative_magnitude_errors branch December 7, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MagErrAp2 and other magnitude errors in HAP catalogs have incorrect negative values
2 participants