def visit(observation, **kwargs):
    mc.check_param(observation, Observation)

    # conversation with JJK, PD 2018-08-27 - use the observation-level
    # data quality flag.
    #
    # There's no header information, so get the list of QA rejected files
    # from URLs that look like this:
    #
    # https://archive-new.nrao.edu/vlass/quicklook/VLASS*/QA_REJECTED/#
    #
    # and compare against that list. The list gets items added/removed over
    # time.

    count = 0
    original = observation.requirements
    if metadata.cache.is_qa_rejected(observation.observation_id):
        observation.requirements = Requirements(Status.FAIL)
    else:
        observation.requirements = None
    if observation.requirements != original:
        logging.warning(
            f'Changed requirements to {observation.requirements} '
            f'for {observation.observation_id}.'
        )
        count = 1
    logging.info(
        f'Completed quality augmentation for {observation.observation_id}'
    )
    return observation
Exemple #2
0
    def _update_requirements(self, observation):
        """
        Add Requirements Status FAIL to observations that are named _REJECT.
        Hard-code the target name to 'BAD' in this case, as well.

        :param observation: Observation.requirements.status
        """
        observation.requirements = Requirements(Status.FAIL)
        observation.target.name = 'BAD'
def _set_failed(observation):
    observation.requirements = Requirements(Status.FAIL)