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

Add FoVBackgroundMaker class #2697

Merged
merged 13 commits into from Jan 8, 2020
Merged

Conversation

registerrier
Copy link
Contributor

Description

This pull request introduces a FoVBackgroundMaker class. It is very simple. It takes an exclusion mask on __init__. FoVBackgroundMaker.run(dataset) simply performs a fit of the model. The assumption here is that it only consists of the background_model.

Tests have been included, in particular one checking that in case of non-convergence the parameters are the initial ones. In this case a simple log.warning is raised. (this should be tested properly). It is not clear that this is the best behavior. Because ideally the dataset should be excluded.

Dear reviewer

please comment on the choice of for non-convergence.

@registerrier registerrier added this to In progress in gammapy.datasets via automation Dec 24, 2019
@registerrier registerrier added this to the 0.16 milestone Dec 24, 2019
@codecov
Copy link

codecov bot commented Dec 24, 2019

Codecov Report

Merging #2697 into master will increase coverage by 0.04%.
The diff coverage is 98.03%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2697      +/-   ##
=========================================
+ Coverage   91.66%   91.7%   +0.04%     
=========================================
  Files         142     143       +1     
  Lines       15988   16040      +52     
=========================================
+ Hits        14655   14710      +55     
+ Misses       1333    1330       -3
Impacted Files Coverage Δ
gammapy/cube/__init__.py 100% <100%> (ø) ⬆️
gammapy/cube/fov.py 98% <98%> (ø)
gammapy/cube/fit.py 89.65% <0%> (ø) ⬆️
gammapy/maps/wcs.py 96.58% <0%> (ø) ⬆️
gammapy/modeling/iminuit.py 95.5% <0%> (+4.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 486ed97...54a0126. Read the comment docs.

adonath
adonath previously approved these changes Jan 7, 2020
Copy link
Member

@adonath adonath left a comment

Choose a reason for hiding this comment

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

Thanks a lot @registerrier, I've left one minor inline comment concerning the fit method.

I think we should also add an example somewhere how to use this class, either in docs/cube/index.rst or maybe analysis_2.ipynb.

Otherwise looks good to me. Please merge whenever you think its ready.

gammapy/cube/fov.py Outdated Show resolved Hide resolved
@registerrier
Copy link
Contributor Author

Modifications to the tutorials will be made in a further pull request.
All tests pass. Merging.

@registerrier registerrier merged commit 123c12d into gammapy:master Jan 8, 2020
gammapy.datasets automation moved this from In progress to Done Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants