diff --git a/mpi/template_manager.py b/mpi/template_manager.py index d7d4b156b54f2e1d23552726ed48943075c671c6..0119d1d3c8063ba4469f0415155008b315e377ca 100644 --- a/mpi/template_manager.py +++ b/mpi/template_manager.py @@ -37,4 +37,5 @@ class TemplateManager(SequentialLoader): def set_unloadable(self, template): self.remove(template) + del self.map[template] diff --git a/mpi/template_matching.py b/mpi/template_matching.py index 7139e5f080f2b192bb5650188ccaabceb4ef87ff..727cff2d5d14cd8969cc3105bb57776afb984d16 100644 --- a/mpi/template_matching.py +++ b/mpi/template_matching.py @@ -195,16 +195,6 @@ class TemplateMatching(object): elif os.path.isfile(errorchunks_file): os.remove(errorchunks_file) - errortemplates_file = os.path.join(self.config.directory, 'errorTemplates.dat') - if self.failed_templates: - def failed_templates_to_row(template): - return {'Template':template} - columns = [('Template',0)] - tmio.save_iter_to_file(self.failed_templates, errortemplates_file, - failed_templates_to_row, columns) - elif os.path.isfile(errortemplates_file): - os.remove(errortemplates_file) - def __user_info(self): """ Inform user of the current status @@ -280,11 +270,6 @@ class TemplateMatching(object): # Stop the execution if we had problem loading templates if self.failed_templates: - ftemplate = self.failed_templates[0] - start, shift, mag = self.template_mngr.get_template(ftemplate) - self.logger.error("Error: couldn't load template for time '%s'. To continue either " - "delete/comment the event from catalog to exclude it or fix the " - "waveform archive so that the template can be loaded." % (start)) break # We have finished, save last time @@ -307,10 +292,13 @@ class TemplateMatching(object): for l in self.m_template_ldr.get_completed(): template, error = self.m_template_ldr.get_data(l) if error: + start, shift, mag = self.template_mngr.get_template(template) + self.logger.error("Error: couldn't load template for time '%s'. To continue either " + "delete/comment the event from catalog to exclude it or fix the " + "waveform archive so that the template can be loaded." % (start)) self.template_mngr.set_unloadable(template) self.scanner_mngr.remove_template(template) # useful when continuing previous run self.failed_templates.append(template) - self.logger.warning('(Error) Loading template %d' % (template) ) else: self.template_mngr.set_loaded(template) self.scanner_mngr.add_template_to_process(template)