Skip to content

Commit

Permalink
allow initializing when slice axis is pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Mar 8, 2024
1 parent 6e48798 commit 98f98f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions jdaviz/configs/cubeviz/plugins/slice/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(self, *args, **kwargs):
self._initialize_location()

def _initialize_location(self, *args):
# intitialize value_unit (this has to wait until data is loaded to an existing
# initialize value_unit (this has to wait until data is loaded to an existing
# slice_indicator_viewer, so we'll keep trying until it is set - after that, changes
# will be handled by a change to global display units)
if not self.value_unit:
Expand Down Expand Up @@ -133,7 +133,7 @@ def slice_axis(self):

@property
def valid_slice_att_names(self):
return _spectral_axis_names
return _spectral_axis_names + ['Pixel Axis 2 [x]']

@property
def slice_selection_viewers(self):
Expand Down
3 changes: 2 additions & 1 deletion jdaviz/configs/cubeviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def _get_component(layer):
# either way, return an empty array and skip this layer
return np.array([])
try:
return np.asarray(np.unique(np.concatenate([_get_component(layer) for layer in self.layers])), dtype=float)
return np.asarray(np.unique(np.concatenate([_get_component(layer) for layer in self.layers])), # noqa
dtype=float)
except ValueError:
return np.array([])

Expand Down

0 comments on commit 98f98f2

Please sign in to comment.