Add background to map model evaluator #1470
Merged
Conversation
I've left a few minor comments, otherwise looks good to me.. |
gammapy/cube/fit.py
Outdated
@@ -29,11 +29,12 @@ class SkyModelMapFit(object): | |||
PSF kernel | |||
""" | |||
|
|||
def __init__(self, model, counts, exposure, psf=None): | |||
def __init__(self, model, counts, exposure, psf=None, background=None): |
adonath
Jul 10, 2018
Member
Please add the background to the docstring as well.
Please add the background to the docstring as well.
gammapy/cube/tests/test_fit.py
Outdated
@pytest.fixture(scope='session') | ||
def background(geom): | ||
m = Map.from_geom(geom) | ||
m.quantity = np.ones((9, 150, 400))*1e-5 |
adonath
Jul 10, 2018
Member
Can you infer the data shape from the geom
object, when geom
changes it will fail otherwise...
Can you infer the data shape from the geom
object, when geom
changes it will fail otherwise...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
The SkyModelEvaluator now adds background to the npred.
The fit stats value needed to be changed in the test (also mentioned in @mackaiver PR #1466 )