Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/BedHeightsFinder.java @ 9394:439699ff9b2d
Added U-Info iota (prev. salix) calculation for historical scenario
author | mschaefer |
---|---|
date | Fri, 10 Aug 2018 17:31:46 +0200 |
parents | 45f1ad66560e |
children | ecadc9ed0ba0 |
comparison
equal
deleted
inserted
replaced
9393:6174daaf5e56 | 9394:439699ff9b2d |
---|---|
100 /** | 100 /** |
101 * Creates a {@link BedHeightsFinder} for a dataset from the database, specified by its id. | 101 * Creates a {@link BedHeightsFinder} for a dataset from the database, specified by its id. |
102 * | 102 * |
103 * @return <code>null</code> if no bed height with the given id exists. | 103 * @return <code>null</code> if no bed height with the given id exists. |
104 */ | 104 */ |
105 private static BedHeightsFinder forId(final Calculation problems, final int id, final DoubleRange range) { | 105 public static BedHeightsFinder forId(final Calculation problems, final int id, final DoubleRange range) { |
106 | 106 |
107 final BedHeight bedHeight = BedHeight.getBedHeightById(id); | 107 final BedHeight bedHeight = BedHeight.getBedHeightById(id); |
108 if (bedHeight == null) | 108 if (bedHeight == null) |
109 return null; | 109 return null; |
110 | 110 |
151 | 151 |
152 public Collection<Double> getStations() { | 152 public Collection<Double> getStations() { |
153 return this.values.keySet(); | 153 return this.values.keySet(); |
154 } | 154 } |
155 | 155 |
156 public DoubleRange getKmRange() { | |
157 if (this.values.isEmpty()) | |
158 return null; | |
159 return new DoubleRange(this.values.firstKey().doubleValue(), this.values.lastKey().doubleValue()); | |
160 } | |
161 | |
156 public double getMeanBedHeight(final double km) { | 162 public double getMeanBedHeight(final double km) { |
157 return interpolateBedHeights(km, BedHeightValueType.value); | 163 return interpolateBedHeights(km, BedHeightValueType.value); |
158 } | 164 } |
159 | 165 |
160 public double getMinBedHeight(final double km) { | 166 public double getMinBedHeight(final double km) { |