Skip to content

Commit

Permalink
pass api_args
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrammer committed Jun 5, 2023
1 parent 02d9882 commit fdea203
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions eazy/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def get_filters_from_api(self):
return olap


def make_dash_app(self, template='plotly_white', server_mode='external', port=8050, app=None, app_type='jupyter', plot_height=680, external_stylesheets=['https://codepen.io/chriddyp/pen/bWLwgP.css'], infer_proxy=False, slider_width=140, cutout_hdu=None, cutout_rgb=None, cutout_size=10, api_filters=None, api_size=2, PLOT_TYPES=['zphot-zspec', 'Mag-redshift', 'Mass-redshift', 'UVJ', 'RA/Dec', 'UV-redshift', 'chi2-redshift'], get_content=False):
def make_dash_app(self, template='plotly_white', server_mode='external', port=8050, app=None, app_type='jupyter', plot_height=680, external_stylesheets=['https://codepen.io/chriddyp/pen/bWLwgP.css'], infer_proxy=False, slider_width=140, cutout_hdu=None, cutout_rgb=None, cutout_size=10, api_filters=None, api_size=2, api_args='', PLOT_TYPES=['zphot-zspec', 'Mag-redshift', 'Mass-redshift', 'UVJ', 'RA/Dec', 'UV-redshift', 'chi2-redshift'], get_content=False):
"""
Create a Plotly/Dash app for interactive exploration
Expand Down Expand Up @@ -257,6 +257,7 @@ def make_dash_app(self, template='plotly_white', server_mode='external', port=80
self.COLOR_TYPES = COLOR_TYPES
self.PLOT_TYPES = PLOT_TYPES
self.cutout_data = None
self.cutout_wcs = None
self.api_filters = api_filters

#_title = f"{self.photoz.param['MAIN_OUTPUT_FILE']}"
Expand All @@ -278,7 +279,7 @@ def make_dash_app(self, template='plotly_white', server_mode='external', port=80
# 'use': 'Use == 1'}

if cutout_hdu is not None:
cutout_wcs = pywcs.WCS(cutout_hdu.header, relax=True)
self.cutout_wcs = pywcs.WCS(cutout_hdu.header, relax=True)
if cutout_rgb is None:
self.cutout_data = cutout_hdu.data
else:
Expand All @@ -296,6 +297,7 @@ def make_dash_app(self, template='plotly_white', server_mode='external', port=80
'top':'10px',
'position':'absolute'})
cutout_target = 'figure'

elif api_filters is not None:

cutout_div = html.Div([
Expand Down Expand Up @@ -895,7 +897,8 @@ def heroku_thumbnail(id_i):
ri, di = self.df['ra'][ix], self.df['dec'][ix]

turl = f'https://grizli-cutout.herokuapp.com/thumb?'
turl += f'ra={ri}&dec={di}&size={api_size}&filters={api_filters}'
turl += f'ra={ri}&dec={di}&size={api_size}'
turl += f'{api_args}&filters={api_filters}'
#print(turl)
# with open('/tmp/thumb.log','a') as fp:
# fp.write(turl+'\n')
Expand Down

0 comments on commit fdea203

Please sign in to comment.