Skip to content

Commit

Permalink
Merge pull request #111 from pllim/ignore-radec-fmt-err-馃檲
Browse files Browse the repository at this point in the history
Ignore RA/Dec string formatting failures
  • Loading branch information
mwcraig committed Oct 19, 2020
2 parents e0e0cc5 + 68cefe0 commit 19d427a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions astrowidgets/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,13 @@ def _mouse_move_cb(self, viewer, button, data_x, data_y):
val = 'X: {:.2f}, Y: {:.2f}'.format(data_x + self._pixel_offset,
data_y + self._pixel_offset)
if image.wcs.wcs is not None:
ra, dec = image.pixtoradec(data_x, data_y)
val += ' (RA: {}, DEC: {})'.format(
raDegToString(ra), decDegToString(dec))
try:
ra, dec = image.pixtoradec(data_x, data_y)
val += ' (RA: {}, DEC: {})'.format(
raDegToString(ra), decDegToString(dec))
except Exception:
val += ' (RA, DEC: WCS error)'

val += ', value: {}'.format(imval)
self._jup_coord.value = val

Expand Down

0 comments on commit 19d427a

Please sign in to comment.