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

Implement outlier detection step. #981

Merged
merged 9 commits into from
Nov 20, 2023

Conversation

mairanteodoro
Copy link
Collaborator

@mairanteodoro mairanteodoro commented Nov 8, 2023

Resolves RCAL-501

This PR addresses the implementation of the outlier detection step for Roman (replaces PR#979).

The link to the regression test results is here.

Checklist

  • added entry in CHANGES.rst under the corresponding subsection
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)
  • ran regression tests, post a link to the Jenkins job below. How to run regression tests on a PR

@github-actions github-actions bot added stpipe dependencies Pull requests that update a dependency file labels Nov 8, 2023
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

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

Comparison is base (da2d16a) 73.32% compared to head (15f8520) 71.08%.

Files Patch % Lines
romancal/outlier_detection/outlier_detection.py 18.07% 136 Missing ⚠️
...mancal/outlier_detection/outlier_detection_step.py 13.04% 60 Missing ⚠️
romancal/datamodels/container.py 9.52% 38 Missing ⚠️
romancal/resample/resample.py 43.75% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #981      +/-   ##
==========================================
- Coverage   73.32%   71.08%   -2.25%     
==========================================
  Files         103      104       +1     
  Lines        6733     7006     +273     
==========================================
+ Hits         4937     4980      +43     
- Misses       1796     2026     +230     
Flag Coverage Δ *Carryforward flag
nightly 63.29% <ø> (ø) Carriedforward from 7640d00

*This pull request uses carry forward flags. Click here to find out more.

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

Copy link
Collaborator

@schlafly schlafly left a comment

Choose a reason for hiding this comment

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

Some minor comments. The most important one: help me with the provenance of the outlierpars reference file, and what the value of pars['resample_data'] is for our case?

romancal/resample/resample.py Outdated Show resolved Hide resolved
romancal/resample/resample.py Outdated Show resolved Hide resolved
romancal/resample/resample.py Outdated Show resolved Hide resolved
romancal/lib/dqflags.py Show resolved Hide resolved
romancal/outlier_detection/outlier_detection.py Outdated Show resolved Hide resolved
romancal/outlier_detection/outlier_detection_step.py Outdated Show resolved Hide resolved
@mairanteodoro mairanteodoro marked this pull request as ready for review November 9, 2023 14:27
@mairanteodoro mairanteodoro requested a review from a team as a code owner November 9, 2023 14:27
@mairanteodoro mairanteodoro changed the title Fixed issues. Implement outlier detection step. Nov 9, 2023
Copy link
Collaborator

@schlafly schlafly left a comment

Choose a reason for hiding this comment

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

These changes look good. The only outstanding comments are about the outlier_pars file and the value of the resample_data argument. I don't really know how that works or what the defaults are; can you explain what we're doing there? Thanks!

romancal/resample/resample.py Outdated Show resolved Hide resolved
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 did a superficial review and left inline comments. I still need to run the code and look at the output.

CHANGES.rst Outdated Show resolved Hide resolved
romancal/outlier_detection/outlier_detection.py Outdated Show resolved Hide resolved
romancal/outlier_detection/outlier_detection.py Outdated Show resolved Hide resolved
romancal/outlier_detection/outlier_detection.py Outdated Show resolved Hide resolved
romancal/outlier_detection/outlier_detection.py Outdated Show resolved Hide resolved
romancal/outlier_detection/outlier_detection_step.py Outdated Show resolved Hide resolved
romancal/outlier_detection/outlier_detection_step.py Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the dependencies Pull requests that update a dependency file label Nov 17, 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.

The step completes without crashing. I am not sure the results are entirely correct but I think we can merge this as is and debug when we have good data.
The test I ran uses as input 3 identical images (copies of the same file). It found quite a lot of outliers which I think is unexpected.

One thing that needs to change now is adding the OUTLIER DQ flag to this page:
https://github.com/spacetelescope/romancal/blob/main/docs/roman/references_general/dq_flags.inc

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 20, 2023
Copy link
Collaborator

@schlafly schlafly left a comment

Choose a reason for hiding this comment

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

I added the missing flag to the docs, merging.

@schlafly schlafly merged commit 2a234a3 into spacetelescope:main Nov 20, 2023
26 of 28 checks passed
@mairanteodoro
Copy link
Collaborator Author

Thanks @schlafly and @nden!

WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this pull request Nov 24, 2023
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this pull request Dec 22, 2023
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this pull request Feb 7, 2024
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this pull request Feb 9, 2024
WilliamJamieson added a commit to WilliamJamieson/roman_datamodels that referenced this pull request Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation outlier_detection stpipe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants