Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 2faf6cef6f5f |
children | 8731c3dabb56 0a5239a1e46e |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java Thu Jan 18 20:10:59 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java Thu Jan 18 20:12:01 2018 +0100 @@ -161,9 +161,12 @@ officalFixings = new ArrayList<WQKms>(); - for (Artifact art: collection.getArtifactsByName(STATICWQKMSNAME, context)) { + for (Artifact art: collection.getArtifactsByName( + STATICWQKMSNAME, context) + ) { if (art instanceof StaticWQKmsArtifact) { - IsOfficialAccess access = new IsOfficialAccess((D4EArtifact)art); + IsOfficialAccess access = + new IsOfficialAccess((D4EArtifact)art); StaticWQKmsArtifact sart = (StaticWQKmsArtifact) art; if (!access.isOfficial()) { continue; @@ -537,7 +540,8 @@ ) { log.info("WaterlevelExporter.writeCSVHeader"); - String unit = RiverUtils.getRiver((D4EArtifact) master).getWstUnit().getName(); + String unit = RiverUtils.getRiver( + (D4EArtifact) master).getWstUnit().getName(); if (atGauge) { writer.writeNext(new String[] { @@ -629,7 +633,8 @@ if (flys instanceof WINFOArtifact) { if (wqkms != null && wqkms.getRawValue() != null) { WINFOArtifact winfo = (WINFOArtifact) flys; - colDesc = RiverUtils.getNamedMainValue(winfo, wqkms.getRawValue()); + colDesc = RiverUtils.getNamedMainValue( + winfo, wqkms.getRawValue()); // For 'W am Pegel' s if (colDesc == null) { Double value = RiverUtils.getValueFromWQ(wqkms); @@ -834,42 +839,6 @@ entry.getValue().add(wqkms.getW(idx), wqkms.getQ(idx)); } } - - /* Variant: Interpolate the values - // Now get the lines for the of the calculation - Map <Double, WstLine> calcLines = writer.getLines(); - - // Create an interpolater for the official KM -> W relation - UnivariateRealFunction wFunc = new LinearInterpolator( - ).interpolate(wqkms.allKms().toNativeArray(), - wqkms.allWs().toNativeArray()); - - // Now for each calculated point add the interpolated official - for (Map.Entry<Double, WstLine> entry : calcLines.entrySet()) { - try { - double wVal = wFunc.value(entry.getKey().doubleValue()); - // Matching Q's are guranteed otherwise we would - // not have an official line - entry.getValue().add(wVal, entry.getValue().getQ(0)); - } - catch (FunctionEvaluationException aode) { - // should not happen - log.error("spline interpolation failed", aode); - // entry.getValue().add(Double.NaN, entry.getValue().getQ(0)); - } - }*/ - - /* Variant: Add all official fixings - // Warning the WSTWriter does not handle this properly - // as it writes the points for which only a calculation - // exists in the first column - int size = wqkms.size(); - result = new double[4]; - for (int i = 0; i < size; i++) { - result = wqkms.get(i, result); - writer.add(result); - } - */ } }