weixin_39747577 2020-11-20 20:17
浏览 0

Fill gaps using latest value or interpolating

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

  • 写回答

11条回答 默认 最新

  • weixin_39747577 2020-11-20 20:17
    关注

    [barsch] In [2195/obspy]: {{{

    !CommitTicketReference repository="obspy" revision="2195"

    • integrates patch submitted by Claudio Satriano (closes #221) }}}
    评论

报告相同问题?