Пример #1
0
def reject_check(image_path, job_config):
    """
    Check if an image passes the quality checks.

    If not, a rejection reason is returned.

    args:
        id: database ID of image. This is not used but kept as a reference for
            distributed computation!
        image_path: path to image
        parset_file: parset file location with quality check parameters
    Returns:
        (rejection ID, description) if rejected, else None
    """

    accessor = tkp.accessors.open(image_path)

    rejected = reject_check_generic(accessor)
    if rejected:
        return rejected

    # Only run LOFAR-specific QC checks on LOFAR images.
    if isinstance(accessor, LofarAccessor):
        rejected = reject_check_lofar(accessor, job_config)
        if rejected:
            return rejected
    else:
        msg = "no specific quality checks for " + accessor.telescope
        logger.warn(msg)
Пример #2
0
def reject_check(image_path, job_config):
    """ checks if an image passes the quality check. If not, a rejection
        tuple is returned.

    NOTE: should only be used on a NODE

    args:
        id: database ID of image. This is not used but kept as a reference for
            distributed computation!
        image_path: path to image
        parset_file: parset file location with quality check parameters
    Returns:
        (rejection ID, description) if rejected, else None
    """

    accessor = tkp.accessors.open(image_path)
    # Only run LOFAR-specific QC checks on LOFAR images.
    if isinstance(accessor, LofarAccessor):
        return reject_check_lofar(
            accessor, job_config
        )
    else:
        logger.warn(
            "Unrecognised telescope %s for file %s, no quality checks.",
            accessor.telescope, image_path
        )
        return None
Пример #3
0
def reject_check(accessor, job_config):
    """
    Check if an image passes the quality checks.

    If not, a rejection reason is returned.

    args:
        accessor: a TKP accessor representing the image
        job_config: parset file location with quality check parameters

    Returns:
        (rejection ID, description) if rejected, else None
    """
    rejected = reject_check_generic_data(accessor)
    if rejected:
        return rejected

    if isinstance(accessor, AartfaacCasaImage):
        rejected = reject_check_aartfaac(accessor)
        if rejected:
            return rejected

    # Only run LOFAR-specific QC checks on LOFAR images.
    if isinstance(accessor, LofarAccessor):
        rejected = reject_check_lofar(accessor, job_config)
        if rejected:
            return rejected
    else:
        msg = "no specific quality checks for " + accessor.telescope
        logger.debug(msg)
Пример #4
0
def reject_check(image_path, job_config):
    """ checks if an image passes the quality check. If not, a rejection
        tuple is returned.

    NOTE: should only be used on a NODE

    args:
        id: database ID of image. This is not used but kept as a reference for
            distributed computation!
        image_path: path to image
        parset_file: parset file location with quality check parameters
    Returns:
        (rejection ID, description) if rejected, else None
    """

    accessor = tkp.accessors.open(image_path)
    # Only run LOFAR-specific QC checks on LOFAR images.
    if isinstance(accessor, LofarAccessor):
        return reject_check_lofar(accessor, job_config)
    else:
        logger.warn(
            "Unrecognised telescope %s for file %s, no quality checks.",
            accessor.telescope, image_path)
        return None
Пример #5
0
 def test_zero_integration(self):
     self.accessor._tau_time = 0
     result = reject_check_lofar(self.accessor, self.job_config)
     self.assertTrue(result)
Пример #6
0
 def test_zero_integration(self):
     self.accessor._tau_time = 0
     result = reject_check_lofar(self.accessor, self.job_config)
     self.assertTrue(result)