comparison pkg/controllers/bottlenecks.go @ 4860:de7aa9230837

Limit interpolation of time ranges for Available Fairway Depths to 1.5h. This is necessary to prevent interpolation into time ranges where intentionally no data is provided. (When bottlenecks are "inactive" no data is provided and gemma shall assume perfect conditions for that time)
author Sascha Wilde <wilde@intevation.de>
date Wed, 04 Dec 2019 15:28:22 +0100
parents 125cac3c977d
children 2ede9ac26ef2
comparison
equal deleted inserted replaced
4859:082027fb2d58 4860:de7aa9230837
217 217
218 if p2.when.Before(from) { 218 if p2.when.Before(from) {
219 continue 219 continue
220 } 220 }
221 221
222 if p2.when.Sub(p1.when).Hours() > 1.5 {
223 // Don't interpolate ranges bigger then one hour
224 continue
225 }
226
222 lo, hi := maxTime(p1.when, from), minTime(p2.when, to) 227 lo, hi := maxTime(p1.when, from), minTime(p2.when, to)
223 228
224 m1, m2 := access(p1), access(p2) 229 m1, m2 := access(p1), access(p2)
225 if m1 == m2 { // The whole interval is in only one class. 230 if m1 == m2 { // The whole interval is in only one class.
226 for j := 0; j < len(classes)-1; j++ { 231 for j := 0; j < len(classes)-1; j++ {