Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java @ 3585:c105b4466b4e
Basedata in FixA WQ DC and diagram.
flys-artifacts/trunk@5201 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 14 Aug 2012 08:42:08 +0000 |
parents | afc7bfb4800b |
children | 001e35349203 |
comparison
equal
deleted
inserted
replaced
3584:e60b011c6e0f | 3585:c105b4466b4e |
---|---|
120 } | 120 } |
121 else { | 121 else { |
122 name = STATIC_WQ; | 122 name = STATIC_WQ; |
123 } | 123 } |
124 | 124 |
125 Facet facet = new WQFacet(name, | 125 Facet wQFacet = new WQFacet(name, |
126 Resources.getMsg( | 126 Resources.getMsg( |
127 callMeta, | 127 callMeta, |
128 wkmsName, | 128 wkmsName, |
129 wkmsName)); | 129 wkmsName)); |
130 fs.add(facet); | 130 fs.add(wQFacet); |
131 facets.put(state.getID(), fs); | 131 facets.put(state.getID(), fs); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 spawnState(); | 135 spawnState(); |
188 } | 188 } |
189 | 189 |
190 | 190 |
191 /** | 191 /** |
192 * Get WQ at a given km. | 192 * Get WQ at a given km. |
193 */ | 193 * @param currentKm the requested km. If NULL, ld_location data |
194 public double [][] getWQAtKm(double km) { | 194 * will be used. |
195 */ | |
196 public double [][] getWQAtKm(Double currentKm) { | |
195 | 197 |
196 WstValueTable interpolator = null; | 198 WstValueTable interpolator = null; |
197 // Get WstValueTable | 199 // Get WstValueTable |
198 if (getDataAsString("col_pos") != null) { | 200 if (getDataAsString("col_pos") != null) { |
199 interpolator = WstValueTableFactory.getWstColumnTable( | 201 interpolator = WstValueTableFactory.getWstColumnTable( |
202 else { | 204 else { |
203 interpolator = WstValueTableFactory.getTable( | 205 interpolator = WstValueTableFactory.getTable( |
204 getDataAsInt("wst_id")); | 206 getDataAsInt("wst_id")); |
205 } | 207 } |
206 | 208 |
207 Double tmp = getDataAsDouble("ld_locations"); | 209 Double tmp = (currentKm != null) |
210 ? currentKm | |
211 : getDataAsDouble("ld_locations"); | |
212 | |
208 double [][] vs = interpolator.interpolateWQColumnwise( | 213 double [][] vs = interpolator.interpolateWQColumnwise( |
209 tmp != null ? tmp : 0); | 214 tmp != null ? tmp : 0); |
210 | 215 |
211 for (int x = 0; x < vs[1].length; x++) { | 216 for (int x = 0; x < vs[1].length; x++) { |
212 logger.debug("getWQAtKm: Q/W " + vs[0][x] + " / " + vs[1][x]); | 217 logger.debug("getWQAtKm: Q/W " + vs[0][x] + " / " + vs[1][x]); |