Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/sq/SQRelationExporter.java @ 3552:1df6984628c3
S/Q: Extented the result data model of the S/Q calculation to
store the curve coefficients for each iteration step
of the outlier elimination.
flys-artifacts/trunk@5146 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 27 Jul 2012 12:36:09 +0000 |
parents | 56f62b5209f5 |
children |
comparison
equal
deleted
inserted
replaced
3551:e7f1556192b3 | 3552:1df6984628c3 |
---|---|
118 } | 118 } |
119 | 119 |
120 protected void data2CSV(CSVWriter writer, SQResult result) { | 120 protected void data2CSV(CSVWriter writer, SQResult result) { |
121 logger.debug("data2CSV"); | 121 logger.debug("data2CSV"); |
122 | 122 |
123 // TODO: i18n | |
123 String km = String.valueOf(result.getKm()); | 124 String km = String.valueOf(result.getKm()); |
124 | 125 |
125 for (int i = 0; i < SQResult.NUMBER_FRACTIONS; ++i) { | 126 for (int i = 0; i < SQResult.NUMBER_FRACTIONS; ++i) { |
126 SQFractionResult fraction = result.getFraction(i); | 127 SQFractionResult fraction = result.getFraction(i); |
127 if (!fraction.isValid()) { | 128 |
129 String name = result.getFractionName(i); | |
130 | |
131 Parameters parameters = fraction.getParameters(); | |
132 | |
133 if (parameters == null) { | |
128 continue; | 134 continue; |
129 } | 135 } |
130 String name = result.getFractionName(i); | 136 |
131 Parameters parameters = fraction.getParameters(); | |
132 double a = parameters.getValue(0, "a"); | 137 double a = parameters.getValue(0, "a"); |
133 double b = parameters.getValue(0, "b"); | 138 double b = parameters.getValue(0, "b"); |
134 double sd = Math.sqrt(parameters.getValue(0, "std_dev")); | 139 double sd = Math.sqrt(parameters.getValue(0, "std_dev")); |
135 int t = fraction.getTotalCount(); | 140 int o = fraction.totalNumOutliers(); |
136 int o = fraction.getOutliersCount(); | 141 int t = fraction.numMeasurements() + o; |
142 | |
137 writer.writeNext(new String[] { | 143 writer.writeNext(new String[] { |
138 km, | 144 km, |
139 name, | 145 name, |
140 String.valueOf(a), | 146 String.valueOf(a), |
141 String.valueOf(b), | 147 String.valueOf(b), |