This notebook demonstrates basic usage of the firefly_client API.
Note that it may be necessary to wait for some cells (like those displaying an image) to complete before executing later cells.
Imports for firefly_client
from firefly_client import FireflyClient
using_lab = False
url = 'http://127.0.0.1:8080/firefly'
#FireflyClient._debug= True
Settings for a WISE image for M81 at a selected band in HiPS format:
fc = FireflyClient.make_lab_client() if using_lab else FireflyClient.make_client(url)
target='148.892;69.0654;EQ_J2000'
fov_deg=0.5
size=0.2
image_basic_req = {
'Service': 'WISE',
'Title': 'Wise',
'SurveyKey': '3a',
'SurveyKeyBand': '2'
}
hips_basic_req = {
'title': 'A HiPS - 0.2',
'hipsRootUrl': 'http://alasky.u-strasbg.fr/AllWISE/RGB-W4-W2-W1'
}
A HiPS is displayed based on HiPS url
viewer_id = 'hipsDIV1'
r = fc.add_cell(0, 0, 4, 2, 'images', viewer_id)
if r['success']:
hips_url = 'http://alasky.u-strasbg.fr/DSS/DSSColor';
status = fc.show_hips(viewer_id=viewer_id, plot_id='aHipsID1-1', hips_root_url = hips_url,
Title='HiPS-DSS', WorldPt=target)
Change color attributes in this image:
fc.set_color('aHipsID1-1', colormap_id=6, bias=0.6, contrast=1.5)
Two more HiPS in the same viewer
hips_url = 'http://alasky.u-strasbg.fr/DSS/DSS2Merged';
status = fc.show_hips(plot_id='aHipsID1-2', hips_root_url = hips_url,
Title='HiPS-DSS2', WorldPt=target)
hips_url = 'http://alasky.u-strasbg.fr/AllWISE/RGB-W4-W2-W1'
status = fc.show_hips(plot_id='aHipsID2', hips_root_url=hips_url)