from __future__ import print_function, division, absolute_import
from firefly_client import FireflyClient
url='http://127.0.0.1:8080/firefly'
html = 'slate.html'
fc = FireflyClient(url, html_file=html)
fc.launch_browser()
# Add a three color fits
# in cell 0, 0, 1, 1
target = '210.80227;54.34895;EQ_J2000' #Galaxy M101
viewer_id = '3C'
r = fc.add_cell(0, 0, 1, 1, 'images', viewer_id)
rv = '92,-2,92,8,NaN,2,44,25,600,120'
if r['success']:
threeC= [
{
'Type' : 'SERVICE',
'Service' : 'WISE',
'Title' : '3 color',
'SurveyKey' : '3a',
'SurveyKeyBand': '3',
'WorldPt' : target,
'RangeValues': rv,
'SizeInDeg' : '.14'
},
{
'Type' : 'SERVICE',
'Service' : 'WISE',
'Title' : '3 color',
'SurveyKey' : '3a',
'SurveyKeyBand': '2',
'WorldPt' : target,
'RangeValues': rv,
'SizeInDeg' : '.14'
},
{
'Type' : 'SERVICE',
'Service' : 'WISE',
'Title' : '3 color',
'SurveyKey' : '3a',
'SurveyKeyBand': '1',
'WorldPt' : target,
'RangeValues': rv,
'SizeInDeg' : '.14'
}]
fc.show_fits_3color(threeC, plot_id='wise_m101', viewer_id=viewer_id)
# Set stretch using hue-preserving algorithm with scaling coefficients .15 for RED, 1.0 for GREEN, and .4 for BLUE.
fc.set_stretch_hprgb(plot_id='wise_m101', asinh_q_value=4.2, scaling_k=[.15,1,.4])
# Set per-band stretch
fc.set_stretch(plot_id='wise_m101', stype='ztype', algorithm='asinh', band='ALL')