Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java @ 8098:09725b65955a
Add new and simplyfied SedimentLoadFacet
The SedimentLoadFacet is intended to work with the Measurement stations.
It uses the same mechanismn to access the Mesurement station values
as the calculation does.
SedimentLoadLS values need a different facet that will come soon.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 15 Aug 2014 18:27:19 +0200 |
parents | b5cba2690347 |
children | a709e6334c4a |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3898
diff
changeset
|
8 package org.dive4elements.river.artifacts.model.minfo; |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 import gnu.trove.TDoubleArrayList; |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 import org.apache.log4j.Logger; |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 |
6148
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
14 import org.dive4elements.artifacts.CallContext; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3898
diff
changeset
|
15 import org.dive4elements.river.artifacts.access.BedDifferencesAccess; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3898
diff
changeset
|
16 import org.dive4elements.river.artifacts.model.Calculation; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3898
diff
changeset
|
17 import org.dive4elements.river.artifacts.model.CalculationResult; |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 |
6573
7d86ed4537d9
Cosmetics, doc, obsolete import removal.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6215
diff
changeset
|
19 /** |
7d86ed4537d9
Cosmetics, doc, obsolete import removal.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6215
diff
changeset
|
20 * Perform calculation of differences of bed height (german Sohlhoehe). |
7d86ed4537d9
Cosmetics, doc, obsolete import removal.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6215
diff
changeset
|
21 * The input are either single year data or epochs. |
7d86ed4537d9
Cosmetics, doc, obsolete import removal.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6215
diff
changeset
|
22 */ |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 public class BedDiffCalculation |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 extends Calculation |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 { |
6148
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
26 private static final Logger logger = |
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
27 Logger.getLogger(BedDiffCalculation.class); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 |
6148
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
29 protected String river; |
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
30 protected int [][] heightIds; |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 public BedDiffCalculation() { |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 |
6148
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
35 public CalculationResult calculate(BedDifferencesAccess access, CallContext context) { |
3898
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
36 logger.info("BedDiffCalculation.calculate"); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 |
7261
a56fe3bc6700
Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6948
diff
changeset
|
38 String river = access.getRiverName(); |
6148
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
39 int [][] heightIds = access.extractHeightIds(context); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 if (river == null) { |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 // TODO: i18n |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 addProblem("minfo.missing.river"); |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 if (!hasProblems()) { |
6148
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
47 this.river = river; |
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
48 this.heightIds = heightIds; |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 return internalCalculate(); |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 return new CalculationResult(); |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 private CalculationResult internalCalculate() { |
6215
0f5cacdd60a9
I999: Epochs and single years are handled in the same way in difference calc.
Raimund Renkert <rrenkert@intevation.de>
parents:
6148
diff
changeset
|
56 BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length]; |
3898
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
57 |
6215
0f5cacdd60a9
I999: Epochs and single years are handled in the same way in difference calc.
Raimund Renkert <rrenkert@intevation.de>
parents:
6148
diff
changeset
|
58 for (int i = 0; i < heightIds.length; i++) { |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7370
diff
changeset
|
59 BedHeightData [] pair = getHeightPair(heightIds[i], "single"); |
6215
0f5cacdd60a9
I999: Epochs and single years are handled in the same way in difference calc.
Raimund Renkert <rrenkert@intevation.de>
parents:
6148
diff
changeset
|
60 results[i] = calculateYearDifference(pair); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 } |
6215
0f5cacdd60a9
I999: Epochs and single years are handled in the same way in difference calc.
Raimund Renkert <rrenkert@intevation.de>
parents:
6148
diff
changeset
|
62 return new CalculationResult(results, this); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 |
6573
7d86ed4537d9
Cosmetics, doc, obsolete import removal.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6215
diff
changeset
|
65 /** Get two BedHeights from factory. */ |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7370
diff
changeset
|
66 private static BedHeightData [] getHeightPair(int [] ids, String type) { |
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7370
diff
changeset
|
67 return new BedHeightData [] { |
6148
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
68 BedHeightFactory.getHeight(type, ids[0], 0), |
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
69 BedHeightFactory.getHeight(type, ids[1], 0) |
b12ec9f240bc
Bed height differences: DO NOT STORE ARTIFACTS IN CALCULATION RESULTS!!! This would lead to caching them which is _really_ wrong.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6147
diff
changeset
|
70 }; |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7370
diff
changeset
|
73 private BedDiffYearResult calculateYearDifference(BedHeightData[] pair) { |
7370
4eccd72595ee
White space cosmetics, added debug output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7261
diff
changeset
|
74 logger.debug("BedDiffCalculation.calculateYearDifference"); |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7370
diff
changeset
|
75 BedHeightSingleData s1 = (BedHeightSingleData) pair[0]; |
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7370
diff
changeset
|
76 BedHeightSingleData s2 = (BedHeightSingleData) pair[1]; |
6147
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
77 |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
78 TDoubleArrayList stations = s1.getStations(); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
79 int size = stations.size(); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
80 |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
81 TDoubleArrayList diffRes = new TDoubleArrayList(size); |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
82 TDoubleArrayList kms = new TDoubleArrayList(size); |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
83 TDoubleArrayList soundings = new TDoubleArrayList(size); |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
84 TDoubleArrayList absolute = new TDoubleArrayList(size); |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
85 TDoubleArrayList gap = new TDoubleArrayList(size); |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
86 TDoubleArrayList heights1 = new TDoubleArrayList(size); |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
87 TDoubleArrayList heights2 = new TDoubleArrayList(size); |
7829
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
88 TDoubleArrayList morphs1 = new TDoubleArrayList(size); |
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
89 TDoubleArrayList morphs2 = new TDoubleArrayList(size); |
6147
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
90 |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
91 int range = Math.abs(s1.getYear() - s2.getYear()); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
92 |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
93 for (int i = 0; i < size; i++) { |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
94 double station = stations.getQuick(i); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
95 double h1 = s1.getHeight(station); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
96 double h2 = s2.getHeight(station); |
7829
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
97 double m1 = s1.getWidth(station); |
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
98 double m2 = s2.getWidth(station); |
6147
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
99 double hDiff = h1 - h2; |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
100 |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
101 if (!Double.isNaN(hDiff)) { |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 diffRes.add(hDiff); |
6147
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
103 kms.add(station); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
104 |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
105 soundings.add(Math.max( |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
106 s1.getSoundingWidth(station), |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
107 s2.getSoundingWidth(station))); |
6147
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
108 |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
109 gap.add(Math.max( |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
110 s1.getDataGap(station), |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
111 s2.getDataGap(station))); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
112 |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
113 absolute.add((hDiff / range) * 100d); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
114 heights1.add(h1); |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
115 heights2.add(h2); |
7829
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
116 morphs1.add(m1); |
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
117 morphs2.add(m2); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
118 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 } |
3898
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
120 return new BedDiffYearResult( |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
121 kms, |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
122 diffRes, |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
123 heights1, |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
124 heights2, |
7829
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
125 morphs1, |
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
126 morphs2, |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7392
diff
changeset
|
127 soundings, |
3898
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
128 absolute, |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
129 gap, |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
130 s1.getYear(), |
6089
0c3301fe23bd
towards issue1061: Store names of original BedHeights in the BedDiffYearResult.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
131 s2.getYear(), |
0c3301fe23bd
towards issue1061: Store names of original BedHeights in the BedDiffYearResult.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
132 s1.getName(), |
0c3301fe23bd
towards issue1061: Store names of original BedHeights in the BedDiffYearResult.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
133 s2.getName()); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 } |
6948
d4108d6c4000
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6573
diff
changeset
|
136 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |