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 a multi-dimensional PixelFrame #461

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
28 changes: 28 additions & 0 deletions gwcs/coordinate_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,34 @@
return [(f"{at}{i}" if i != 0 else at, 0, 'value') for i, at in enumerate(self._axes_type)]


class PixelFrame(CoordinateFrame):
"""
A coordinate frame describing pixels.

Parameters
----------
naxes : int
The number of pixel dimensions described by the frame.
axes_order : list of int, optional
The axes order, if not specified defaults to `range(naxes)` (i.e. all
axes are in this frame).
name : str, optional
The name of this frame.
axes_names : list of str, optional
The names of the pixel axes.
"""
def __init__(self, naxes, axes_order=None, axes_names=None, name=None):
axes_order = axes_order if axes_order is not None else list(range(naxes))
super().__init__(

Check warning on line 333 in gwcs/coordinate_frames.py

View check run for this annotation

Codecov / codecov/patch

gwcs/coordinate_frames.py#L332-L333

Added lines #L332 - L333 were not covered by tests
naxes,
["PIXEL"]*naxes,
axes_order=axes_order,
unit=[u.pix]*naxes,
axes_names=axes_names,
name=name,
)


class CelestialFrame(CoordinateFrame):
"""
Celestial Frame Representation
Expand Down
Loading