Skip to content

[BUG] Mouseover in cubeviz fails when only 2D image is in viewer #3838

@rosteen

Description

@rosteen

Jdaviz component

Cubeviz

Description

If you load a 2D image in a Cubeviz image viewer and unload the cube data, then mouseover on that viewer will fail due to the following:

File ~/projects/jdaviz/jdaviz/configs/imviz/plugins/coords_info/coords_info.py:645, in CoordsInfo._image_viewer_update(self, viewer, x, y, mouseevent)
    641 if str(physical_type) in valid_physical_types and self.image_unit is not None:
    642 
    643     # Create list of potentially needed equivalencies for flux/sb unit conversions
    644     pixar_sr = self.app.data_collection[0].meta.get('PIXAR_SR', 1)
--> 645     cube_wave = viewer.slice_value * u.Unit(self.app._get_display_unit('spectral'))
    647     equivalencies = all_flux_unit_conversion_equivs(pixar_sr,
    648                                                     cube_wave)
    650     value = flux_conversion_general(value, unit, u.Unit(self.image_unit),
    651                                     equivalencies, with_unit=False)

TypeError: unsupported operand type(s) for *: 'NoneType' and 'PrefixUnit'

How to Reproduce

Use the Collapse plugin to produce a 2D image, load that into an image viewer and unload any cube data. Then mouseover the viewer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageIssue opened via template and needs triaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions