Пример #1
0
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
Пример #2
0
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
Пример #3
0
 def test_valid(self):
     array = np.array([1, 2, 3.0])
     self.assertFalse(contains_nan(array))
Пример #4
0
 def test_errorstring(self):
     array = np.array([1, 2, np.nan])
     result = contains_nan(array)
     self.assertTrue(type(result) == str)
Пример #5
0
 def test_invalid(self):
     array = np.array([1, 2, np.nan])
     result = contains_nan(array)
     self.assertTrue(result)