Repository navigation
Conversation
|
@adonath - I've assigned this issue to you and given you write access to my fork. |
|
I now think trying to implement our own Table JSON serialisation is pointless / futile ... sorry @adonath for leading you down this path. See astropy/astropy#4604 I'll sleep on this and wait for feedback on astropy/astropy#4604 and then do something here ... probably drop vector columns for now and then call @kepta - If you want to start with the website displaying 2FHL catalog info already, you could do something like this, i.e. just keep a few columns and it'll work: from astropy.table import Table
table = Table.read('https://github.com/gammapy/gammapy-extra/blob/master/datasets/catalogs/fermi/gll_psch_v08.fit.gz?raw=true')
cols = ['Source_Name', 'RAJ2000', 'DEJ2000', 'GLON', 'GLAT', 'CLASS']
df = table[cols].to_pandas()
df.to_json()Let me know if you have any questions! |
|
@cdeil No problem, using pandas dataframes seems to be the better solution...close PR? |
|
@adonath - If you have time, could you add Having this would be useful e.g. when building this webpage: |
|
Here's a proposal for a solution: The key is to get rid of the Numpy data types by calling @adonath - Do you have time to do this or should I? |
|
I'm closing this PR now. For now, we can dump the catalog info we want with a few lines of Python code: So it's probably not needed that we introduce JSON dump code in Gammapy. |
This pull request implements utility methods to dump catalogs to JSON.
This is useful for displaying catalog information in web pages.