comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java @ 9492:10530f1d7dd5

Meilenstein-2-Rücklauf Punkt 2.2.4 Angabe des Bezugspegels
author gernotbelger
date Thu, 20 Sep 2018 14:00:30 +0200
parents 8562c60371b8
children 853f2dafc16e
comparison
equal deleted inserted replaced
9491:d7d22ea8573d 9492:10530f1d7dd5
64 } 64 }
65 65
66 /** 66 /**
67 * Calculate the infrastructures flood duration result rows 67 * Calculate the infrastructures flood duration result rows
68 */ 68 */
69 public void execute(final Calculation problems, final String label, final DoubleRange calcRange, final RiversideChoiceKey riverside, 69 public void execute(final Calculation problems, final String label, final DoubleRange calcRange, final RiversideChoiceKey riverside, final boolean withWspl,
70 final boolean withWspl, final WINFOArtifact winfo, final FloodDurationCalculationResults results) { 70 final WINFOArtifact winfo, final FloodDurationCalculationResults results) {
71 71
72 // Find all gauges of the calc range, and create the duration finders 72 // Find all gauges of the calc range, and create the duration finders
73 final Map<Gauge, GaugeDurationValuesFinder> durFinders = new HashMap<>(); 73 final Map<Gauge, GaugeDurationValuesFinder> durFinders = new HashMap<>();
74 for (final Gauge gauge : this.riverInfoProvider.getRiver().determineGauges(calcRange.getMinimumDouble(), calcRange.getMaximumDouble())) { 74 for (final Gauge gauge : this.riverInfoProvider.getRiver().determineGauges(calcRange.getMinimumDouble(), calcRange.getMaximumDouble())) {
75 durFinders.put(gauge, GaugeDurationValuesFinder.loadValues(gauge, problems)); 75 durFinders.put(gauge, GaugeDurationValuesFinder.loadValues(gauge, problems));
119 // Get the labels of the selected waterlevels 119 // Get the labels of the selected waterlevels
120 final String[] wstLabels = new String[wqkmsArray.length]; 120 final String[] wstLabels = new String[wqkmsArray.length];
121 for (int i = 0; i <= wqkmsArray.length - 1; i++) 121 for (int i = 0; i <= wqkmsArray.length - 1; i++)
122 wstLabels[i] = wqkmsArray[i].getName(); 122 wstLabels[i] = wqkmsArray[i].getName();
123 123
124 results.addResult(new FloodDurationCalculationResult(label, wstLabels, this.rows), problems); 124 results.addResult(new FloodDurationCalculationResult(label, wstLabels, this.rows, withWspl), problems);
125 } 125 }
126 126
127 /** 127 /**
128 * Calculates the duration curve for a station 128 * Calculates the duration curve for a station
129 * (other than the version 3.2.1 W-Info Dauerlinie the wst column positions 129 * (other than the version 3.2.1 W-Info Dauerlinie the wst column positions
143 odays[j] = 365 - udays[i]; 143 odays[j] = 365 - udays[i];
144 final QPosition qpos = wst.getQPosition(gauge.getStation().doubleValue(), qs[i]); 144 final QPosition qpos = wst.getQPosition(gauge.getStation().doubleValue(), qs[i]);
145 if (qpos != null) { 145 if (qpos != null) {
146 ows[j] = wst.interpolateW(station, qpos, problems); 146 ows[j] = wst.interpolateW(station, qpos, problems);
147 oqs[j] = wst.getQ(qpos, station); 147 oqs[j] = wst.getQ(qpos, station);
148 } 148 } else {
149 else {
150 ows[j] = Double.NaN; 149 ows[j] = Double.NaN;
151 oqs[j] = qs[i]; 150 oqs[j] = qs[i];
152 } 151 }
153 } 152 }
154 return new WQDay(odays, ows, oqs); 153 return new WQDay(odays, ows, oqs);

http://dive4elements.wald.intevation.org