Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/Segment.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 | af13ceeba52a |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
6300:0711ce5ca701 | 6301:20a32dbdbb59 |
---|---|
185 // convert to Q if needed | 185 // convert to Q if needed |
186 if (!isQ && gauge != null) { | 186 if (!isQ && gauge != null) { |
187 | 187 |
188 DischargeTable dt = gauge.fetchMasterDischargeTable(); | 188 DischargeTable dt = gauge.fetchMasterDischargeTable(); |
189 | 189 |
190 //TODO: Change scale from 100 to 1 immediately after | |
191 // discharge table import changed to cm! | |
192 double [][] table = | 190 double [][] table = |
193 DischargeTables.loadDischargeTableValues(dt, 100); | 191 DischargeTables.loadDischargeTableValues(dt); |
194 | 192 |
195 // need the original values for naming | 193 // need the original values for naming |
196 segment.backup(); | 194 segment.backup(); |
197 | 195 |
198 for (int i = 0; i < values.length; ++i) { | 196 for (int i = 0; i < values.length; ++i) { |
199 //TODO: s.o. | 197 double w = values[i] * 100.0; |
200 double w = values[i]; /* / 100.0; */ | |
201 double [] qs = DischargeTables.getQsForW(table, w); | 198 double [] qs = DischargeTables.getQsForW(table, w); |
202 if (qs.length == 0) { | 199 if (qs.length == 0) { |
203 log.warn("No Qs found for W = " + values[i]); | 200 log.warn("No Qs found for W = " + values[i]); |
204 report.addProblem("cannot.find.q.for.w", values[i]); | 201 report.addProblem("cannot.find.q.for.w", values[i]); |
205 values[i] = Double.NaN; | 202 values[i] = Double.NaN; |