-
-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
DiscussionAn issue opened for, or undergoing discussion.An issue opened for, or undergoing discussion.
Description
Describe the bug
I came across this due to this conversation. We should decide what we want the behaviour to be for a standalone ExtraCoords
object.
To Reproduce
import astropy.units as u
from ndcube import ExtraCoords
ec = ExtraCoords.from_lookup_tables(('hello', 'bye'),
(1, 1),
(list(range(3)) * u.m,
list(range(3)) * u.keV,
)
)
ec.wcs
<WCS(output_frame=CompositeFrame, input_frame=PixelFrame, forward_transform=Model: CompoundModel
Inputs: ('x0', 'x1')
Outputs: ('y0', 'y1')
Model set size: 1
Expression: [0] & [1]
Components:
[0]: <Tabular1D(points=(<Quantity [0., 1., 2.] pix>,), lookup_table=[0. 1. 2.] m)>
[1]: <Tabular1D(points=(<Quantity [0., 1., 2.] pix>,), lookup_table=[0. 1. 2.] keV)>
Parameters:)>
ec.mapping
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[6], line 1
----> 1 ec.mapping
File ~/Git/ndcube/ndcube/extra_coords/extra_coords.py:264, in ExtraCoords.mapping(self)
261 # The mapping is from the array index (position in the list) to the
262 # pixel dimensions (numbers in the list)
263 lts = [list([lt[0]] if isinstance(lt[0], Integral) else lt[0]) for lt in self._lookup_tables]
--> 264 converter = partial(convert_between_array_and_pixel_axes, naxes=len(self._ndcube.shape))
265 pixel_indicies = [list(converter(np.array(ids))) for ids in lts]
266 return tuple(reduce(list.__add__, pixel_indicies))
AttributeError: 'NoneType' object has no attribute 'shape'
Screenshots
No response
System Details
No response
Installation method
No response
Metadata
Metadata
Assignees
Labels
DiscussionAn issue opened for, or undergoing discussion.An issue opened for, or undergoing discussion.