Skip to content

Commit

Permalink
Wrap Simbad query in try except during calibration (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanep97 authored Dec 10, 2024
1 parent 74cb4df commit 100a542
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion iop4lib/instruments/dipol.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,11 @@ def build_wcs(cls, reducedfit: 'ReducedFit', summary_kwargs : dict = None, metho
sources_in_field__in=[reducedfit.header_hintobject],
obsmode=OBSMODES.PHOTOMETRY,
flags__has=ReducedFit.FLAGS.BUILT_REDUCED).first()
n_expected_simbad_sources = len(get_simbad_sources(reducedfit.header_hintobject.coord, radius=(reducedfit.width*cls.arcsec_per_pix*u.arcsec)))
try:
n_expected_simbad_sources = len(get_simbad_sources(reducedfit.header_hintobject.coord, radius=(reducedfit.width*cls.arcsec_per_pix*u.arcsec)))
except Exception as e:
logger.error(f"Error getting simbad sources for {reducedfit}: {e}")
n_expected_simbad_sources = None
n_expected_calibrators = AstroSource.objects.filter(calibrates__in=[reducedfit.header_hintobject]).count()

# log the variables above
Expand Down

0 comments on commit 100a542

Please sign in to comment.