Skip to content

Commit

Permalink
Merge pull request #198 from Parkerwise/wcsaxes-import-fix
Browse files Browse the repository at this point in the history
WCSAxes import fix
  • Loading branch information
astrofrog authored Nov 15, 2024
2 parents 3181c36 + 1a5f6f7 commit 67b972f
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions astrodendro/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,14 @@ def __init__(self, dendrogram):

ax_image_limits = [0.1, 0.1, 0.4, 0.7]

try:
from wcsaxes import WCSAxes
__wcaxes_imported = True
except ImportError:
__wcaxes_imported = False
if self.dendrogram.wcs is not None:
warnings.warn("`WCSAxes` package required for wcs coordinate display.")

if self.dendrogram.wcs is not None and __wcaxes_imported:
if self.dendrogram.wcs is not None:

if self.array.ndim == 2:
slices = ('x', 'y')
else:
slices = ('x', 'y', 1)

ax_image = WCSAxes(self.fig, ax_image_limits, wcs=self.dendrogram.wcs, slices=slices)
self.ax_image = self.fig.add_axes(ax_image)
self.ax_image = self.fig.add_axes(ax_image_limits, projection=self.dendrogram.wcs, slices=slices)

else:
self.ax_image = self.fig.add_axes(ax_image_limits)
Expand Down

0 comments on commit 67b972f

Please sign in to comment.