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

Remove dependence of NDCube.cube_like_dimensions on NDCube.dimensions #121

Merged
Merged
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
8 changes: 6 additions & 2 deletions ndcube/ndcube_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def __init__(self, data_list, meta=None, common_axis=None, **kwargs):

@property
def dimensions(self):
return self._dimensions

@property
def _dimensions(self):
dimensions = [len(self.data) * u.pix] + list(self.data[0].dimensions)
if len(dimensions) > 1:
# If there is a common axis, length of cube's along it may not
Expand All @@ -62,8 +66,8 @@ def world_axis_physical_types(self):
def cube_like_dimensions(self):
if type(self._common_axis) is not int:
raise TypeError("Common axis must be set.")
dimensions = list(self.dimensions)
cube_like_dimensions = list(self.dimensions[1:])
dimensions = list(self._dimensions)
cube_like_dimensions = list(self._dimensions[1:])
if dimensions[self._common_axis+1].isscalar:
cube_like_dimensions[self._common_axis] = \
u.Quantity(dimensions[0].value * dimensions[self._common_axis+1].value, unit=u.pix)
Expand Down