-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updates for upcoming ASDF standard 1.6.0 #324
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
95fea24
fix manifest ids and extension_uri
braingram b06add1
fixes tag directives in varying_celestial_transform
braingram c73b39b
add dkist-wcs-1.3.0 asdf extension
braingram 4f44393
remove unused asdf-unit-schemas dependency
braingram f6f5d61
add changelog
braingram 14a41b2
fix pyproject.toml dep formatting
braingram 4e5a89c
Merge remote-tracking branch 'upstream/main' into schema_cleanup
Cadair 6d9f1df
restore minimum dep pins, disable schema tests in oldestdeps
braingram fac6552
Merge branch 'main' into schema_cleanup
Cadair 850c080
Merge branch 'main' into schema_cleanup
Cadair File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Update ASDF schemas for upcoming ASDF standard 1.6.0. |
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
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
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
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] |
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
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 | ||
... |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh hey, I didn't know you could do that 🤔