# HG changeset patch # User Felix Wolfsteller # Date 1339131213 0 # Node ID 8bd4cf11c25a5151faedcaad0c147ec71e9e1cb6 # Parent bb576facbe50bb97f1987cbc013878ccb42126e3 Interpolate wkms in computed discharges. flys-artifacts/trunk@4628 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r bb576facbe50 -r 8bd4cf11c25a flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Jun 07 20:53:49 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Jun 08 04:53:33 2012 +0000 @@ -1,3 +1,8 @@ +2012-06-07 Felix Wolfsteller + + * src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java: + (doWOut): Interpolate values from WKms. + 2012-06-07 Felix Wolfsteller * src/main/java/de/intevation/flys/artifacts/states/GaugeDischargeState.java: diff -r bb576facbe50 -r 8bd4cf11c25a flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Thu Jun 07 20:53:49 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Fri Jun 08 04:53:33 2012 +0000 @@ -14,6 +14,7 @@ import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; +import de.intevation.flys.artifacts.StaticWKmsArtifact; import de.intevation.flys.artifacts.WINFOArtifact; import de.intevation.flys.artifacts.model.FacetTypes; @@ -179,6 +180,7 @@ Document theme, boolean visible ) { + logger.debug("ComputedDischargeCurveGenerator: doWQOut"); double [][] data = (double [][]) wqkms; XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); @@ -199,6 +201,7 @@ Document theme, boolean visible ) { + logger.debug("ComputedDischargeCurveGenerator: doWQOut"); XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); StyledSeriesBuilder.addPointsQW(series, wqkms); @@ -220,6 +223,7 @@ List xy = new ArrayList(); double [][] data = (double [][]) wqkms; for (int i = 0; i< data[0].length; i++) { + // TODO we need linear interpolation? xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), (float) data[0][i], StickyAxisAnnotation.SimpleAxis.X_AXIS)); xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), @@ -247,7 +251,9 @@ List xy = new ArrayList(); // Try to find them as WKms as well... if (wqkms instanceof double[][]) { + logger.debug("its double[][] time, baby"); double [][] data = (double [][]) wqkms; + // TODO Do we need interpolation? for (int i = 0; i< data[0].length; i++) { xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); @@ -257,12 +263,14 @@ aandf, theme, visible); } else { + logger.debug("its wkms time, baby"); WKms data = (WKms) wqkms; - // assume its WKms + // Assume its WKms. + double location = getRange()[0]; + double w = ((StaticWKmsArtifact) aandf.getArtifact()) + .getWAtKmLin(data, getRange()[0]); xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), - (float) data.getW(0), StickyAxisAnnotation.SimpleAxis.Y_AXIS)); - xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), - (float) 180f, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), aandf, theme, visible);