| 1 |
%YAML 1.1 |
| 2 |
--- |
| 3 |
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" |
| 4 |
id: "http://stsci.edu/schemas/gwcs/label_mapper-1.3.0" |
| 5 |
title: > |
| 6 |
Represents a mapping from a coordinate value to a label. |
| 7 |
description: | |
| 8 |
A label mapper instance maps inputs to a label. It is used together |
| 9 |
with |
| 10 |
[regions_selector](ref:regions_selector-1.3.0). The |
| 11 |
[label_mapper](ref:label_mapper-1.3.0) |
| 12 |
returns the label corresponding to given inputs. The |
| 13 |
[regions_selector](ref:regions_selector-1.3.0) |
| 14 |
returns the transform corresponding to this label. This maps inputs |
| 15 |
(e.g. pixels on a detector) to transforms uniquely. |
| 16 |
|
| 17 |
examples: |
| 18 |
- |
| 19 |
- Map array indices are to labels. |
| 20 |
- asdf-standard-1.6.0 |
| 21 |
- | |
| 22 |
!<tag:stsci.edu:gwcs/label_mapper-1.3.0> |
| 23 |
mapper: !core/ndarray-1.1.0 |
| 24 |
data: |
| 25 |
- [1, 0, 2] |
| 26 |
- [1, 0, 2] |
| 27 |
- [1, 0, 2] |
| 28 |
datatype: int64 |
| 29 |
shape: [3, 3] |
| 30 |
no_label: 0 |
| 31 |
|
| 32 |
- |
| 33 |
- Map numbers dictionary to transforms which return labels. |
| 34 |
- asdf-standard-1.6.0 |
| 35 |
- | |
| 36 |
!<tag:stsci.edu:gwcs/label_mapper-1.3.0> |
| 37 |
atol: 1.0e-08 |
| 38 |
inputs: [x, y] |
| 39 |
inputs_mapping: !transform/remap_axes-1.4.0 |
| 40 |
mapping: [0] |
| 41 |
n_inputs: 2 |
| 42 |
mapper: !!omap |
| 43 |
- !!omap |
| 44 |
labels: [-1.67833272, -1.9580548, -1.118888] |
| 45 |
- !!omap |
| 46 |
models: |
| 47 |
- !transform/shift-1.2.0 {offset: 6.0} |
| 48 |
- !transform/shift-1.2.0 {offset: 2.0} |
| 49 |
- !transform/shift-1.2.0 {offset: 4.0} |
| 50 |
no_label: 0 |
| 51 |
|
| 52 |
- |
| 53 |
- Map a number within a range of numbers to transforms which return labels. |
| 54 |
- asdf-standard-1.6.0 |
| 55 |
- | |
| 56 |
!<tag:stsci.edu:gwcs/label_mapper-1.3.0> |
| 57 |
mapper: !!omap |
| 58 |
- !!omap |
| 59 |
labels: |
| 60 |
- [3.2, 4.1] |
| 61 |
- [2.67, 2.98] |
| 62 |
- [1.95, 2.3] |
| 63 |
- !!omap |
| 64 |
models: |
| 65 |
- !transform/shift-1.3.0 {offset: 6.0} |
| 66 |
- !transform/shift-1.3.0 {offset: 2.0} |
| 67 |
- !transform/shift-1.3.0 {offset: 4.0} |
| 68 |
inputs: [x, y] |
| 69 |
inputs_mapping: !transform/remap_axes-1.4.0 |
| 70 |
mapping: [0] |
| 71 |
n_inputs: 2 |
| 72 |
|
| 73 |
allOf: |
| 74 |
- $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.4.0" |
| 75 |
- type: object |
| 76 |
properties: |
| 77 |
mapper: |
| 78 |
description: | |
| 79 |
A mapping of inputs to labels. |
| 80 |
In the general case this is a `astropy.modeling.core.Model`. |
| 81 |
|
| 82 |
It could be a numpy array with the shape of the detector/observation. |
| 83 |
Pixel values are of type integer or string and represent |
| 84 |
region labels. Pixels which are not within any region have value ``no_label``. |
| 85 |
|
| 86 |
It could be a dictionary which maps tuples to labels or floating point numbers to labels. |
| 87 |
|
| 88 |
anyOf: |
| 89 |
- tag: "tag:stsci.edu:asdf/core/ndarray-1.*" |
| 90 |
- $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.4.0" |
| 91 |
- type: object |
| 92 |
properties: |
| 93 |
labels: |
| 94 |
type: array |
| 95 |
items: |
| 96 |
anyOf: |
| 97 |
- type: number |
| 98 |
- type: array |
| 99 |
items: |
| 100 |
type: number |
| 101 |
minLength: 2 |
| 102 |
maxLength: 2 |
| 103 |
models: |
| 104 |
type: array |
| 105 |
items: |
| 106 |
$ref: "http://stsci.edu/schemas/asdf/transform/transform-1.4.0" |
| 107 |
|
| 108 |
inputs: |
| 109 |
type: array |
| 110 |
items: |
| 111 |
type: string |
| 112 |
description: | |
| 113 |
Names of inputs. |
| 114 |
inputs_mapping: |
| 115 |
$ref: "http://stsci.edu/schemas/asdf/transform/transform-1.4.0" |
| 116 |
description: | |
| 117 |
[mapping](https://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/transform/remap_axes-1.4.0.html) |
| 118 |
atol: |
| 119 |
type: number |
| 120 |
description: | |
| 121 |
absolute tolerance to compare keys in mapper. |
| 122 |
no_label: |
| 123 |
description: | |
| 124 |
Fill in value for missing output. |
| 125 |
anyOf: |
| 126 |
- type: number |
| 127 |
- type: string |
| 128 |
required: [mapper] |
| 129 |
... |