Skip to content

Commit

Permalink
Updated astropy error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
turnerm committed May 18, 2018
1 parent 0020266 commit 6bb64a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions banzai/utils/fits_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ def parse_ra_dec(header):
coord = SkyCoord(header.get('RA'), header.get('DEC'), unit=(units.hourangle, units.degree))
ra = coord.ra.deg
dec = coord.dec.deg
except ValueError:
except (ValueError, TypeError):
# Fallback to CRVAL1 and CRVAL2
try:
coord = SkyCoord(header.get('CRVAl1'), header.get('CRVAL2'), unit=(units.degree, units.degree))
ra = coord.ra.deg
dec = coord.dec.deg
except ValueError:
except (ValueError, TypeError):
# Fallback to Cat-RA and CAT-DEC
try:
coord = SkyCoord(header.get('CAT-RA'), header.get('CAT-DEC'), unit=(units.hourangle, units.degree))
ra = coord.ra.deg
dec = coord.dec.deg
except ValueError as e:
except (ValueError, TypeError) as e:
logger.error('Could not get initial pointing guess. {0}'.format(e),
extra={'tags': {'filename': header.get('ORIGNAME')}})
ra, dec = np.nan, np.nan
Expand Down

0 comments on commit 6bb64a6

Please sign in to comment.