Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 708:757ff56b43b3
Added calculation "am Pegel" version to the "Wasserspiegellage" calculation.
flys-artifacts/trunk@2161 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sat, 18 Jun 2011 20:20:34 +0000 |
parents | ddd8b37d5cd3 |
children | 3b7e9ddf6bb1 |
comparison
equal
deleted
inserted
replaced
707:b6f57d927905 | 708:757ff56b43b3 |
---|---|
326 WstValueTable wst = WstValueTableFactory.getTable(river); | 326 WstValueTable wst = WstValueTableFactory.getTable(river); |
327 if (wst == null) { | 327 if (wst == null) { |
328 throw new NullPointerException("No Wst found for selected river."); | 328 throw new NullPointerException("No Wst found for selected river."); |
329 } | 329 } |
330 | 330 |
331 double refKm = Double.NaN; | |
332 | |
333 if (!isFreeQ()) { | |
334 double pos = kms[river.getKmUp() ? 0 : kms.length-1]; | |
335 Gauge gauge = river.determineGaugeByPosition(pos); | |
336 if (gauge == null) { | |
337 logger.warn("no gauge found at km " + pos); | |
338 } | |
339 else { | |
340 refKm = gauge.getStation().doubleValue(); | |
341 } | |
342 } | |
343 | |
331 WQKms[] results = computeWaterlevelData( | 344 WQKms[] results = computeWaterlevelData( |
332 kms, qs, ws, wst, river.getKmUp()); | 345 kms, qs, ws, wst, refKm, river.getKmUp()); |
333 | 346 |
334 return results; | 347 return results; |
335 } | 348 } |
336 | 349 |
337 /** | 350 /** |
347 public static WQKms[] computeWaterlevelData( | 360 public static WQKms[] computeWaterlevelData( |
348 double [] kms, | 361 double [] kms, |
349 double [] qs, | 362 double [] qs, |
350 double [] ws, | 363 double [] ws, |
351 WstValueTable wst, | 364 WstValueTable wst, |
365 double refKm, | |
352 boolean up | 366 boolean up |
353 ) { | 367 ) { |
354 logger.info("WINFOArtifact.computeWaterlevelData"); | 368 logger.info("WINFOArtifact.computeWaterlevelData"); |
355 | 369 |
356 Calculation1 calculation = new Calculation1(kms, qs, ws, up); | 370 Calculation1 calculation = new Calculation1(kms, qs, ws, refKm, up); |
357 | 371 |
358 WQKms[] wqkms = calculation.calculate(wst); | 372 WQKms[] wqkms = calculation.calculate(wst); |
359 | 373 |
360 // TODO: report problems to user | 374 // TODO: report problems to user |
361 | 375 |