From 1e69113ec397686365e4aa630c9a4382e0410e03 Mon Sep 17 00:00:00 2001 From: Rebecca Gugerli Date: Fri, 5 Jan 2024 10:16:34 +0100 Subject: [PATCH] modif. for the case where the evaluated model is in the archive --- rainforest/performance/eval_get_estimates.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rainforest/performance/eval_get_estimates.py b/rainforest/performance/eval_get_estimates.py index f0a5ac2..5376dba 100644 --- a/rainforest/performance/eval_get_estimates.py +++ b/rainforest/performance/eval_get_estimates.py @@ -213,12 +213,14 @@ def _get_data(self): # Check if the RF-models are there for model in self.modellist: + self.model_files = {} path = self.qpefolder+'{}'.format(model) - if len(os.listdir(path)) == 0 : + if not os.path.exists(path) or (len(os.listdir(path)) == 0): + logging.info('Extracting {} files from archive'.format(model)) try: path = self.qpefolder+'{}'.format(model) - self.ref_files[ref] = retrieve_prod(path + '/', self.tstart, - self.tend, ref) + self.model_files[model] = retrieve_prod(path + '/', self.tstart, + self.tend, model) logging.info('Model data: {} taken from file archive!'.format(model)) except: logging.error('No QPE maps available for {}, please check path or produce QPE maps'.format(model))