RangeValues#
- class firefly_client.RangeValues#
Bases:
object
Attributes Summary
Definition of stretch algorithm (dict).
Definition of stretch type (dict).
Methods Summary
create_rv
(stretch_type, lower_value, ...[, ...])create_rv_by_stretch_type
(algorithm, ...)create_rv_standard
(algorithm[, ...])Create range values for non-zscale cases.
create_rv_zscale
(algorithm[, ...])Create range values for zscale case.
parse_rvstring
(rvstring)parse a Firefly RangeValues string into a dictionary
rvstring_from_dict
(rvdict)create an rvstring from a dictionary
Attributes Documentation
- INVERSE_STRETCH_ALGORITHM = {44: 'linear', 45: 'log', 46: 'loglog', 47: 'equal', 48: 'squared', 49: 'sqrt', 50: 'asinh', 51: 'powerlaw_gamma'}#
- INVERSE_STRETCH_TYPE = {88: 'percent', 89: 'minmax', 90: 'absolute', 91: 'zscale', 92: 'sigma'}#
- STRETCH_ALGORITHM_DICT = {'asinh': 50, 'equal': 47, 'linear': 44, 'log': 45, 'loglog': 46, 'powerlaw_gamma': 51, 'sqrt': 49, 'squared': 48}#
Definition of stretch algorithm (dict).
- STRETCH_TYPE_DICT = {'absolute': 90, 'minmax': 89, 'percent': 88, 'sigma': 92, 'zscale': 91}#
Definition of stretch type (dict).
Methods Documentation
- classmethod create_rv(stretch_type, lower_value, upper_value, algorithm, zscale_contrast=25, zscale_samples=600, zscale_samples_perline=120, asinh_q_value=None, gamma_value=2.0, rgb_preserve_hue=0, asinh_stretch=None, scaling_k=1.0)#
- classmethod create_rv_by_stretch_type(algorithm, stretch_type, **additional_params)#
- classmethod create_rv_standard(algorithm, stretch_type='Percent', lower_value=1, upper_value=99, **additional_params)#
Create range values for non-zscale cases.
Parameters#
- algorithm{‘Linear’, ‘Log’, ‘LogLog’, ‘Equal’, ‘Squared’, ‘Sqrt’}
Stretch algorithm.
- stretch_type{‘Percent’, ‘Absolute’, ‘Sigma’}
Stretch type.
- lower_value: int or float
Lower end of stretch.
- upper_value: int or float
Upper end of stretch
- **additional_paramsoptional keyword arguments
Algorithm specific parameters for changing the stretch. The options are shown as below:
- asinh_q_valuefloat, optional
The asinh softening parameter for Asinh stretch. Use Q=0 for linear stretch, increase Q to make brighter features visible. When not specified, Q is calculated by Firefly to use full color range.
- gamma_value
The gamma value for Power Law Gamma stretch
Returns#
- outstr
a serialized range values string
- classmethod create_rv_zscale(algorithm, zscale_contrast=25, zscale_samples=600, zscale_samples_perline=120, **additional_params)#
Create range values for zscale case.
Parameters#
- algorithm: {‘Linear’, ‘Log’, ‘LogLog’, ‘Equal’, ‘Squared’, ‘Sqrt’}
Stretch algorithm.
- zscale_contrast: int
Zscale contrast.
- zscale_samples: int
Zscale samples
- zscale_samples_perline: int
Zscale samples per line
- **additional_paramsoptional keyword arguments
Algorithm specific parameters for changing the stretch. The options are shown as below:
- asinh_q_valuefloat, optional
The asinh softening parameter for Asinh stretch. Use Q=0 for linear stretch, increase Q to make brighter features visible. When not specified, Q is calculated by Firefly to use full color range.
- gamma_value
The gamma value for Power Law Gamma stretch
Returns#
- outstr
a serialized range values string