When adding two traces, gaps are either filled using a constant value (specified through "fill_value") or using masked arrays (when fill_value==None).
From a signal analysis point of view it is however interesting to have other ways of filling a gap.
One is to use the latest value before the gap, another one might be to linearly interpolate between the two samples before and after the gap.
I attach, as an example, a patch to trace.py that implements the first concept.
It is not very elegant, because it needs "fill_value" to be set to the string "latest" in order to use the latest value to fill the gap. Unfortunately this was the only way to go without changing the method interface.
I'm sure you can come to a better implementation, but please consider enhancing this aspect.
Claudio
该提问来源于开源项目:obspy/obspy