Skip to content

Commit

Permalink
modif. for the case where the evaluated model is in the archive
Browse files Browse the repository at this point in the history
  • Loading branch information
gugerlir committed Jan 5, 2024
1 parent b65f6f7 commit 1e69113
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rainforest/performance/eval_get_estimates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1e69113

Please sign in to comment.