gwcs.selector¶
The classes in this module create discontinuous transforms.
The main class is RegionsSelector. It maps inputs to transforms
and evaluates the transforms on the corresponding inputs.
Regions are well defined spaces in the same frame as the inputs.
Regions are assigned unique labels (int or str). The region
labels are used as a proxy between inputs and transforms.
An example is the location of IFU slices in the detector frame.
RegionsSelectoruses two structures:A mapping of inputs to labels - “label_mapper”
A mapping of labels to transforms - “transform_selector”
A “label_mapper” is also a transform, a subclass of astropy.modeling.Model,
which returns the labels corresponding to the inputs.
An instance of a LabelMapper class is passed to RegionsSelector.
The labels are used by RegionsSelector to match inputs to transforms.
Finally, RegionsSelector evaluates the transforms on the corresponding inputs.
Label mappers and transforms take the same inputs as
RegionsSelector. The inputs should be filtered appropriately using the
inputs_mapping argument which is ian instance of
Mapping. The transforms in “transform_selector”
should have the same number of inputs and outputs.
This is illustrated below using two regions, labeled 1 and 2
+-----------+
| +-+ |
| | | +-+ |
| |1| |2| |
| | | +-+ |
| +-+ |
+-----------+
Label mapper workflow:
+--------------+
| label mapper |
+--------------+
^ |
| V
----------| +-------+
| | label |
+--------+ +-------+
---> | inputs | |
+--------+ V
| +--------------------+
| | transform_selector |
| +--------------------+
V |
+-----------+ |
| transform |<-----------
+------------+
|
V
+---------+
| outputs |
+---------+
The base class _LabelMapper can be subclassed to create other label mappers.
Classes
|
Maps inputs to regions. |
|
Maps array locations to labels. |
|
Maps a number to a transform, which when evaluated returns a label. |
|
The structure this class uses maps a range of values to a transform. |
|
This model defines discontinuous transforms. |