Skip to content
Snippets Groups Projects
Commit 3f4f2539 authored by Erin (Josh) Rigler's avatar Erin (Josh) Rigler
Browse files

Pad to urlInterval in put_timeseries()

TimeseriesFactory.get_timeseries() pads to the requested interval with NaNs,
filling in start/end gaps. TimeseriesFactory.put_timeseries() is supposed to
do this (according to Jeremy Fee), but it was trimming NaNs from the start/
end before writing to file. This PR fixes this by using ObsPy's Stream.trim()
method, in a similar manner to TimesereisFactory.get_timeseries(), to pad to
the specified start and end of the urlInterval..
parent f398e16c
No related branches found
No related tags found
No related merge requests found
......@@ -226,6 +226,13 @@ class TimeseriesFactory(object):
trace.stats.location = new_trace.stats.location
url_data = TimeseriesUtility.merge_streams(
existing_data, url_data)
# pad with NaN's out to urlInterval (like get_timeseries())
url_data.trim(
starttime=urlInterval['start'],
endtime=(urlInterval['end'] - delta),
nearest_sample=False,
pad=True,
fill_value=numpy.nan)
except IOError:
# no data yet
pass
......
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