-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Basic (boxcar) background subtraction #86
Conversation
ae82252
to
beae68d
Compare
Please add the following options, which I consider to be essential:
|
Typo in the description of the PR: |
d91df4e
to
d861d5a
Compare
this should be fixed now. The slicing was collapsing the axes so returning a single value instead of an array, which oddly didn't cause the rest of the code to complain. Now it returns the same shape for the background_image and it seems reasonable on the example data in the notebook. Thanks for noticing that! |
some tests will need to be added before this can be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works without issue for me. I see improved performance as the given trace comes closer to the image's actual trace, which is sensible. The test passes.
I think I missed the conversation on the one and two-sided options, but the implementation looks OK to me. I left a couple of more minor comments that shouldn't prevent a merge but could be helpful for the future.
Based on the commented cell in notebook_sandbox/jwst_boxcar/boxcar_extraction.ipynb
, it looks like a merge should wait until #85 is finished so the notebook can be updated first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me for now. thanks for adding the test!
* requires exposing some internal methods from Boxcar extract to re-use here * adds and uses +/- offset support to traces * updates the notebook with a basic use-case
* not robust enough for numpy types, etc, so for now we'll remove
* with factory classmethods for one_sided and two_sided which handle the separation from an input spectrum trace
* defaults to 'average' * median does not support partial-pixel-weights
* including within subtraction by calling image.subtract if image is an instance of NDData
b1fb5a3
to
d1f1837
Compare
Rebased on top of #85 and added a call to |
great! i'll merge once CI completes, if that's ok. |
Yep, go ahead and merge if you're happy. I just quickly address @ojustino's suggestions for inline comments and docstrings (sorry that re-triggered CI to restart). |
a4167ad
to
623248b
Compare
This PR implements
specreduce.background.Background(image, trace/center, separation, width)
support.The current API supports the following pseudo-code (see the edited notebook for full details):
In doing so, this: