Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFacet.java @ 8132:58e3fed51e9e
GetFractionByName now returns a list as it can differ in Epochs
One result can be calculated with multiple epochs. there is
a todo in there to correctly split up the epochs in the facets.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 25 Aug 2014 20:00:45 +0200 |
parents | f01c65261963 |
children | c200b76145ce |
comparison
equal
deleted
inserted
replaced
8131:fae48b3c09d1 | 8132:58e3fed51e9e |
---|---|
108 logger.error("Invalid result!"); | 108 logger.error("Invalid result!"); |
109 } | 109 } |
110 | 110 |
111 SedimentLoadDataResult sdResult = (SedimentLoadDataResult) payload; | 111 SedimentLoadDataResult sdResult = (SedimentLoadDataResult) payload; |
112 | 112 |
113 Fraction frac = sdResult.getFractionByName(fraction); | 113 List<Fraction> fractions = sdResult.getFractionsByName(fraction); |
114 if (frac == null) { | 114 if (fractions == null) { |
115 logger.warn("No result for: " + fraction); | 115 logger.warn("No result for: " + fraction); |
116 return null; | |
116 } | 117 } |
117 | 118 |
118 return frac.getData(); | 119 /* TODO handle multiple periods per fraction */ |
120 if (fractions.size() > 1) { | |
121 logger.warn("Multiple periods not implemented."); | |
122 } | |
123 | |
124 return fractions.get(0).getData(); | |
119 | 125 |
120 /* Are gaps neccessary now? | 126 /* Are gaps neccessary now? |
121 for (int x = 0; x < values[0].length-1; x++) { | 127 for (int x = 0; x < values[0].length-1; x++) { |
122 // Introduce gaps where no data in measurement station. | 128 // Introduce gaps where no data in measurement station. |
123 if (Math.abs(values[0][x+1] - values[0][x]) > 3*EPSILON | 129 if (Math.abs(values[0][x+1] - values[0][x]) > 3*EPSILON |