From a7ef14879e66eea71352b18f50b8ba962b148a96 Mon Sep 17 00:00:00 2001 From: Goutte Date: Thu, 20 Jul 2017 16:58:12 +0200 Subject: [PATCH] More logs ! --- CHANGELOG.md | 4 +++- web/run.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 571e6af..25ebe1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,9 @@ - [x] Count visits - [x] Zoom in on time series - [x] Loader and targets loading animation -- [ ] Start/Stop datetime fields +- [x] Start/Stop datetime fields +- [ ] Optimize CSV generation +- [ ] Remove duplicate NetCDFs from Myriam's API response - [ ] Download raw data (as CSV) for current time interval and targets - [ ] Same via SAMP - [ ] Credit the author of the pixel art planets diff --git a/web/run.py b/web/run.py index 76f362d..cca33a1 100755 --- a/web/run.py +++ b/web/run.py @@ -265,7 +265,7 @@ def generate_csv_contents(source_config, started_at, stopped_at): model_files = retrieve_data(source_config['slug'], model_slug, started_at, stopped_at) orbits_files = retrieve_data(source_config['slug'], source_config['orbit']['model'], started_at, stopped_at) - log.debug("Crunching CSV contents for '%s'..." % source_config['slug']) + log.debug("Crunching CSV contents for '%s'..." % source_config['name']) si = StringIO.StringIO() cw = csv_writer(si) cw.writerow(( # the order matters ! @@ -278,6 +278,7 @@ def generate_csv_contents(source_config, started_at, stopped_at): precision = "%Y-%m-%dT%H" # model and orbits times are equal-ish orbits_data = {} # keys are datetime as str, values arrays of XY for orbits_file in orbits_files: + log.debug("%s: opening orbit NETCDF4 '%s'..." % (source_config['name'], orbits_file)) cdf_handle = Dataset(orbits_file, "r", format="NETCDF4") times = cdf_handle.variables['Time'] # YYYY DOY HH MM SS .ms data_hci = cdf_handle.variables['HCI'] @@ -286,9 +287,12 @@ def generate_csv_contents(source_config, started_at, stopped_at): if started_at <= dtime <= stopped_at: dkey = dtime.strftime(precision) orbits_data[dkey] = datum_hci + cdf_handle.close() all_data = {} # keys are datetime as str, values tuples of data for model_file in model_files: # Time, StartTime, StopTime, V, B, N, T, Delta_angle, P_dyn + log.debug("%s: opening model NETCDF4 '%s'..." % + (source_config['name'], model_file)) cdf_handle = Dataset(model_file, "r", format="NETCDF4") times = cdf_handle.variables['Time'] # YYYY DOY HH MM SS .ms data_v = cdf_handle.variables['V'] -- libgit2 0.21.2