Getting Started#

Prerequisites#

  • Python 3

  • firefly_client (installable with pip install firefly_client)

  • URL for a Firefly server

Getting Started#

First, download some data by using wget or curl:

wget http://web.ipac.caltech.edu/staff/roby/demo/2mass-m31-green.fits
wget http://web.ipac.caltech.edu/staff/roby/demo/m31-2mass-2412-row.tbl

curl -o 2mass-m31-green.fits http://web.ipac.caltech.edu/staff/roby/demo/2mass-m31-green.fits
curl -o m31-2mass-2412-row.tbl http://web.ipac.caltech.edu/staff/roby/demo/m31-2mass-2412-row.tbl

Second, start a Python session and connect an instance of firefly_client.FireflyClient to a Firefly server. In this example, we use a public server. For ease of demonstration, please start the Python session in the directory from which you downloaded the sample files.

from firefly_client import FireflyClient
fc = FireflyClient.make_client('https://irsa.ipac.caltech.edu/irsaviewer')

Third, open a new browser tab using the FireflyClient.launch_browser() method. If a browser cannot be opened, a URL will be displayed for your web browser.

fc.launch_browser()

Fourth, display an image in a FITS file by uploading the file to the server with FireflyClient.upload_file() and then showing the image.

fval = fc.upload_file('2mass-m31-green.fits')
fc.show_fits(fval)

Fifth, display a table by uploading a catalog table (here, in IPAC format) and then showing the table. The sources are also overlaid automatically on the image since the catalog contains celestial coordinates, and a default chart is displayed.

tval = fc.upload_file('m31-2mass-2412-row.tbl')
fc.show_table(tval)