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

RAD-161: Bit Mask to Resample #401

Merged
merged 8 commits into from
Apr 4, 2024

Conversation

PaulHuwe
Copy link
Collaborator

@PaulHuwe PaulHuwe commented Apr 1, 2024

Resolves RAD-161

Closes #399

This PR adds a bit mask field to resample.

Checklist

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.38%. Comparing base (0fb1239) to head (4911a2f).
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #401   +/-   ##
=======================================
  Coverage   95.38%   95.38%           
=======================================
  Files           4        4           
  Lines         195      195           
=======================================
  Hits          186      186           
  Misses          9        9           

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

@PaulHuwe PaulHuwe marked this pull request as ready for review April 1, 2024 21:17
@PaulHuwe PaulHuwe requested review from kdupriestsci, jbrookens and a team as code owners April 1, 2024 21:17
Copy link
Collaborator

@ddavis-stsci ddavis-stsci left a comment

Choose a reason for hiding this comment

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

I'm curious why is this only in resample? The first input for the good_bits string is in outlier_detection_step. Shouldn't this be in both places? Are the resample good_bits independent of those in outlier detection?

@PaulHuwe
Copy link
Collaborator Author

PaulHuwe commented Apr 2, 2024

I'm curious why is this only in resample? The first input for the good_bits string is in outlier_detection_step. Shouldn't this be in both places? Are the resample good_bits independent of those in outlier detection?

@schlafly @mairanteodoro Can you reply?

@mairanteodoro
Copy link
Contributor

mairanteodoro commented Apr 2, 2024

I'm curious why is this only in resample? The first input for the good_bits string is in outlier_detection_step. Shouldn't this be in both places? Are the resample good_bits independent of those in outlier detection?

I think @ddavis-stsci is correct; the good_bits parameter has to be present in both steps, since resample is called from outlier detection step too. Maybe we should have an additional attribute for the resample parameters used with that specific step?

@PaulHuwe
Copy link
Collaborator Author

PaulHuwe commented Apr 2, 2024

I'm curious why is this only in resample? The first input for the good_bits string is in outlier_detection_step. Shouldn't this be in both places? Are the resample good_bits independent of those in outlier detection?

I think @ddavis-stsci is correct; the good_bits parameter has to be present in both steps, since resample is called from outlier detection step too. Maybe we should have an additional attribute for the resample parameters used with that specific step?

What are you proposing for the additional resample keywords?

@mairanteodoro
Copy link
Contributor

I'm curious why is this only in resample? The first input for the good_bits string is in outlier_detection_step. Shouldn't this be in both places? Are the resample good_bits independent of those in outlier detection?

I think @ddavis-stsci is correct; the good_bits parameter has to be present in both steps, since resample is called from outlier detection step too. Maybe we should have an additional attribute for the resample parameters used with that specific step?

What are you proposing for the additional resample keywords?

Perhaps meta.outlier_detection.resample?

@schlafly
Copy link
Collaborator

schlafly commented Apr 3, 2024

Thanks Dave, Paul, Mairan. Yes, I agree with Dave & Mairan that we need this. It's a little frustrating because I don't think there are any situations where we would want to allow these keywords to be different, but we do have them as separate steps so we should track them separately. The resample bit is only in the L3 products but the outlier rejection occurs on L2 images. The outlier rejection bit should definitely be optional since we don't intend any of the products we actually archive to have that keyword. The individual image metadata in an L3 file would include it, though, in principle; I don't know if that argues for something about how it is included in the metadata.

I think I'd argue for something like meta.outlier_detection.good_bits in the WFI image schema. If we keep this optional, as I think we should, I think we could go ahead and merge this one and make an issue for adding something parallel for outlier detection, since that wouldn't be a schema-breaking change?

@PaulHuwe
Copy link
Collaborator Author

PaulHuwe commented Apr 3, 2024

Thanks Dave, Paul, Mairan. Yes, I agree with Dave & Mairan that we need this. It's a little frustrating because I don't think there are any situations where we would want to allow these keywords to be different, but we do have them as separate steps so we should track them separately. The resample bit is only in the L3 products but the outlier rejection occurs on L2 images. The outlier rejection bit should definitely be optional since we don't intend any of the products we actually archive to have that keyword. The individual image metadata in an L3 file would include it, though, in principle; I don't know if that argues for something about how it is included in the metadata.

I think I'd argue for something like meta.outlier_detection.good_bits in the WFI image schema. If we keep this optional, as I think we should, I think we could go ahead and merge this one and make an issue for adding something parallel for outlier detection, since that wouldn't be a schema-breaking change?

@mairanteodoro and I chatted about this yesterday, and he requested we simply import the whole resample group within outlier detection (as a "sub-folder" named resample), which would be optional. Accordingly, good_bits would come along for the ride. Do you and @ddavis-stsci agree with this approach?

@mairanteodoro
Copy link
Contributor

mairanteodoro commented Apr 3, 2024

@mairanteodoro and I chatted about this yesterday, and he requested we simply import the whole resample group within outlier detection (as a "sub-folder" named resample), which would be optional. Accordingly, good_bits would come along for the ride. Do you and @ddavis-stsci agree with this approach?

@PaulHuwe I think we can go with @schlafly's suggestion and have only meta.outlier_detection.good_bits instead.

@ddavis-stsci
Copy link
Collaborator

ddavis-stsci commented Apr 3, 2024 via email

@PaulHuwe
Copy link
Collaborator Author

PaulHuwe commented Apr 3, 2024

@schlafly @mairanteodoro @ddavis-stsci Another wrinkle: there is no outlier_detection keyword group in RAD. Do we want to make one, or do we want to put its good_bits elsewhere?

@schlafly
Copy link
Collaborator

schlafly commented Apr 3, 2024 via email

@PaulHuwe
Copy link
Collaborator Author

PaulHuwe commented Apr 3, 2024

outlider_detection with good_bits added.

Copy link
Contributor

@mairanteodoro mairanteodoro left a comment

Choose a reason for hiding this comment

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

Looks good, @PaulHuwe! Thanks.
My only suggestion is to mention the new outlier detection group in CHANGES.rst.

CHANGES.rst Outdated Show resolved Hide resolved
type: string
propertyOrder: [good_bits]
flowStyle: block
required: [good_bits]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just making sure I understand---good_bits is required if outiler_detection is specified, but outlier_detection is not required in wfi_image. I think that's what you've written and that sounds right to me, but just checking!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct, that is what I intended with my implementation.

Copy link
Collaborator

@ddavis-stsci ddavis-stsci left a comment

Choose a reason for hiding this comment

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

LGTM

@PaulHuwe PaulHuwe merged commit 982fe1b into spacetelescope:main Apr 4, 2024
12 checks passed
@nden nden added this to the Build 14 milestone May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Bit Mask to Resample
7 participants