-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add general Background classes #370
Conversation
592bd3b
to
b344016
Compare
The background classes are now callable. The |
@@ -158,13 +158,13 @@ mesh of a grid that covers the input data to create a low-resolution | |||
background map. The final background or background rms map can then | |||
be generated by interpolating the low-resolution map. |
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.
I guess this comment really belongs just a bit further up... But I wonder if you should add a short example in the previous section that demos all of the various Background (not 2D) classes? Right now it all uses the sigma clipping functions, but now you can insert all of the various estimators implemented here. Maybe this could just be a (logarithmic) histogram of the pixel values and then mark the output of the estimators as vertical lines?
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.
Yes, I didn't add the new Background classes to narrative docs yet. I wanted to wait until the API was firmly decided.
@larrybradley - left some inline comments above, and I've got one more general suggestion: So I have an alternate suggestion that I think is just a small perturbation on what you've done already: change |
Thanks, @eteq! Please review the updates. |
looks great to me now, @larrybradley ... except for the test failures. Any idea what might be specific about numpy 1.9 that would cause this? |
@eteq Thanks. I guess you missed the ongoing saga with [1] astropy/ci-helpers#97 |
Ohhh, gotcha - I was confused by the fact that all of the other versions still work, but I see now from those ci issues that 1.9 is indeed problematic. But given that the others passed, I would think this is good to merge (assuming you're done making changes, @larrybradley ?) |
This large PR contains the following changes:
background.py
module into abackground
subpackage.MeanBackground
MedianBackground
MMMBackground
SExtractorBackground
BiweightLocationBackground
StdBackgroundRMS
MADStdBackgroundRMS
BiweightMidvarianceBackgroundRMS
Sigma-clipping is performed by default, but can be turned off by setting
sigclip = False
.3. The existing
BackgroundBase
,Background
andBackgroundIDW
classes are now calledBackgroundBase2D
,Background2D
, andBackgroundIDW2D
, respectively, since they return 2D background images.My plan is to submit another PR to integrate the general background classes into the 2D background classes (with a similar interface).
Example
The classes are designed to be used as an object-oriented interface for other functions, e.g.:
in function form (requires
calc_background
->__call__
):where the user can define custom background classes if desired.
cc: @eteq, @hcferguson