|
|
@ -18,7 +18,11 @@ func ResampleTimeSeriesData(data [][]float64, start float64, end float64, numSte
|
|
|
|
idx := sort.Search(l, func(i int) bool { return data[i][0] >= pos })
|
|
|
|
idx := sort.Search(l, func(i int) bool { return data[i][0] >= pos })
|
|
|
|
var val float64
|
|
|
|
var val float64
|
|
|
|
if idx == 0 {
|
|
|
|
if idx == 0 {
|
|
|
|
val = math.NaN() // off the left
|
|
|
|
if data[0][0] == pos {
|
|
|
|
|
|
|
|
val = data[0][1] // exactly left
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
val = math.NaN() // off the left
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if idx == l {
|
|
|
|
} else if idx == l {
|
|
|
|
val = math.NaN() // off the right
|
|
|
|
val = math.NaN() // off the right
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|