From 2f0640c86e652ef696c8c0bdd517fcddf51fa513 Mon Sep 17 00:00:00 2001
From: Olivier Jossoud <olivier.jossoud@lsce.ipsl.fr>
Date: Mon, 2 Dec 2019 12:07:55 +0100
Subject: [PATCH] Explo. Using cfatool. Beginning

---
 src/dataprovider/exploprovider.py | 5 ++++-
 src/uim/explouim.py               | 1 -
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/dataprovider/exploprovider.py b/src/dataprovider/exploprovider.py
index 4715e71..43aea64 100644
--- a/src/dataprovider/exploprovider.py
+++ b/src/dataprovider/exploprovider.py
@@ -5,17 +5,20 @@ import re
 import xmltodict
 import xml.etree.cElementTree as ET
 from io import StringIO
+from cfatools.logreader.instrument import InstrumentReader
 
 import utils
 from dataprovider.picarroprovider import PicarroProvider
 
 
+
 class ExploProvider:
 
     def __init__(self, picarro_prvd: PicarroProvider):
         self.datasets_root_directory = ""
         self.datasets = {}
         self.picarro_prvd = picarro_prvd
+        self.instrument_reader = None
 
     def explore_root_directory(self, root_directory: str) -> list:
         """Get the names of the datasets directories.
@@ -31,6 +34,7 @@ class ExploProvider:
             List of dataset directories name (without full path)
 
         """
+        self.instrument_reader = InstrumentReader(base_path=root_directory)
         directories = []
 
         # Find all directories in datasets root directory (not recursive)
@@ -85,7 +89,6 @@ class Dataset:
                 inst_and_type = re.search("^" + self.directory_name + '_(.+?).log$', filename).group(1)
             except AttributeError:
                 # The found file does not match normal instrument's log file pattern
-                print("File [" + filename + "] does not appear to be a valid CFA log file")
                 continue
 
             instrument_name = inst_and_type.split("_")[0]
diff --git a/src/uim/explouim.py b/src/uim/explouim.py
index d2cb9d2..74a8403 100644
--- a/src/uim/explouim.py
+++ b/src/uim/explouim.py
@@ -76,7 +76,6 @@ class ExploUim:
         self.__init_stab__()
         self.main_ui.explo_pushbutton_stab.clicked.connect(self.__show_stab_window__)
 
-
     def __initialize_dataset_combobox__(self):
         """Populate the "datasets" combobox with the existing dataset directory names."""
         data_root_dir = self.config.read("DATA_SOURCE", "absolute_root_dir")
-- 
GitLab