Skip to content
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

Update schemas for ASDF standard 1.6.0 #59

Merged
merged 10 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ jobs:
strategy:
matrix:
include:
- name: Python 3.12 Schema validation tests
python-version: '3.12'
os: ubuntu-latest
toxenv: py312

- name: Python 3.11 Schema validation tests
python-version: '3.11'
os: ubuntu-latest
toxenv: py311

- name: Python 3.10 Schema validation tests
python-version: '3.10'
os: ubuntu-latest
Expand All @@ -28,11 +38,6 @@ jobs:
os: ubuntu-latest
toxenv: py39

- name: Python 3.8 Schema validation tests
python-version: 3.8
os: ubuntu-latest
toxenv: py38

- name: Twine check
python-version: 3.9
os: ubuntu-latest
Expand Down Expand Up @@ -91,6 +96,8 @@ jobs:
python-version: 3.9
- name: Install asdf-wcs-schemas
run: cd asdf-wcs-schemas && pip install .
- name: Install older pytest
run: pip install "pytest<8.1"
- name: Install gwcs
run: cd gwcs && pip install -e .[test]
- name: Pip Freeze
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.3.1 (unreleased)
------------------

- Update schemas for ASDF standard 1.6.0. [#59]

0.3.0 (2023-11-28)
------------------

Expand Down
13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
name = 'asdf_wcs_schemas'
description = 'ASDF WCS schemas'
readme = 'README.md'
requires-python = '>=3.8'
requires-python = '>=3.9'
license = { file = 'LICENSE' }
authors = [{ name = 'The ASDF Developers', email = '[email protected]' }]
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Development Status :: 5 - Production/Stable',
]
dependencies = [
'asdf-standard >= 1.0.1',
'asdf-transform-schemas >= 0.3.0',
'asdf-unit-schemas >= 0.1.0',
'importlib_resources >= 3; python_version<"3.9"',
'asdf-standard >= 1.1.0',
'asdf-transform-schemas >= 0.5.0',
'asdf-coordinates-schemas >= 0.3.0',
]
dynamic = ['version']

Expand All @@ -43,7 +43,6 @@ docs = [
]
test = [
'pytest >= 4.6.0',
'pytest-openfiles >= 0.5.0',
'asdf >= 2.8.0',
'asdf-astropy',
]
Expand Down
124 changes: 124 additions & 0 deletions resources/manifests/gwcs-1.3.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
%YAML 1.1
---
id: asdf://asdf-format.org/astronomy/gwcs/manifests/gwcs-1.3.0
extension_uri: asdf://asdf-format.org/astronomy/gwcs/extensions/gwcs-1.3.0
title: gwcs extension 1.3.0
description: |-
A set of tags for serializing STScI gwcs models.
asdf_standard_requirement:
gte: 1.6.0
tags:
- tag_uri: tag:stsci.edu:gwcs/celestial_frame-1.1.0
schema_uri: http://stsci.edu/schemas/gwcs/celestial_frame-1.1.0
title: A celestial frame
description: |-
Represents a celestial frame
- tag_uri: tag:stsci.edu:gwcs/composite_frame-1.0.0
schema_uri: http://stsci.edu/schemas/gwcs/composite_frame-1.0.0
title: A set of frames
description: |-
Represents a set of frames
- tag_uri: "tag:stsci.edu:gwcs/direction_cosines-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/direction_cosines-1.2.0"
title: >
Convert coordinates between vector and direction cosine form.
description: |
This schema is for transforms which convert to and from direction cosines.
- tag_uri: "tag:stsci.edu:gwcs/frame2d-1.1.0"
schema_uri: "http://stsci.edu/schemas/gwcs/frame2d-1.1.0"
title: >
Represents a 2D frame.
description: |
Represents a 2D frame.
- tag_uri: "tag:stsci.edu:gwcs/frame-1.1.0"
schema_uri: "http://stsci.edu/schemas/gwcs/frame-1.1.0"
title: |
The base class of all coordinate frames.
description: |
These objects are designed to be nested in arbitrary ways to build up
transformation pipelines out of a number of low-level pieces.
- tag_uri: "tag:stsci.edu:gwcs/grating_equation-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/grating_equation-1.2.0"
title: >
A grating equation model.
description: |
Supports two models:
- Given incident angle and wavelength compute the refraction/difraction angle.
- Given an incident angle and a refraction angle compute the wavelength.
- tag_uri: "tag:stsci.edu:gwcs/label_mapper-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/label_mapper-1.2.0"
title: >
Represents a mapping from a coordinate value to a label.
description: |
A label mapper instance maps inputs to a label. It is used together
with
[regions_selector](ref:regions_selector-1.2.0). The
[label_mapper](ref:label_mapper-1.2.0)
returns the label corresponding to given inputs. The
[regions_selector](ref:regions_selector-1.2.0)
returns the transform corresponding to this label. This maps inputs
(e.g. pixels on a detector) to transforms uniquely.
- tag_uri: "tag:stsci.edu:gwcs/regions_selector-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/regions_selector-1.2.0"
title: >
Represents a discontinuous transform.
description: |
Maps regions to transgorms and evaluates the transforms with the corresponding inputs.
- tag_uri: "tag:stsci.edu:gwcs/sellmeier_glass-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/sellmeier_glass-1.2.0"
title: >
Sellmeier equation for glass
description: |
Sellmeier equation for glass.

$$ n(\\lambda)^2 = 1 + \\frac{(B1 * \\lambda^2 )}{(\\lambda^2 - C1)} +
\\frac{(B2 * \\lambda^2 )}{(\\lambda^2 - C2)} +
\\frac{(B3 * \\lambda^2 )}{(\\lambda^2 - C3)} $$
- tag_uri: "tag:stsci.edu:gwcs/sellmeier_zemax-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/sellmeier_zemax-1.2.0"
title: Sellmeier equation for glass used by Zemax
description: |
Sellmeier equation for glass used by Zemax
- tag_uri: "tag:stsci.edu:gwcs/snell3d-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/snell3d-1.2.0"
title: Snell Law in 3D space
description: |
Snell Law in 3D.
Inputs are index of refraction and direction cosines.
Outputs are direction cosines.
- tag_uri: "tag:stsci.edu:gwcs/spectral_frame-1.1.0"
schema_uri: "http://stsci.edu/schemas/gwcs/spectral_frame-1.1.0"
title: >
Represents a spectral frame.
description: >
- tag_uri: "tag:stsci.edu:gwcs/spherical_cartesian-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/spherical_cartesian-1.2.0"
title: >
Convert coordinates between spherical and Cartesian coordinates.
description: |
This schema is for transforms which convert between spherical coordinates
(on the unit sphere) and Cartesian coordinates.
- tag_uri: "tag:stsci.edu:gwcs/step-1.2.0"
schema_uri: "http://stsci.edu/schemas/gwcs/step-1.2.0"
title: >
Describes a single step of a WCS transform pipeline.
description: >
- tag_uri: "tag:stsci.edu:gwcs/stokes_frame-1.0.0"
schema_uri: "http://stsci.edu/schemas/gwcs/stokes_frame-1.0.0"
title: >
Represents a stokes frame
description: >
- tag_uri: "tag:stsci.edu:gwcs/temporal_frame-1.1.0"
schema_uri: "http://stsci.edu/schemas/gwcs/temporal_frame-1.1.0"
title: >
Represents a temporal frame.
description: >
- tag_uri: "tag:stsci.edu:gwcs/wcs-1.3.0"
schema_uri: "http://stsci.edu/schemas/gwcs/wcs-1.3.0"
title: >
A system for describing generalized world coordinate transformations.
description: >
ASDF WCS is a way of specifying transformations (usually from
detector space to world coordinate space and back) by using the
transformations in the `transform-schema` module.
...
25 changes: 25 additions & 0 deletions resources/schemas/stsci.edu/gwcs/celestial_frame-1.1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/gwcs/celestial_frame-1.1.0"

title: >
Represents a celestial frame.

allOf:
- type: object
properties:
axes_names:
minItems: 2
maxItems: 3

axes_order:
minItems: 2
maxItems: 3

unit:
minItems: 2
maxItems: 3

- $ref: frame-1.1.0
...
38 changes: 38 additions & 0 deletions resources/schemas/stsci.edu/gwcs/direction_cosines-1.2.0.yaml
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: "http://stsci.edu/schemas/gwcs/direction_cosines-1.2.0"

title: >
Convert coordinates between vector and direction cosine form.

description: |
This schema is for transforms which convert to and from direction cosines.

examples:
-
- Convert direction cosines to vectors.
- asdf-standard-1.6.0
- |

!<tag:stsci.edu:gwcs/direction_cosines-1.2.0>
transform_type: from_direction_cosines

-
- Convert vectors to directional cosines.
- asdf-standard-1.6.0
- |
!<tag:stsci.edu:gwcs/direction_cosines-1.2.0>
transform_type: to_direction_cosines

allOf:
- $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.3.0"
- object:
properties:
transform_type:
description: |
The type of transform/class to initialize.
type: string
enum: [to_direction_cosines, from_direction_cosines]
required: [transform_type]
...
85 changes: 85 additions & 0 deletions resources/schemas/stsci.edu/gwcs/frame-1.1.0.yaml
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: "http://stsci.edu/schemas/gwcs/frame-1.1.0"
title: |
The base class of all coordinate frames.

description: |
These objects are designed to be nested in arbitrary ways to build up
transformation pipelines out of a number of low-level pieces.

examples:
-
- |
A celestial frame in the ICRS reference frame.
- asdf-standard-1.6.0
- |
!<tag:stsci.edu:gwcs/celestial_frame-1.1.0>
axes_names: [lon, lat]
name: CelestialFrame
reference_frame: !<tag:astropy.org:astropy/coordinates/frames/icrs-1.1.0>
frame_attributes: {}
unit: [!unit/unit-1.0.0 deg, !unit/unit-1.0.0 deg]

-
- |
A pixel frame in three dimensions
- asdf-standard-1.6.0
- |
!<tag:stsci.edu:gwcs/frame-1.1.0>
axes_names: [raster position, slit position, wavelength]
axes_order: [0, 1, 2]
axes_type: [SPATIAL, SPATIAL, SPECTRAL]
name: pixel
naxes: 3
unit: [!unit/unit-1.0.0 pixel, !unit/unit-1.0.0 pixel, !unit/unit-1.0.0 pixel]

type: object
properties:
name:
description: |
A user-friendly name for the frame.
type: string

axes_order:
description: |
The order of the axes.
type: array
items:
type: integer

axes_names:
description: |
The name of each axis in this frame.
type: array
items:
anyOf:
- type: string
- type: 'null'

reference_frame:
description: |
The reference frame.
$ref: "http://astropy.org/schemas/astropy/coordinates/frames/baseframe-1.1.0"

unit:
description: |
Units for each axis.
type: array
items:
$ref: "http://stsci.edu/schemas/asdf/unit/unit-1.0.0"

axis_physical_types:
description: |
An iterable of strings describing the physical type for each world axis.
These should be names from the VO UCD1+ controlled Vocabulary
(http://www.ivoa.net/documents/latest/UCDlist.html).
type: array
items:
type:
string

required: [name]
additionalProperties: true
...
36 changes: 36 additions & 0 deletions resources/schemas/stsci.edu/gwcs/frame2d-1.1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/gwcs/frame2d-1.1.0"

title: >
Represents a 2D frame.

examples:
-
- |
A two dimensional spatial frame
- |
!<tag:stsci.edu:gwcs/frame2d-1.1.0>
axes_names: [lon, lat]
name: Frame2D
unit: [!unit/unit-1.0.0 pixel, !unit/unit-1.0.0 pixel]


allOf:
- type: object
properties:
axes_names:
minItems: 2
maxItems: 2

axes_order:
minItems: 2
maxItems: 2

unit:
minItems: 2
maxItems: 2

- $ref: frame-1.1.0
...
Loading
Loading