def execute(self, job_info):
        
        self._job = Job.objects.get(id=job_info.job_id)

        self._source_detector = _get_detector(self._source_detector_name)
        self._target_detector = _get_detector(self._target_detector_name)
        
        self._source_call_start_window = \
            _get_call_start_window(self._source_detector_name)
        self._target_call_start_window = \
            _get_call_start_window(self._target_detector_name)
        
        self._annotation_name, self._annotation_value = \
            model_utils.get_clip_query_annotation_data(
                'Classification', 'Call*')
            
        self._annotation_info = _get_annotation_info(self._annotation_name)

        # When we match clips, we use times in seconds after a reference
        # time, specifically midnight of the date specified for the
        # start date parameter of this command.
        self._reference_time = self._get_reference_time()
        
        self._transfer_classifications()
        
        return True
Exemple #2
0
    def execute(self, job_info):

        self._exporter.begin_exports()

        annotation_name, annotation_value = \
            model_utils.get_clip_query_annotation_data(
                'Classification', self._classification)

        value_tuples = self._create_clip_query_values_iterator()

        for detector, station, mic_output, date in value_tuples:

            clips = _get_clips(station, mic_output, detector, date,
                               annotation_name, annotation_value)

            count = clips.count()
            count_text = text_utils.create_count_text(count, 'clip')

            _logger.info(
                ('Exporter will visit {} for detector "{}", station "{}", '
                 'mic output "{}", and date {}.').format(
                     count_text, detector.name, station.name, mic_output.name,
                     date))

            try:
                _export_clips(clips, self._exporter)

            except Exception:
                _logger.error(
                    'Clip export failed. See below for exception traceback.')
                raise

        self._exporter.end_exports()

        return True
    def execute(self, job_info):

        self._job = Job.objects.get(id=job_info.job_id)

        self._source_detector = _get_detector(self._source_detector_name)
        self._target_detector = _get_detector(self._target_detector_name)

        self._source_call_start_window = \
            _get_call_start_window(self._source_detector_name)
        self._target_call_start_window = \
            _get_call_start_window(self._target_detector_name)

        self._annotation_name, self._annotation_value = \
            model_utils.get_clip_query_annotation_data(
                'Classification', 'Call*')

        self._annotation_info = _get_annotation_info(self._annotation_name)

        # When we match clips, we use times in seconds after a reference
        # time, specifically midnight of the date specified for the
        # start date parameter of this command.
        self._reference_time = self._get_reference_time()

        self._transfer_classifications()

        return True
Exemple #4
0
    def execute(self, job_info):

        self._job_info = job_info

        self._annotation_name, self._annotation_value = \
            model_utils.get_clip_query_annotation_data(
                'Classification', self._classification)

        self._clip_manager = clip_manager.instance

        self._create_clip_audio_files()

        return True
    def execute(self, job_info):
        
        self._job_info = job_info

        self._query_annotation_name, self._query_annotation_value = \
            model_utils.get_clip_query_annotation_data(
                'Classification', self._classification)

        self._clip_manager = clip_manager.instance
        
        self._adjust_clips()
        
        return True
    def execute(self, job_info):
        
        self._job_info = job_info

        self._annotation_name, self._annotation_value = \
            model_utils.get_clip_query_annotation_data(
                'Classification', self._classification)

        retain_indices = self._get_retain_clip_indices()
        
        self._clip_manager = clip_manager.instance
        
        self._delete_clips(retain_indices)
        
        return True
Exemple #7
0
 def __init__(self, args, is_mutating):
     
     super().__init__(args)
     
     self._is_mutating = is_mutating
     
     get = command_utils.get_required_arg
     
     self._sm_pair_ui_names = get('station_mics', args)
     self._start_date = get('start_date', args)
     self._end_date = get('end_date', args)
     self._detector_names = get('detectors', args)
     
     classification = get('classification', args)
     self._annotation_name, self._annotation_value = \
         model_utils.get_clip_query_annotation_data(
             'Classification', classification)
         
     tag = get('tag', args)
     self._tag_name = model_utils.get_clip_query_tag_name(tag)