From 4981c31038d1be0027618b4ded45e1500ecb5d5e Mon Sep 17 00:00:00 2001
From: wroberts <wroberts4@wisc.edu>
Date: Mon, 7 Oct 2019 09:17:05 -0500
Subject: [PATCH] Improve fillna logic in nc.py

---
 aosstower/level_b1/nc.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/aosstower/level_b1/nc.py b/aosstower/level_b1/nc.py
index 5b9c96d..84e36b8 100644
--- a/aosstower/level_b1/nc.py
+++ b/aosstower/level_b1/nc.py
@@ -101,11 +101,12 @@ def create_giant_netcdf(input_files, output_fn, zlib, chunk_size,
 
     # average the values
     if summary:
-        frame = summary_over_interval(new_frame, interval_width).fillna(np.nan)
+        frame = summary_over_interval(new_frame, interval_width)
     else:
-        frame = new_frame.resample(interval_width, closed='right', loffset=interval_width).mean().fillna(np.nan)
+        frame = new_frame.resample(interval_width, closed='right', loffset=interval_width).mean()
         frame['wind_dir'] = calc.wind_vector_degrees(frame['wind_east'], frame['wind_north'])
         frame['gust'] = new_frame['gust'].resample(interval_width, closed='right', loffset=interval_width).max()
+    frame = frame.fillna(np.nan)
 
     if start and end:
         frame = frame[start.strftime('%Y-%m-%d %H:%M:%S'): end.strftime('%Y-%m-%d %H:%M:%S')]
-- 
GitLab