-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update schemas to support upcoming asdf standard 1.6.0
- Loading branch information
Showing
7 changed files
with
211 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
%YAML 1.1 | ||
--- | ||
id: asdf://dkist.nso.edu/manifests/dkist-wcs-1.3.0 | ||
extension_uri: asdf://dkist.nso.edu/dkist/extensions/dkist-wcs-1.3.0 | ||
asdf_standard_requirement: | ||
gte: 1.6.0 | ||
|
||
title: DKIST WCS extension | ||
description: ASDF schemas and tags for models and WCS related classes. | ||
|
||
tags: | ||
# the tag version does not match the schema version | ||
- schema_uri: "asdf://dkist.nso.edu/schemas/varying_celestial_transform-1.1.0" | ||
tag_uri: "asdf://dkist.nso.edu/tags/varying_celestial_transform-1.2.0" | ||
|
||
# the varying_celestial_transform schema is reused here | ||
- schema_uri: "asdf://dkist.nso.edu/schemas/varying_celestial_transform-1.1.0" | ||
tag_uri: "asdf://dkist.nso.edu/tags/inverse_varying_celestial_transform-1.2.0" | ||
|
||
- schema_uri: "asdf://dkist.nso.edu/schemas/coupled_compound_model-1.1.0" | ||
tag_uri: "asdf://dkist.nso.edu/tags/coupled_compound_model-1.1.0" | ||
|
||
- schema_uri: "asdf://dkist.nso.edu/schemas/ravel_model-1.1.0" | ||
tag_uri: "asdf://dkist.nso.edu/tags/ravel_model-1.1.0" | ||
|
||
- schema_uri: "asdf://dkist.nso.edu/schemas/asymmetric_mapping_model-1.1.0" | ||
tag_uri: "asdf://dkist.nso.edu/tags/asymmetric_mapping_model-1.1.0" |
30 changes: 30 additions & 0 deletions
30
dkist/io/asdf/resources/schemas/asymmetric_mapping_model-1.1.0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
%YAML 1.1 | ||
--- | ||
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" | ||
id: "asdf://dkist.nso.edu/schemas/asymmetric_mapping_model-1.1.0" | ||
title: > | ||
Reorder, add and drop axes with different mappings in forward and reverse transforms. | ||
definitions: | ||
mapping: | ||
type: array | ||
items: | ||
type: integer | ||
|
||
allOf: | ||
- $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.3.0" | ||
- properties: | ||
forward_n_inputs: | ||
description: | | ||
Explicitly set the number of input axes in the forward direction. | ||
type: integer | ||
backward_n_inputs: | ||
description: | | ||
Explicitly set the number of input axes in the backward direction. | ||
type: integer | ||
forward_mapping: | ||
$ref: "#/definitions/mapping" | ||
backward_mapping: | ||
$ref: "#/definitions/mapping" | ||
required: [forward_mapping, backward_mapping] | ||
... |
85 changes: 85 additions & 0 deletions
85
dkist/io/asdf/resources/schemas/coupled_compound_model-1.1.0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
%YAML 1.1 | ||
--- | ||
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" | ||
id: "asdf://dkist.nso.edu/schemas/coupled_compound_model-1.1.0" | ||
title: > | ||
Send axes to different subtransforms. | ||
description: | | ||
This transform takes two models which share one or more inputs on the forward | ||
transform, and where the left hand model's inverse is dependent on the | ||
output of the right hand model's inverse output. | ||
Take the following example with a time dependent celestial transform | ||
(modelled as dependent upon the pixel coordinate for time rather than the | ||
world coordinate). | ||
The forward transform uses the "z" pixel dimension as input to both the | ||
Celestial and Temporal models, this leads to the following transform in the | ||
forward direction: | ||
``` | ||
: x y z | ||
: │ │ │ | ||
: │ │ ┌────────┤ | ||
: │ │ │ │ | ||
: ▼ ▼ ▼ ▼ | ||
: ┌─────────┐ ┌────────┐ | ||
: │Celestial│ │Temporal│ | ||
: └─┬───┬───┘ └───┬────┘ | ||
: │ │ │ | ||
: │ │ │ | ||
: │ │ │ | ||
: ▼ ▼ ▼ | ||
: lon lat time | ||
``` | ||
The complexity is in the reverse transform, where the inverse Celestial | ||
transform is also dependent upon the pixel coordinate z. | ||
This means that the output of the inverse Temporal transform has to be | ||
duplicated as an input to the Celestial transform's inverse. | ||
This is achieved by the use of the ``Mapping`` models in | ||
``CoupledCompoundModel.inverse`` to create a multi-stage compound model | ||
which duplicates the output of the right hand side model:: | ||
``` | ||
: lon lat time | ||
: │ │ │ | ||
: │ │ ▼ | ||
: │ │ ┌─────────┐ | ||
: │ │ │Temporal'│ | ||
: │ │ └──┬──┬───┘ | ||
: │ │ z │ │ | ||
: │ │ ┌─────┘ │ | ||
: │ │ │ │ | ||
: ▼ ▼ ▼ │ | ||
: ┌──────────┐ │ | ||
: │Celestial'│ │ | ||
: └─┬───┬────┘ │ | ||
: │ │ │ | ||
: ▼ ▼ ▼ | ||
: x y z | ||
``` | ||
examples: | ||
- | ||
- A set of transforms | ||
- asdf-standard-1.6.0 | ||
- | | ||
!<asdf://dkist.nso.edu/tags/coupled_compound_model-1.1.0> | ||
shared_inputs: 1 | ||
forward: | ||
- !transform/shift-1.3.0 | ||
offset: 2.0 | ||
- !transform/shift-1.3.0 | ||
offset: 3.0 | ||
allOf: | ||
- $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.3.0" | ||
- properties: | ||
forward: | ||
type: array | ||
items: | ||
$ref: "http://stsci.edu/schemas/asdf/transform/transform-1.3.0" | ||
shared_inputs: | ||
type: number | ||
required: [forward, shared_inputs] | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
%YAML 1.1 | ||
--- | ||
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" | ||
id: "asdf://dkist.nso.edu/schemas/ravel_model-1.1.0" | ||
|
||
title: A model to flatten 2D indices into 1D | ||
description: | ||
A model which takes a pair of indices and flattens them into the corresponding index for a 1D array. This can be used as a compound with Tabular1D to enable it to be indexed as if it were Tabular2D. | ||
|
||
allOf: | ||
- $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.3.0" | ||
- properties: | ||
array_shape: | ||
type: array | ||
order: | ||
type: string | ||
required: [array_shape, order] |
38 changes: 38 additions & 0 deletions
38
dkist/io/asdf/resources/schemas/varying_celestial_transform-1.1.0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
%YAML 1.1 | ||
--- | ||
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" | ||
id: "asdf://dkist.nso.edu/schemas/varying_celestial_transform-1.1.0" | ||
|
||
title: A varying FITS-like celestial transform. | ||
description: | ||
A model which represents a FITS-like celestial WCS transform which varies over a third pixel input. | ||
|
||
allOf: | ||
- $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.3.0" | ||
- properties: | ||
crpix: | ||
anyOf: | ||
- tag: "tag:stsci.edu:asdf/core/ndarray-1.*" | ||
- tag: "tag:stsci.edu:asdf/unit/quantity-1.*" | ||
cdelt: | ||
anyOf: | ||
- tag: "tag:stsci.edu:asdf/core/ndarray-1.*" | ||
- tag: "tag:stsci.edu:asdf/unit/quantity-1.*" | ||
lon_pole: | ||
anyOf: | ||
- type: number | ||
- tag: "tag:stsci.edu:asdf/unit/quantity-1.*" | ||
crval_table: | ||
anyOf: | ||
- tag: "tag:stsci.edu:asdf/core/ndarray-1.*" | ||
- tag: "tag:stsci.edu:asdf/unit/quantity-1.*" | ||
pc_table: | ||
anyOf: | ||
- tag: "tag:stsci.edu:asdf/core/ndarray-1.*" | ||
- tag: "tag:stsci.edu:asdf/unit/quantity-1.*" | ||
projection: | ||
$ref: "http://stsci.edu/schemas/asdf/transform/transform-1.3.0" | ||
|
||
required: [crpix, cdelt, lon_pole, crval_table, pc_table, projection] | ||
additionalProperties: true | ||
... |