Skip to content

Commit

Permalink
calibration error handling improved
Browse files Browse the repository at this point in the history
  • Loading branch information
mommermi committed Aug 7, 2018
1 parent a8b17d7 commit 7414724
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,6 @@ def transform_filters(self, targetfilter):
# ... derive a linear best fit and remove outliers (>3 sigma)
ri = numpy.array(filtered_mags[1]) - numpy.array(filtered_mags[2])
gr = numpy.array(filtered_mags[0]) - numpy.array(filtered_mags[1])

if len(ri) == 0 or len(gr) == 0:
logging.warning('no suitable stars for transformation to %s' %
targetfilter)
Expand Down
8 changes: 6 additions & 2 deletions pp_calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ def create_photometrycatalog(ra_deg, dec_deg, rad_deg, filtername,
('SkyMapper' in catalogname and
filtername not in {'g', 'r', 'i'})):

n_transformed = cat.transform_filters(filtername) - \
cat.reject_sources_with(
n_transformed = cat.transform_filters(filtername)
if n_transformed == 0:
raise ValueError(('unable to transform {:s} to {:s}'.format(
cat.catalogname, filtername) +
'; refer to LOG file for details'))
n_transformed -= cat.reject_sources_with(
cat['_e_'+filtername+'mag'] > mag_accuracy)

if display and n_transformed > 0:
Expand Down

0 comments on commit 7414724

Please sign in to comment.