Skip to content
Snippets Groups Projects
Commit 4981c310 authored by William Roberts's avatar William Roberts
Browse files

Improve fillna logic in nc.py

parent a68618fc
No related branches found
No related tags found
No related merge requests found
......@@ -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')]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment