Skip to content
Snippets Groups Projects
  • Erin (Josh) Rigler's avatar
    3703dda2
    Fix TimeseriesUtility.pad_and_trim_trace · 3703dda2
    Erin (Josh) Rigler authored
    I ran into a floating point precision issue when padding a trace out
    to the requested starttime when the data block returned by the Edge
    miniseed factory (but this is not an Edge issue, per se) was less
    than what was requested.
    
    My solution was to use `round()` instead of `int()` when converting
    a time differential to a discrete number of samples. I'm confident
    this is a robust fix for padding. I'm not sure if it also the proper
    approach to the trimming, which seems to be a bit more sophisticated
    in that is uses the `ceil()` method. In any case, I request some
    feedback before merging this deceptively simple PR.
    3703dda2
    History
    Fix TimeseriesUtility.pad_and_trim_trace
    Erin (Josh) Rigler authored
    I ran into a floating point precision issue when padding a trace out
    to the requested starttime when the data block returned by the Edge
    miniseed factory (but this is not an Edge issue, per se) was less
    than what was requested.
    
    My solution was to use `round()` instead of `int()` when converting
    a time differential to a discrete number of samples. I'm confident
    this is a robust fix for padding. I'm not sure if it also the proper
    approach to the trimming, which seems to be a bit more sophisticated
    in that is uses the `ceil()` method. In any case, I request some
    feedback before merging this deceptively simple PR.