Skip to content

Commit

Permalink
Merge pull request #7432 from braingram/schema_cleanup
Browse files Browse the repository at this point in the history
Update schemas for upcoming ASDF standard 1.6.0
  • Loading branch information
nabobalis committed Mar 26, 2024
2 parents 59a3e1a + feff2fa commit 7422da6
Show file tree
Hide file tree
Showing 33 changed files with 590 additions and 25 deletions.
1 change: 1 addition & 0 deletions changelog/7432.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update ASDF schemas for upcoming ASDF standard 1.6.0.
18 changes: 11 additions & 7 deletions sunpy/io/special/asdf/entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,22 @@ def get_extensions():
from sunpy.io.special.asdf.converters.generic_map import GenericMapConverter

sunpy_converters = [GenericMapConverter()] + SUNPY_FRAME_CONVERTERS
# order here is important as asdf will pick the first matching
# extension, start with the newest
_manifest_uris = [
"asdf://sunpy.org/sunpy/manifests/sunpy-1.2.0",
"asdf://sunpy.org/sunpy/manifests/sunpy-1.1.0",
"asdf://sunpy.org/sunpy/manifests/sunpy-1.0.0",
]


return [
ManifestExtension.from_uri("asdf://sunpy.org/sunpy/manifests/sunpy-1.1.0",
converters=sunpy_converters,
# Register that this is a replacement for
# the old extension so old files still work.
# without throwing a warning.
legacy_class_names=["sunpy.io.special.asdf.extension.SunpyExtension"]),
ManifestExtension.from_uri("asdf://sunpy.org/sunpy/manifests/sunpy-1.0.0",
ManifestExtension.from_uri(uri,
converters=sunpy_converters,
# Register that this is a replacement for
# the old extension so old files still work.
# without throwing a warning.
legacy_class_names=["sunpy.io.special.asdf.extension.SunpyExtension"])
for uri
in _manifest_uris
]
2 changes: 1 addition & 1 deletion sunpy/io/special/asdf/resources/manifests/sunpy-1.0.0.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%YAML 1.1
---
id: asdf://sunpy.org/manifests/sunpy-1.0.0
id: asdf://sunpy.org/sunpy/manifests/sunpy-1.0.0
extension_uri: asdf://sunpy.org/extensions/sunpy-1.0.0
title: SunPy ASDF Manifest
description: ASDF schemas and tags for SunPy classes.
Expand Down
2 changes: 1 addition & 1 deletion sunpy/io/special/asdf/resources/manifests/sunpy-1.1.0.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%YAML 1.1
---
id: asdf://sunpy.org/manifests/sunpy-1.1.0
id: asdf://sunpy.org/sunpy/manifests/sunpy-1.1.0
extension_uri: asdf://sunpy.org/extensions/sunpy-1.1.0
title: SunPy ASDF Manifest
description: ASDF schemas and tags for SunPy classes.
Expand Down
45 changes: 45 additions & 0 deletions sunpy/io/special/asdf/resources/manifests/sunpy-1.2.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
%YAML 1.1
---
id: asdf://sunpy.org/sunpy/manifests/sunpy-1.2.0
extension_uri: asdf://sunpy.org/extensions/sunpy-1.2.0
title: SunPy ASDF Manifest
description: ASDF schemas and tags for SunPy classes.
asdf_standard_requirement:
gte: 1.6.0

tags:
- tag_uri: "tag:sunpy.org:sunpy/map/generic_map-1.2.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/generic_map-1.2.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/geocentricearthequatorial-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/geocentricearthequatorial-1.1.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarecliptic-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/geocentricsolarecliptic-1.1.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarmagnetospheric-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/geocentricsolarmagnetospheric-1.1.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/geomagnetic-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/geomagnetic-1.1.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/heliocentric-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/heliocentric-1.1.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/heliocentricearthecliptic-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/heliocentricearthecliptic-1.1.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/heliocentricinertial-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/heliocentricinertial-1.1.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/heliographic_carrington-1.3.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/heliographic_carrington-1.3.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/heliographic_stonyhurst-1.2.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/heliographic_stonyhurst-1.2.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/helioprojective-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/helioprojective-1.1.0"

- tag_uri: "tag:sunpy.org:sunpy/coordinates/frames/solarmagnetic-1.1.0"
schema_uri: "asdf://sunpy.org/sunpy/schemas/solarmagnetic-1.1.0"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://sunpy.org/schemas/generic_map-1.0.0"
id: "asdf://sunpy.org/sunpy/schemas/generic_map-1.0.0"

title: |
Represents the SunPy GenericMap object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://sunpy.org/schemas/generic_map-1.1.0"
id: "asdf://sunpy.org/sunpy/schemas/generic_map-1.1.0"

title: |
Represents the SunPy GenericMap object
Expand Down
30 changes: 30 additions & 0 deletions sunpy/io/special/asdf/resources/schemas/generic_map-1.2.0.yaml
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://sunpy.org/sunpy/schemas/generic_map-1.2.0"

title: |
Represents the SunPy GenericMap object
description:
This object represents the base of the SunPy map tree by serialising the GenericMap class.

type: object
properties:
meta:
type: object
data:
tag: "tag:stsci.edu:asdf/core/ndarray-1.*"
plot_settings:
type: object
mask:
tag: "tag:stsci.edu:asdf/core/ndarray-1.*"
unit:
tag: "tag:stsci.edu:asdf/unit/unit-1.*"
uncertainty:
type: object


required: [meta, data]
allowAdditionalProperties: False
...
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://sunpy.org/schemas/geocentricearthequatorial-1.0.0"
id: "asdf://sunpy.org/sunpy/schemas/geocentricearthequatorial-1.0.0"

title: |
Represents a Geocentric Earth Equatorial (GEI) coordinate object from SunPy
examples:
-
- A GeocentricEarthEquatorial frame without data
- asdf-standard-1.5.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricearthequatorial-1.0.0>
frame_attributes:
Expand All @@ -17,6 +18,7 @@ examples:
value: J2000.000
-
- A GeocentricEarthEquatorial frame with an obstime
- asdf-standard-1.5.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricearthequatorial-1.0.0>
frame_attributes:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://sunpy.org/sunpy/schemas/geocentricearthequatorial-1.1.0"

title: |
Represents a Geocentric Earth Equatorial (GEI) coordinate object from SunPy
examples:
-
- A GeocentricEarthEquatorial frame without data
- asdf-standard-1.6.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricearthequatorial-1.1.0>
frame_attributes:
equinox: !time/time-1.2.0
scale: tt
value: J2000.000
-
- A GeocentricEarthEquatorial frame with an obstime
- asdf-standard-1.6.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricearthequatorial-1.1.0>
frame_attributes:
equinox: !time/time-1.2.0
scale: tt
value: J2000.000
obstime: !time/time-1.2.0 '2011-01-01T01:01:01.000'
allOf:
- $ref: "http://astropy.org/schemas/astropy/coordinates/frames/baseframe-1.1.0"
- properties:
frame_attributes:
type: object
properties:
equinox:
tag: "tag:stsci.edu:asdf/time/time-1.*"
obstime:
tag: "tag:stsci.edu:asdf/time/time-1.*"
required: [equinox]
additionalProperties: False
...
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://sunpy.org/schemas/geocentricsolarecliptic-1.0.0"
id: "asdf://sunpy.org/sunpy/schemas/geocentricsolarecliptic-1.0.0"

title: |
Represents a Geocentric Solar Ecliptic (GSE) coordinate object from SunPy
examples:
-
- A GeocentricSolarEcliptic frame without data
- asdf-standard-1.5.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarecliptic-1.0.0>
frame_attributes: {}
-
- A GeocentricSolarEcliptic frame with an obstime
- asdf-standard-1.5.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarecliptic-1.0.0>
frame_attributes: {obstime: !time/time-1.1.0 '2011-01-01T01:01:01.000'}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://sunpy.org/sunpy/schemas/geocentricsolarecliptic-1.1.0"

title: |
Represents a Geocentric Solar Ecliptic (GSE) coordinate object from SunPy
examples:
-
- A GeocentricSolarEcliptic frame without data
- asdf-standard-1.6.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarecliptic-1.1.0>
frame_attributes: {}
-
- A GeocentricSolarEcliptic frame with an obstime
- asdf-standard-1.6.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarecliptic-1.1.0>
frame_attributes: {obstime: !time/time-1.2.0 '2011-01-01T01:01:01.000'}
allOf:
- $ref: "http://astropy.org/schemas/astropy/coordinates/frames/baseframe-1.1.0"
- properties:
frame_attributes:
type: object
properties:
obstime:
tag: "tag:stsci.edu:asdf/time/time-1.*"
additionalProperties: False
...
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://sunpy.org/schemas/geocentricsolarmagnetospheric-1.0.0"
id: "asdf://sunpy.org/sunpy/schemas/geocentricsolarmagnetospheric-1.0.0"

title: |
Represents a Geocentric Solar Magnetospheric (GSM) coordinate object from SunPy
examples:
-
- A Geocentric Solar Magnetospheric frame without data
- asdf-standard-1.5.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarmagnetospheric-1.0.0>
frame_attributes:
magnetic_model: igrf13
-
- A Geocentric Solar Magnetospheric frame with an obstime
- asdf-standard-1.5.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarmagnetospheric-1.0.0>
frame_attributes:
Expand Down
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://sunpy.org/sunpy/schemas/geocentricsolarmagnetospheric-1.1.0"

title: |
Represents a Geocentric Solar Magnetospheric (GSM) coordinate object from SunPy
examples:
-
- A Geocentric Solar Magnetospheric frame without data
- asdf-standard-1.6.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarmagnetospheric-1.1.0>
frame_attributes:
magnetic_model: igrf13
-
- A Geocentric Solar Magnetospheric frame with an obstime
- asdf-standard-1.6.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geocentricsolarmagnetospheric-1.1.0>
frame_attributes:
magnetic_model: igrf13
obstime: !time/time-1.2.0 '2011-01-01T01:01:01.000'
allOf:
- $ref: "http://astropy.org/schemas/astropy/coordinates/frames/baseframe-1.1.0"
- properties:
frame_attributes:
type: object
properties:
magnetic_model:
type: string
obstime:
tag: "tag:stsci.edu:asdf/time/time-1.*"
required: [magnetic_model]
additionalProperties: False
...
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://sunpy.org/schemas/geomagnetic-1.0.0"
id: "asdf://sunpy.org/sunpy/schemas/geomagnetic-1.0.0"

title: |
Represents a Geomagnetic (MAG) coordinate object from SunPy
examples:
-
- A Geomagnetic frame without data
- asdf-standard-1.5.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geomagnetic-1.0.0>
frame_attributes:
magnetic_model: igrf13
-
- A Geomagnetic frame with an obstime
- asdf-standard-1.5.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geomagnetic-1.0.0>
frame_attributes:
Expand Down
38 changes: 38 additions & 0 deletions sunpy/io/special/asdf/resources/schemas/geomagnetic-1.1.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: "asdf://sunpy.org/sunpy/schemas/geomagnetic-1.1.0"

title: |
Represents a Geomagnetic (MAG) coordinate object from SunPy
examples:
-
- A Geomagnetic frame without data
- asdf-standard-1.6.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geomagnetic-1.1.0>
frame_attributes:
magnetic_model: igrf13
-
- A Geomagnetic frame with an obstime
- asdf-standard-1.6.0
- |
!<tag:sunpy.org:sunpy/coordinates/frames/geomagnetic-1.1.0>
frame_attributes:
magnetic_model: igrf13
obstime: !time/time-1.2.0 '2011-01-01T01:01:01.000'
allOf:
- $ref: "http://astropy.org/schemas/astropy/coordinates/frames/baseframe-1.1.0"
- properties:
frame_attributes:
type: object
properties:
magnetic_model:
type: string
obstime:
tag: "tag:stsci.edu:asdf/time/time-1.*"
required: [magnetic_model]
additionalProperties: False
...

0 comments on commit 7422da6

Please sign in to comment.