class gwcs.selector.LabelMapperRange(inputs, mapper, inputs_mapping=None, name=None, **kwargs)[source]

Bases: gwcs.selector._LabelMapper

The structure this class uses maps a range of values to a transform. Given an input value it finds the range the value falls in and returns the corresponding transform. When evaluated the transform returns a label.

Example: Pick a transform based on wavelength range. For an IFU observation, the keys are (lambda_min, lambda_max) tuples and values are transforms which return a label corresponding to a slice.

inputs : tuple of str

Names for the inputs, e.g. (‘alpha’, ‘beta’, ‘lambda’)

mapper : dict

Maps tuples of length 2 to transforms.

inputs_mapping : Mapping

An optional Mapping model to be prepended to the LabelMapper with the purpose to filter the inputs or change their order.

atol : float

Absolute tolerance when comparing inputs to mapper.keys. It is passed to np.isclose.

name : str

The name of this transform.

Attributes Summary

fittableinputsThe name(s) of the input variable(s) on which a model is evaluated.linearoutputsstandard_broadcasting

Methods Summary

evaluate(*args)Evaluate the model on some input variables.

Attributes Documentation

fittable = False

The name(s) of the input variable(s) on which a model is evaluated.

linear = False
outputs = ('labels',)
standard_broadcasting = False

Methods Documentation


Evaluate the model on some input variables.