-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
A concept of "Global Coordinates" #284
Comments
A conversation at the PyHC meeting means we should consider this as a way to represent spacecraft location and maybe frame info. |
Would this be attached to the WCS? |
Will start working on this issue shortly... |
Thanks @kakirastern! |
Yeah, this would be a really great feature to have for Astropy conforming to the APE 14 WCS |
Thanks @DanRyanIrish for the assignment. I will take it up later today HKT during the weekly community meeting. |
In the case of slicing out axes, the coord value at which the slice was made will be stored in this Something similar must be implemented in the new So point of Need an API for users to add global coords explicitly. Draft API
Methods/Properties
|
from collections.abc import Mapping
class GlobalCoords(Mapping):
"""
A structured representation of coordinate information applicable to a whole NDCube.
"""
def __init__(self, ndcube):
pass
def add(self, name, physical_type):
"""
Add a new coordinate to the collection.
"""
def remove(self, name):
"""
Remove a coordinate from the collection
"""
@property
def names(self):
"""
A tuple of all the names.
"""
@property
def physical_types(self):
"""
A tuple of all physical types, one per coordinate.
"""
def keys(self):
"""
A set-like of all names in this collection.
"""
def values(self):
"""
A set-like of all values in this collection
"""
def __getitem__(self, item):
"""
Index the collection by a name.
"""
def __iter__(self):
pass Should implement the whole |
Will start working on this today HKT |
How about adding an |
update is a dict-like API, the issue is that as well as the key (name) we also have physical type which needs to be present, hence sticking with |
I see. Thanks for the clarification ❤️! |
The rework of extra coords in #271 excludes one use case for the extra_coords dict in 1.0, which is the concept of structured metadata describing the coordinates of the whole cube. i.e. "this (x,y,t) cube is at wavelength y nm".
We should consider adding some kind of functionality to NDCube 2.0 to represent these type of coordinates.
(N.B. this is something that could potentially be upstreamed into the APE 14 WCS interface at some point)
The text was updated successfully, but these errors were encountered: