This notebook demonstrates basic usage of the firefly_client API show_table for the file with multiple tables.
Note that it may be necessary to wait for some cells (like those displaying an table) to complete before executing later cells.
Imports for Python 2/3 compatibility
from __future__ import print_function, division, absolute_import
Imports for firefly_client
from firefly_client import FireflyClient
In this example we assume the server is running locally, e.g. via a Firefly Docker image obtained from https://hub.docker.com/r/ipac/firefly/tags/.
url='http://127.0.0.1:8080/firefly'
fc = FireflyClient(url)
localbrowser, browser_url = fc.launch_browser()
The test files uesd below are available in git-lfs repo at https://github.com/lsst/firefly_test_data.
In the following, please set testdata_repo_path
to be the path where firefly_test_data
is locally located.
import os
testdata_repo_path = '/hydra/cm' # to be reset to where 'firefly_test_data' is located at.
localfile = os.path.join(testdata_repo_path, 'firefly_test_data/FileUpload-samples/fits/problemFits/src.fits')
filename = fc.upload_file(localfile)
fc.show_table(filename)
fc.show_table(filename, table_index=2)
localfile = os.path.join(testdata_repo_path, 'firefly_test_data/FileUpload-samples/VOTable/tabledata/multiTables_Ned.xml')
filename = fc.upload_file(localfile)
fc.show_table(filename, tbl_id='votable-0')
fc.show_table(filename, tbl_id='votable-1', table_index=1)