Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeArtifact.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 | 88bb0c794833 |
comparison
equal
deleted
inserted
replaced
6300:0711ce5ca701 | 6301:20a32dbdbb59 |
---|---|
166 } | 166 } |
167 */ | 167 */ |
168 | 168 |
169 DischargeTables dt = new DischargeTables(river.getName(), getDataAsString("ids")); | 169 DischargeTables dt = new DischargeTables(river.getName(), getDataAsString("ids")); |
170 | 170 |
171 Map<String, double [][]> map = dt.getValues(100); | 171 Map<String, double [][]> map = dt.getValues(); |
172 | 172 |
173 ArrayList<WQKms> res = new ArrayList<WQKms>(); | 173 ArrayList<WQKms> res = new ArrayList<WQKms>(); |
174 | 174 |
175 Gauge gauge = river.determineGaugeByName(this.getDataAsString("ids")); | 175 Gauge gauge = river.determineGaugeByName(this.getDataAsString("ids")); |
176 | 176 |
183 for (int i = 0 ; i < values[0].length; i++) { | 183 for (int i = 0 ; i < values[0].length; i++) { |
184 values[0][i] += gauge.getDatum().doubleValue(); | 184 values[0][i] += gauge.getDatum().doubleValue(); |
185 } | 185 } |
186 double [] kms = new double[values[0].length]; | 186 double [] kms = new double[values[0].length]; |
187 Arrays.fill(kms, gauge.getStation().doubleValue()); | 187 Arrays.fill(kms, gauge.getStation().doubleValue()); |
188 res.add(new WQKms(kms, values[0], values[1], name)); | 188 res.add(new WQKms(kms, values[0], values[1], name, WQKms.CENTIMETER_AT_GAUGE)); |
189 | 189 |
190 return new CalculationResult( | 190 return new CalculationResult( |
191 res.toArray(new WQKms[res.size()]), | 191 res.toArray(new WQKms[res.size()]), |
192 new Calculation()); | 192 new Calculation()); |
193 } | 193 } |