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

Add Geodetic Representations #40

Closed
Closed
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
------------------

- Add ``asdf-astropy`` as a test dependency. [#34]
- Add ``Geodetic`` coordinate representation support. [#40]

0.2.0 (2023-03-21)
------------------
Expand Down
80 changes: 80 additions & 0 deletions resources/manifests/coordinates-1.1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
id: asdf://asdf-format.org/astronomy/coordinates/manifests/coordinates-1.0.0
extension_uri: asdf://asdf-format.org/astronomy/coordinates/extensions/coordinates-1.0.0
title: Coordinates extension 1.0.0
description: |-
A set of tags for serializing coordinates.
tags:
- tag_uri: tag:astropy.org:astropy/coordinates/angle-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/angle-1.0.0
title: Represents an Angle.
description: |-
This object represents a subtype of Quantity which has units equivalent to radians or degrees.
- tag_uri: tag:astropy.org:astropy/coordinates/earthlocation-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/earthlocation-1.0.0
title: Represents EarthLocation objects from astropy.
description: |-
Location on the Earth.
- tag_uri: tag:astropy.org:astropy/coordinates/frames/baseframe-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/baseframe-1.0.0
title: Represents a coordinate frame object from astropy
description: |-
This schema is designed to be extended by other schemas to restrict the
allowable frame_attributes.
- tag_uri: tag:astropy.org:astropy/coordinates/frames/cirs-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/cirs-1.0.0
title: Represents a CIRS coordinate object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/frames/fk4-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/fk4-1.0.0
title: Represents a FK4 coordinate object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/frames/fk4noeterms-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/fk4noeterms-1.0.0
title: Represents a FK4NoETerms coordinate object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/frames/fk5-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/fk5-1.0.0
title: Represents a FK5 coordinate object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/frames/galactic-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/galactic-1.0.0
title: Represents an Galactic coordinate object from astropy.
- tag_uri: tag:astropy.org:astropy/coordinates/frames/galactocentric-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/galactocentric-1.0.0
title: Represents an galactocentric coordinate object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/frames/gcrs-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/gcrs-1.0.0
title: Represents a GCRS coordinate object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/frames/icrs-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/icrs-1.0.0
title: Represents an ICRS coordinate object from astropy
description: |-
This object represents the right ascension (RA) and declination of an ICRS
coordinate or frame. The ICRS class contains additional fields that may be
useful to add here in the future.
- tag_uri: tag:astropy.org:astropy/coordinates/frames/icrs-1.1.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/icrs-1.1.0
title: Represents an ICRS coordinate object from astropy.
- tag_uri: tag:astropy.org:astropy/coordinates/frames/itrs-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/itrs-1.0.0
title: Represents a ITRS coordinate object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/frames/precessedgeocentric-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/frames/precessedgeocentric-1.0.0
title: Represents a PrecessedGeocentric coordinate object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/latitude-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/latitude-1.0.0
title: Represents latitude-like angles.
description: |-
Represents latitude-like angle(s) which must be in the range -90 to +90 deg.
- tag_uri: tag:astropy.org:astropy/coordinates/longitude-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/longitude-1.0.0
title: Represents longitude-like angles.
description: |-
Longitude-like angle(s) which are wrapped within a contiguous 360 degree range.
- tag_uri: tag:astropy.org:astropy/coordinates/representation-1.1.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/representation-1.1.0
title: Representation of points or differentials in two or three dimensional space.
description: |-
Representation of points or differentials in two or three dimensional space.
- tag_uri: tag:astropy.org:astropy/coordinates/skycoord-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/skycoord-1.0.0
title: Represents a SkyCoord object from astropy
- tag_uri: tag:astropy.org:astropy/coordinates/spectralcoord-1.0.0
schema_uri: http://astropy.org/schemas/astropy/coordinates/spectralcoord-1.0.0
title: Represents a SpectralCoord object from astropy
209 changes: 209 additions & 0 deletions resources/schemas/representation-1.1.0 .yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://astropy.org/schemas/astropy/coordinates/representation-1.0.0"

title: |
Representation of points or differentials in two or three dimensional space.

description: |
Representation of points or differentials in two or three dimensional space.

examples:
-
- A SphericalRepresentation
- |
!<tag:astropy.org:astropy/coordinates/representation-1.0.0>
components:
distance: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 AU, value: 1.0}
lat: !<tag:astropy.org:astropy/coordinates/latitude-1.0.0> {unit: !unit/unit-1.0.0 deg,
value: 10.0}
lon: !<tag:astropy.org:astropy/coordinates/longitude-1.0.0>
unit: !unit/unit-1.0.0 deg
value: 10.0
wrap_angle: !<tag:astropy.org:astropy/coordinates/angle-1.0.0> {unit: !unit/unit-1.0.0 deg,
value: 360.0}
type: SphericalRepresentation
-
- A CartesianDifferential
- |
!<tag:astropy.org:astropy/coordinates/representation-1.0.0>
components:
d_x: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 km s-1, value: 100.0}
d_y: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 km s-1, value: 200.0}
d_z: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 km s-1, value: 3141.0}
type: CartesianDifferential

type: object
properties:
type:
type: string
enum:
- CartesianRepresentation
- SphericalRepresentation
- UnitSphericalRepresentation
- RadialRepresentation
- PhysicsSphericalRepresentation
- CylindricalRepresentation
- CartesianDifferential
- SphericalDifferential
- UnitSphericalCosLatDifferential
- UnitSphericalDifferential
- SphericalCosLatDifferential
- RadialDifferential
- PhysicsSphericalDifferential
- CylindricalDifferential
- WGS84GeodeticRepresentation
- WGS72GeodeticRepresentation
- GRS80GeodeticRepresentation

components:
anyOf:
# CartesianRepresentation
- type: object
properties:
x:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
y:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
z:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# SphericalRepresentation
- type: object
properties:
lat:
$ref: "latitude-1.0.0"
lon:
$ref: "longitude-1.0.0"
distance:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# UnitSphericalRepresentation
- type: object
properties:
lat:
$ref: "latitude-1.0.0"
lon:
$ref: "longitude-1.0.0"

# RadialRepresentation
- type: object
properties:
distance:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# PhysicsSphericalRepresentation
- type: object
properties:
phi:
$ref: "angle-1.0.0"
theta:
$ref: "angle-1.0.0"
r:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# CylindricalRepresentation
- type: object
properties:
rho:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
phi:
$ref: "angle-1.0.0"
z:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# CartesianDifferential
- type: object
properties:
d_x:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_y:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_z:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# SphericalDifferential
- type: object
properties:
d_lon:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_lat:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_distance:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# UnitSphericalCosLatDifferential
- type: object
properties:
d_lon_coslat:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_lat:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# UnitSphericalDifferential
- type: object
properties:
d_lon:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_lat:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# SphericalCosLatDifferential
- type: object
properties:
d_lon_coslat:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_lat:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_distance:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# SphericalDifferential
- type: object
properties:
d_lon:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_lat:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_distance:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# RadialDifferential
- type: object
properties:
d_phi:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_theta:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_r:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# PhysicsSphericalDifferential
- type: object
properties:
d_phi:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_theta:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_r:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# RadialDifferential
- type: object
properties:
d_distance:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

# CylindricalDifferential
- type: object
properties:
d_rho:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_phi:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"
d_z:
$ref: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0"

required: [type, components]
...