comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthCalculationResult.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
comparison
equal deleted inserted replaced
8939:2970368ae1e3 8940:82998242ba84
12 import java.util.Collection; 12 import java.util.Collection;
13 13
14 import org.dive4elements.river.artifacts.sinfo.common.AbstractSInfoCalculationResult; 14 import org.dive4elements.river.artifacts.sinfo.common.AbstractSInfoCalculationResult;
15 import org.dive4elements.river.artifacts.sinfo.util.BedHeightInfo; 15 import org.dive4elements.river.artifacts.sinfo.util.BedHeightInfo;
16 import org.dive4elements.river.artifacts.sinfo.util.WstInfo; 16 import org.dive4elements.river.artifacts.sinfo.util.WstInfo;
17
18 import gnu.trove.TDoubleArrayList;
19 17
20 /** 18 /**
21 * Contains the results of a {@link FlowDepthCalculation}. 19 * Contains the results of a {@link FlowDepthCalculation}.
22 * 20 *
23 * @author Gernot Belger 21 * @author Gernot Belger
36 } 34 }
37 35
38 public BedHeightInfo getSounding() { 36 public BedHeightInfo getSounding() {
39 return this.sounding; 37 return this.sounding;
40 } 38 }
41
42 public double[][] getFlowDepthPoints() {
43
44 final Collection<FlowDepthRow> rows = getRows();
45
46 final TDoubleArrayList xPoints = new TDoubleArrayList(rows.size());
47 final TDoubleArrayList yPoints = new TDoubleArrayList(rows.size());
48
49 for (final FlowDepthRow row : rows) {
50 xPoints.add(row.getStation());
51 yPoints.add(row.getFlowDepth());
52 }
53
54 return new double[][] { xPoints.toNativeArray(), yPoints.toNativeArray() };
55 }
56
57 public double[][] getFlowDepthTkhPoints() {
58
59 final Collection<FlowDepthRow> rows = getRows();
60
61 final TDoubleArrayList xPoints = new TDoubleArrayList(rows.size());
62 final TDoubleArrayList yPoints = new TDoubleArrayList(rows.size());
63
64 for (final FlowDepthRow row : rows) {
65 xPoints.add(row.getStation());
66 yPoints.add(row.getFlowDepthWithTkh());
67 }
68
69 return new double[][] { xPoints.toNativeArray(), yPoints.toNativeArray() };
70 }
71 } 39 }

http://dive4elements.wald.intevation.org