Skip to content

Commit

Permalink
translate and pass Q and gamma parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
stargaser committed Jul 27, 2018
1 parent 09241ba commit 66df1c8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions python/lsst/display/firefly/firefly.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,15 @@ def _scale(self, algorithm, min, max, unit=None, *args, **kwargs):
else:
algorithm = 'linear'

# Translate parameters for asinh and powerlaw_gamma stretches
if 'Q' in kwargs:
kwargs['asinh_q_value'] = kwargs['Q']
del kwargs['Q']

if 'gamma' in kwargs:
kwargs['gamma_value'] = kwargs['gamma']
del kwargs['gamma_value']

if min == 'minmax':
interval_type = 'percent'
unit = 'percent'
Expand Down Expand Up @@ -335,7 +344,7 @@ def _scale(self, algorithm, min, max, unit=None, *args, **kwargs):

if interval_type is not 'zscale':
_fireflyClient.set_stretch(str(self.display.frame), stype=interval_type, algorithm=algorithm,
lower_value=min, upper_value=max)
lower_value=min, upper_value=max, **kwargs)
else:
if 'zscale_constrast' not in kwargs:
kwargs['zscale_contrast'] = 25
Expand All @@ -344,9 +353,7 @@ def _scale(self, algorithm, min, max, unit=None, *args, **kwargs):
if 'zscale_samples_perline' not in kwargs:
kwargs['zscale_samples_perline'] = 120
_fireflyClient.set_stretch(str(self.display.frame), stype='zscale', algorithm=algorithm,
zscale_contrast=kwargs['zscale_contrast'],
zscale_samples=kwargs['zscale_samples'],
zscale_samples_perline=kwargs['zscale_samples_perline'])
**kwargs)

def _setMaskTransparency(self, transparency, maskplane):
"""Specify mask transparency (percent); or None to not set it when loading masks"""
Expand Down

0 comments on commit 66df1c8

Please sign in to comment.