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

Improve 4FGL catalog support #2448

Merged
merged 17 commits into from Oct 15, 2019
Merged

Improve 4FGL catalog support #2448

merged 17 commits into from Oct 15, 2019

Conversation

@QRemy
Copy link
Contributor

QRemy commented Oct 10, 2019

-add 4FGL sources infos
-add spatial_model, sky_model, and lightcurve for 4FGL sources
-fix lightcurve infos display for 3FGL and 4FGL sources

@cdeil cdeil added this to the 0.15 milestone Oct 10, 2019
@cdeil cdeil self-assigned this Oct 10, 2019
@cdeil cdeil added the feature label Oct 10, 2019
@adonath adonath requested a review from cdeil Oct 11, 2019
@cdeil

This comment has been minimized.

Copy link
Member

cdeil commented Oct 15, 2019

@QRemy - Thanks!

Comments based on

pytest -v -s gammapy/catalog/tests/test_fermi.py --cov gammapy.catalog --cov-report html

and a quick view at the code with PyCharm.

Please add the lines to generate the reference txt data files to make.py, and change the filenames to match the style of 3FGL (lower-case and with underscore).

Then copy & paste the TestFermi3FGLObject.test_str to TestFermi4FGLObject.test_str, change the sources to 4FGL, and get it to pass (fails for me locally, didn't look why).

For the spatial model, I see in the coverage that the GaussianSpatialModel case isn't tested - please add a test.

I think the _info_position method is 100% identical. Can you please pull this (and any other method if possible) into a base class SourceCatalogObjectFermiBase and inherit from it to avoid the copy & paste. We should try to reduce the code duplication, but keep it simple, i.e. it's a case-by-case decision what to put in the base class and not. But I think there are some quick wins, like _info_position, where we can avoid some code duplication without introducing much complexity.

Please push and leave another comment here, and I'll review again (or directly merge in).

QRemy added 10 commits Oct 9, 2019
force str for filename (could be a Path object)
add another way to write energy
because of Fermi 8 years diffuse model (gll_iem_v07)
add test files for 4FGL and fix test file for one 3FGL variable source
-moved to base class:
     - __str__()
     - _info_basic()
     - _info_position()
     -_info_morphology()
     -_info_spectral_points()
     -sky_model()
     -is_pointlike()
- methods empty by default:
     - _info_more()
     - _info_spectral_fit()
     - _info_lightcurve()
@QRemy QRemy force-pushed the QRemy:add_4FGL_extended branch from e608b24 to c79908a Oct 15, 2019
@QRemy

This comment has been minimized.

Copy link
Contributor Author

QRemy commented Oct 15, 2019

I have defined a SourceCatalogObjectFermiBase used with 3FGL, 3FHL, and 4FGL

  • moved to base class:
    • str()
    • _info_basic()
    • _info_position()
    • _info_morphology()
    • _info_spectral_points()
    • sky_model()
    • is_pointlike()
  • methods empty by default
    • _info_more()
    • _info_spectral_fit()
    • _info_lightcurve()
Copy link
Member

cdeil left a comment

A few more minor comments inline. Otherwise looks great (based on a very quick look).

gammapy/catalog/tests/data/make.py Outdated Show resolved Hide resolved
gammapy/catalog/tests/data/4fgl_J0001.5+2113.txt Outdated Show resolved Hide resolved
gammapy/catalog/tests/data/4fgl_J0001.5+2113.txt Outdated Show resolved Hide resolved
gammapy/catalog/fermi.py Show resolved Hide resolved
QRemy and others added 5 commits Oct 15, 2019
@cdeil
cdeil approved these changes Oct 15, 2019
Copy link
Member

cdeil left a comment

@QRemy - Thanks!

@cdeil cdeil changed the title Improve 4FGL catalogue support Improve 4FGL catalog support Oct 15, 2019
@cdeil cdeil merged commit 56c1921 into gammapy:master Oct 15, 2019
6 of 9 checks passed
6 of 9 checks passed
Codacy/PR Quality Review Hang in there, Codacy is reviewing your Pull request.
Details
Scrutinizer Running
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
gammapy.gammapy Build #20191015.25 succeeded
Details
gammapy.gammapy (DevDocs) DevDocs succeeded
Details
gammapy.gammapy (Lint) Lint succeeded
Details
gammapy.gammapy (Test Python36) Test Python36 succeeded
Details
gammapy.gammapy (Test Windows36) Test Windows36 succeeded
Details
gammapy.gammapy (Test Windows37) Test Windows37 succeeded
Details
@cdeil cdeil mentioned this pull request Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.