Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add printout for 3FGL catalog objects #898
@vorugantia - Thanks!
I tried if for one source, and currently you have this:
So there's a few things that can be improved here:
The way you can implement this is to do
for 3FGL and then to simply go top to bottom with the available fields, adding them to your
It's simpler to just do that and print all numbers than to discuss which number to show in which order. One thing you could omit for now is the spectral point info (what you get via
Once that's done, paste an example output here, and I'll give advice on possibly grouping information in a better way, or printing with less / more digits.
I know this is a bit tedious, but I think it might even be useful to you, to learn what all the information given in the Fermi catalog is. There's a good summary for each field at
For testing, you need to have a quick debug cycle.
and then to have the edit & save & test cycle by running:
You might have to run
once to make it work, i.e. that importing the local version from the source folder works.
@cdeil I'm now testing my code the way you suggested. I liked the way you organized the info for the HGPS catalog so I used the same format. Here is the output:
Here is what I'm uncertain about, if you would like to check them:
@vorugantia - Just some quick comments, I'll have a closer look tomorrow.
@cdeil - All of your most recent comments have been taken care of, except printing the
Wow, this is looking great!
I've left a few small comments inline.
My suggestion would be to not put the lightcurve table in this PR, but remove that part
(maybe leave a TODO comment) and wrap this up.
In the lightcurve section, the energy band is always the same, no?
I.e. 100 MeV - 100 GeV was used to derive all of these numbers.
Then I would suggest you just put this at the top once:
Lightcurve measured in the energy band: 100 MeV - 100 GeV
About the spectral point table, I'm not sure. I should have mentioned it before:
My thinking was that to print that info, we call
source.flux_points and then use the Astropy table formatting functionality to print the table.
So now you have re-implemented a mini table formatter here specifically for this application.
Actually, I would also suggest you leave this as-is for now, and pretty-printing for
LightCurve should just be separate, future pull requests.
What you can do for now is rename "Energy distribution" to "Energy flux", and print the sqrt(TS) with formatter
1234.5 instead of something like
12e3 like you have now, which I find hard to read and compare to the other values for some reason (for fluxes it's OK)
@cdeil - All comments were addressed in the latest commit. The output looks exactly the same as above (exept the ROI number). Unless you would like to reorder any other information, I think we're ready to merge the PR.
If you would like me to implement
@vorugantia - You have to adapt this one test:
I suggest a minimal edit to make the test pass.
@vorugantia - Do you know how to run the tests locally?
Either of those should work:
We're running the Gammapy workshops this week and next week, and there will be quite a few pull request for new contributors. So my suggestion would be that you leave Gammapy be for a week, and if you have time, add something to gamma-sky.net.
I know it's a lot tedious work to write the "view", but it'll be really useful, and you'll learn more Python scripting. In both cases (more JSON or text, or PNG image) I don't think it's trivial to get it done, but I think by now you have the Python / Gammapy chops that you could do it.
One more thing: if you want to be clean and a git professional, you would now squash all of those "update" commits into one commit with a good commit message (like the one you have for the first commit already), before this gets merged and then is forever the record of the Gammapy version history:
Just for reference: this is what it looks like at the moment: