Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java @ 6301:20a32dbdbb59
Remove discharge table scaling but add reference system to W
- Discharge_Tables are now always W[cm] Q[m³] no need for
special case handling depending on historical / master tables
- W now has a referenceSystem value that can be CENTIMETER_AT_GAUGE or
METER_OVER_REFPOINT. The default is METER_OVER_REFPOINT as this is
the case for everything except the objects created from discharge tables
Known issue: WINFO input validation is currently broken as it still scales
the user input.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 12 Jun 2013 10:54:27 +0200 |
parents | a0078e5e3b39 |
children | 5c880567a020 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java Wed Jun 12 16:36:34 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java Wed Jun 12 10:54:27 2013 +0200 @@ -745,7 +745,7 @@ return null; } - double [][] values = DischargeTables.loadDischargeTableValues(dt, 1); + double [][] values = DischargeTables.loadDischargeTableValues(dt); TDoubleArrayList wsOut = new TDoubleArrayList(ws.length); TDoubleArrayList qsOut = new TDoubleArrayList(ws.length); @@ -757,8 +757,7 @@ logger.warn("W is NaN: ignored"); continue; } - double w = ws[i] / 100d; - double [] qs = DischargeTables.getQsForW(values, w); + double [] qs = DischargeTables.getQsForW(values, ws[i]); if (qs.length == 0) { logger.warn("No Qs found for W = " + ws[i]); @@ -766,7 +765,7 @@ else { for (double q: qs) { wsOut.add(ws[i]); - qsOut.add(q * 100d); + qsOut.add(q); } } generatedWs |= qs.length != 1;