-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fermi 2nd and 3rd Pulsar Catalog #4699
Conversation
gammapy/catalog/core.py
Outdated
return source | ||
|
||
@lazyproperty | ||
def _lookup_spectral_source_idx(self): | ||
names = [_.strip() for _ in self.spectral_table["PSR_Name"]] |
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.
Is it not a bit surprising that in the `SourceCatalog' class the spectral parameters are only for pulsar? Is this function well placed?
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.
"PSR_Name"
could be replaced by self._source_name_key
and same for "Source_Name"
in _lookup_extended_source_idx
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.
@bkhelifi, in other catalogs the main hdu contains the spectral parameters, while in the pulsar catalog the main hdu contain the pulsar specs.
@MRegeard , is it ready to be reviewed or some work is still needed to add later on the 3PC? |
Codecov Report
@@ Coverage Diff @@
## main #4699 +/- ##
==========================================
- Coverage 75.53% 75.01% -0.52%
==========================================
Files 223 226 +3
Lines 32666 33396 +730
==========================================
+ Hits 24675 25053 +378
- Misses 7991 8343 +352
... and 18 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
) | ||
|
||
@property | ||
def flux_points(self): |
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 would put in argument the format
|
||
One source is represented by `~gammapy.catalog.SourceCatalogObject2PC`. | ||
|
||
TODO : Fix the UnitsWarning here ... |
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.
What do you mean?
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.
Even with the warning filter when reading the table, I still have a units warning, which is really annoying.
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
I think that I made most of the implementations here. We still miss the light curve implementation, that is pending issue #4782. |
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.
Thanks @MRegeard. See inline question and comment!
if self._source_name_key in data and self._source_name_key == "PSR_Name": | ||
name_spectral = data[self._source_name_key].strip() | ||
elif self._source_name_key in data and self._source_name_key == "PSRJ": | ||
name_spectral = f"PSR{data[self._source_name_key].strip()}" |
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.
Is the 'J' for 'PSRJ' already connected to data[self._source_name_key]
?
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.
What do you mean ?
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
Signed-off-by: Maxime Regeard <regeard@apc.in2p3.fr>
I will split this big PR into small pieces. |
Splitted into 3 PRs so closing this one. |
This pull request introduce the 2PC Fermi-LAT catalog to
gammapy.catalog
sub-package.The catalog fits file consist of 2 main HDUs:
Therefore, I had to modify a little bit the core class
SourceCatalog
andSourceCatalogObject
to account for the spectral parameters to be in another HDU (as with theextended_source_table
).I still need to make the
SourceCatalogObject
class for this catalog.