Commit 6c3f6454 authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

QuickViz. Correct source file path.

parent a93ace6a
Pipeline #58087 passed with stages
in 1 minute and 48 seconds
......@@ -16,10 +16,8 @@ class Visualizator(utils.LogConfig):
self.base_dir = self.config[self.object_id]["root_dir"]
def create_data_source_file(self, site_id: str, picarro_id: str, day: datetime.date):
source_dir = os.path.join(self.config["LOCAL"]["base_dir"], site_id, "picarro", picarro_id, str(day.year))
source_filename = site_id + "_" + picarro_id + "_" + day.strftime("%Y%m%d") + ".lzma"
source_filepath = os.path.join(source_dir, source_filename)
source_filepath = utils.get_standard_filepath(self.config["LOCAL"]["base_dir"], site_id, "picarro", picarro_id, day.strftime("%Y%m%d"), "lzma")
if not os.path.exists(source_filepath):
self.logger.error("Failed to open source file " + source_filepath, day.strftime("%Y-%m-%d"))
return
......@@ -38,11 +36,12 @@ class Visualizator(utils.LogConfig):
df.to_csv(calib_filepath, index=False, date_format='%Y-%m-%dT%H:%M:%S.%fZ')
return True
def get_data(self, dat_files: list) -> pd.DataFrame:
dateparse = lambda x: pd.datetime.strptime(x, '%Y-%m-%d %H:%M:%S.%f')
day_df = pd.DataFrame()
for dat_file in dat_files:
print(dat_file)
df = pd.read_csv(dat_file,
delim_whitespace=True,
parse_dates={'datetime': ['DATE', 'TIME']},
......
import datetime
from unittest import TestCase
import wimcollect.quickviz as quickviz
class TestVisualizator(TestCase):
def test_create_data_source_file(self):
vizu = quickviz.Visualizator()
self.assertTrue(vizu.create_data_source_file("DDU", "HIDS2189", datetime.date(2020, 1, 29)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment