regions_selector-1.0.0¶
Represents a discontinuous transform.
Description
Maps regions to transgorms and evaluates the transforms with the corresponding inputs.
Outline
Schema Definitions ¶
This node must validate against all of the following:
This type is an object with the following properties:
label_mapper
./label_mapper-1.0.0 Required An instance of label_mapper-1.0.0
inputs
array Required No length restrictionNames of inputs.
Items in the array are restricted to the following types:
No length restrictionstring
outputs
array Required No length restrictionNames of outputs.
Items in the array are restricted to the following types:
No length restrictionstring
selector
object Required A mapping of regions to trransforms.
This type is an object with the following properties:
labels
array No length restrictionAn array of unique region labels.
Items in the array are restricted to the following types:
[‘integer’, ‘string’]
transforms
array No length restrictionA transform for each region. The order should match the order of labels.
Items in the array are restricted to the following types:
undefined_transform_value
number Value to be returned if there’s no transform defined for the inputs.
Examples ¶
Create a regions_selector schema for 2 regions, labeled “1” and “2”.:
!transform/regions_selector-1.0.0
inputs: [x, y]
label_mapper: !transform/label_mapper-1.0.0
mapper: !core/ndarray-1.0.0
datatype: int8
data:
[[0, 1, 1, 0, 2, 0],
[0, 1, 1, 0, 2, 0],
[0, 1, 1, 0, 2, 0],
[0, 1, 1, 0, 2, 0],
[0, 1, 1, 0, 2, 0]]
outputs: [ra, dec, lam]
selector:
1: !transform/compose-1.0.0
forward:
- !transform/remap_axes-1.0.0
mapping: [0, 1, 1]
- !transform/concatenate-1.0.0
forward:
- !transform/concatenate-1.0.0
forward:
- !transform/shift-1.0.0 {offset: 1.0}
- !transform/shift-1.0.0 {offset: 2.0}
- !transform/shift-1.0.0 {offset: 3.0}
2: !transform/compose-1.0.0
forward:
- !transform/remap_axes-1.0.0
mapping: [0, 1, 1]
- !transform/concatenate-1.0.0
forward:
- !transform/concatenate-1.0.0
forward:
- !transform/scale-1.0.0 {factor: 2.0}
- !transform/scale-1.0.0 {factor: 3.0}
- !transform/scale-1.0.0 {factor: 3.0}
undefined_transform_value: .nan
Original Schema ¶
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/transform/regions_selector-1.0.0"
title: >
Represents a discontinuous transform.
description: |
Maps regions to transgorms and evaluates the transforms with the corresponding inputs.
examples:
-
- Create a regions_selector schema for 2 regions, labeled "1" and "2".
- |
!transform/regions_selector-1.0.0
inputs: [x, y]
label_mapper: !transform/label_mapper-1.0.0
mapper: !core/ndarray-1.0.0
datatype: int8
data:
[[0, 1, 1, 0, 2, 0],
[0, 1, 1, 0, 2, 0],
[0, 1, 1, 0, 2, 0],
[0, 1, 1, 0, 2, 0],
[0, 1, 1, 0, 2, 0]]
outputs: [ra, dec, lam]
selector:
1: !transform/compose-1.0.0
forward:
- !transform/remap_axes-1.0.0
mapping: [0, 1, 1]
- !transform/concatenate-1.0.0
forward:
- !transform/concatenate-1.0.0
forward:
- !transform/shift-1.0.0 {offset: 1.0}
- !transform/shift-1.0.0 {offset: 2.0}
- !transform/shift-1.0.0 {offset: 3.0}
2: !transform/compose-1.0.0
forward:
- !transform/remap_axes-1.0.0
mapping: [0, 1, 1]
- !transform/concatenate-1.0.0
forward:
- !transform/concatenate-1.0.0
forward:
- !transform/scale-1.0.0 {factor: 2.0}
- !transform/scale-1.0.0 {factor: 3.0}
- !transform/scale-1.0.0 {factor: 3.0}
undefined_transform_value: .nan
allOf:
- $ref: "transform-1.0.0"
- type: object
properties:
label_mapper:
description: |
An instance of
[label_mapper-1.0.0](ref:schemas/label_mapper-1.0.0)
$ref: "./label_mapper-1.0.0"
inputs:
description: |
Names of inputs.
type: array
items:
type: string
outputs:
description: |
Names of outputs.
type: array
items:
type: string
selector:
description: |
A mapping of regions to trransforms.
type: object
properties:
labels:
description: |
An array of unique region labels.
type: array
items:
type:
- integer
- string
transforms:
description: |
A transform for each region. The order should match the order of labels.
type: array
items:
$ref: "transform-1.0.0"
undefined_transform_value:
description: |
Value to be returned if there's no transform defined for the inputs.
type: number
required: [label_mapper, inputs, outputs, selector]
...