0 votes
44 views
asked Sep 14 by daranorman (160 points) | 44 views
As an extension of this question, I have a .fits table that a collaborator shared with me.  I would like to cross match it (ra,dec) with legacy survey catalog files in datalab, but the instructions for Crossmatch talk only about .csv files.   Is there a way to crossmatch a fits table short of reading it in and writing it back out as a .csv?
Hi daranorman,

I am also having the same issue. But I can convert my .fits table into .csv file. But could you share the example of the crossmatch with me?

Thanks a lot,
Huanian

3 Answers

0 votes
The ability to import a FITS file to MyDB and then use that in a crossmatch query is in testing now and should be available shortly.  Until then you would need to first read the FITS file in your client and convert it to CSV/Pandas for import.  For smaller Data Lab tables you could query for (id,ra,dec) and do the crossmatch in the client, the import option is almost always going to be faster though.
answered Sep 14 by datalab (9,120 points)
0 votes
Another option is to read the FITS file in a Jupyter Notebook with Astropy to get a Table, and then convert to a pandas dataframe, which can be uploaded to MyDB to make the cross-match. This is a work-around until the DL team finishes implementing a direct way to upload a FITS file into MyDB.
answered Sep 25 by anonymous
0 votes
The feature that adds support for importing FITS BINTABLEs to mydb has now been deployed and is available from the notebook server.  The basic syntax is:

    status = queryClient.mydb_import(<table_name>, <path_to_FITS_file>)

For example,

    status = queryClient.mydb_import('mytab', './mytab.fits')

would create a mydb://mytab table from the 'mytab.fits' file in your notebook directory.  You can then use 'mytab' in a query or from the crossmatch service.  If you have multiple FITS file to make up a table, the 'append=True' parameter can be set to append data to an existing table.  If the FITS file contains multiple extensions, the extension number can be added to the FITS path, e.g. "mytab.fits[3]" will load extension 3 of the file.

Please let us know if you still have questions or find any problems.
answered Oct 9 by datalab (9,120 points)

198 questions

195 answers

183 comments

1,364 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.