Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/AbstractSInfoCalculationResult.java @ 8940:82998242ba84
Preparing for additional outputs of SINFO-Tkh
author | gernotbelger |
---|---|
date | Tue, 06 Mar 2018 18:51:18 +0100 |
parents | d9dbf0b74bc2 |
children | 5d5d482da3e9 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/AbstractSInfoCalculationResult.java Tue Mar 06 17:14:56 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/AbstractSInfoCalculationResult.java Tue Mar 06 18:51:18 2018 +0100 @@ -62,6 +62,32 @@ return Collections.unmodifiableCollection(this.rows); } + public double[][] getFlowDepthPoints() { + + final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); + final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); + + for (final ROW row : this.rows) { + xPoints.add(row.getStation()); + yPoints.add(row.getFlowDepth()); + } + + return new double[][] { xPoints.toNativeArray(), yPoints.toNativeArray() }; + } + + public double[][] getFlowDepthTkhPoints() { + + final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); + final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); + + for (final ROW row : this.rows) { + xPoints.add(row.getStation()); + yPoints.add(row.getFlowDepthWithTkh()); + } + + return new double[][] { xPoints.toNativeArray(), yPoints.toNativeArray() }; + } + public final double[][] getTkhUpPoints() { final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); @@ -90,6 +116,45 @@ return adjustTkhVisualization(xPoints, yPoints, kinds); } + public double[][] getVelocityPoints() { + + final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); + final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); + + for (final ROW row : this.rows) { + xPoints.add(row.getStation()); + yPoints.add(row.getVelocity()); + } + + return new double[][] { xPoints.toNativeArray(), yPoints.toNativeArray() }; + } + + public double[][] getD50Points() { + + final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); + final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); + + for (final ROW row : this.rows) { + xPoints.add(row.getStation()); + yPoints.add(row.getD50()); + } + + return new double[][] { xPoints.toNativeArray(), yPoints.toNativeArray() }; + } + + public double[][] getTauPoints() { + + final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); + final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); + + for (final ROW row : this.rows) { + xPoints.add(row.getStation()); + yPoints.add(row.getTau()); + } + + return new double[][] { xPoints.toNativeArray(), yPoints.toNativeArray() }; + } + /** * the up and down points must be further adjusted for visualization, see Mail Hr. Reiß * basically we need to introduce extra points when the kind changes, so we get vertical lines in that case