def reject_check_aartfaac(accessor): """ Executes quality checks for any type of telescope args: accessor: tkp.db.accessor image accessor returns: A rejection reason if the image is bad, None otherwise """ nan_check = contains_nan(accessor.data) if nan_check: logger.warning("image %s REJECTED: contains NaN" % accessor.url) return dbquality.reject_reasons['nan'], "" else: return None
def reject_check_generic(accessor): """ Executes quality checks for any type of telescope args: accessor: tkp.db.accessor image accessor returns: A rejection reason if the image is bad, None otherwise """ nan_check = contains_nan(accessor.data) if nan_check: logger.warning("image %s REJECTED: contains NaN" % accessor.url) return tkp.db.quality.reason['nan'].id, "" else: return None
def test_valid(self): array = np.array([1, 2, 3.0]) self.assertFalse(contains_nan(array))
def test_errorstring(self): array = np.array([1, 2, np.nan]) result = contains_nan(array) self.assertTrue(type(result) == str)
def test_invalid(self): array = np.array([1, 2, np.nan]) result = contains_nan(array) self.assertTrue(result)