Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java @ 8610:1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 24 Mar 2015 11:08:39 +0100 |
parents | 078b07a94023 |
children | 5f60bd7c4b42 |
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 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8169
diff
changeset
|
26 private static final Logger log = |
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
|
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) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8169
diff
changeset
|
36 log.info("BedDiffCalculation.calculate"); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
38 this.river = access.getRiverName(); |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
39 this.heightIds = access.extractHeightIds(context); |
8610
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
40 double from = access.getFrom(); |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
41 double to = access.getTo(); |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
42 double start; |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
43 double end; |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
44 |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
45 if ((!Double.isNaN(from) && !Double.isNaN(to)) && from > to) { |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
46 log.debug("Reordering range."); |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
47 start = to; |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
48 end = from; |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
49 } else { |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
50 start = from; |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
51 end = to; |
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
52 } |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
54 BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length]; |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
55 for (int i = 0; i < heightIds.length; i++) { |
8610
1f6b30310360
(issue1754) Allow ranges where start > end also for beddifferences.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8568
diff
changeset
|
56 BedHeightData [] pair = getHeightPair(heightIds[i], start, end); |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
57 if (pair[0].getYear() == null || pair[1].getYear() == null) { |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
58 addProblem("beddiff.missing.year"); |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
59 } |
8273
5c3b36b519d0
Add metadata to bedheight facets in bed height differences.
"Tom Gottfried <tom@intevation.de>"
parents:
8202
diff
changeset
|
60 results[i] = calculateYearDifference(pair, heightIds[i]); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 |
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
|
63 return new CalculationResult(results, this); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 |
6573
7d86ed4537d9
Cosmetics, doc, obsolete import removal.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6215
diff
changeset
|
66 /** Get two BedHeights from factory. */ |
8568
078b07a94023
Use updated class name instead of no more existant.
Tom Gottfried <tom@intevation.de>
parents:
8544
diff
changeset
|
67 private static BedHeightData [] getHeightPair(int [] ids, double from, double to) { |
078b07a94023
Use updated class name instead of no more existant.
Tom Gottfried <tom@intevation.de>
parents:
8544
diff
changeset
|
68 return new BedHeightData [] { |
078b07a94023
Use updated class name instead of no more existant.
Tom Gottfried <tom@intevation.de>
parents:
8544
diff
changeset
|
69 (BedHeightData)BedHeightFactory.getHeight("single", ids[0], from, to), |
078b07a94023
Use updated class name instead of no more existant.
Tom Gottfried <tom@intevation.de>
parents:
8544
diff
changeset
|
70 (BedHeightData)BedHeightFactory.getHeight("single", ids[1], from, to) |
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
|
71 }; |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
74 private BedDiffYearResult calculateYearDifference( |
8568
078b07a94023
Use updated class name instead of no more existant.
Tom Gottfried <tom@intevation.de>
parents:
8544
diff
changeset
|
75 BedHeightData[] pair, |
8273
5c3b36b519d0
Add metadata to bedheight facets in bed height differences.
"Tom Gottfried <tom@intevation.de>"
parents:
8202
diff
changeset
|
76 int[] ids |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
77 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8169
diff
changeset
|
78 log.debug("BedDiffCalculation.calculateYearDifference"); |
8568
078b07a94023
Use updated class name instead of no more existant.
Tom Gottfried <tom@intevation.de>
parents:
8544
diff
changeset
|
79 BedHeightData s1 = pair[0]; |
078b07a94023
Use updated class name instead of no more existant.
Tom Gottfried <tom@intevation.de>
parents:
8544
diff
changeset
|
80 BedHeightData s2 = 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
|
81 |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
82 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
|
83 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
|
84 |
8422
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
85 TDoubleArrayList diffRes = new TDoubleArrayList(size); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
86 TDoubleArrayList kms = new TDoubleArrayList(size); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
87 TDoubleArrayList soundings1 = new TDoubleArrayList(size); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
88 TDoubleArrayList soundings2 = new TDoubleArrayList(size); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
89 TDoubleArrayList absolute = new TDoubleArrayList(size); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
90 TDoubleArrayList gap1 = new TDoubleArrayList(size); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
91 TDoubleArrayList gap2 = new TDoubleArrayList(size); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
92 TDoubleArrayList heights1 = new TDoubleArrayList(size); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
93 TDoubleArrayList heights2 = 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
|
94 |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
95 Integer range = null; |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
96 if (s1.getYear() != null && s2.getYear() != null) { |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
97 range = Math.abs(s1.getYear() - s2.getYear()); |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
98 } |
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 |
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 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
|
101 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
|
102 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
|
103 double h2 = s2.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
|
104 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
|
105 |
073268a137d5
Bed height differences: Some refactoring of the calculation to improve readability and performance.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6089
diff
changeset
|
106 if (!Double.isNaN(hDiff)) { |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 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
|
108 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
|
109 |
8422
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
110 soundings1.add(s1.getSoundingWidth(station)); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
111 soundings2.add(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
|
112 |
8422
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
113 gap1.add(s1.getDataGap(station)); |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
114 gap2.add(s2.getDataGap(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
|
115 |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
116 if (range != null) { |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
117 absolute.add((hDiff / range) * 100d); |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
8151
diff
changeset
|
118 } |
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
|
119 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
|
120 heights2.add(h2); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 } |
3898
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
123 return new BedDiffYearResult( |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
124 kms, |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
125 diffRes, |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
126 heights1, |
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
127 heights2, |
8422
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
128 soundings1, |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
129 soundings2, |
3898
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
130 absolute, |
8422
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
131 gap1, |
96bf5135cd0e
Bedheight differences exports sounding width and data gap for minuend and subtrahend.
Raimund Renkert <rrenkert@intevation.de>
parents:
8420
diff
changeset
|
132 gap2, |
3898
95d699c769fb
Bedheight difference calculation has chart outpus now.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3887
diff
changeset
|
133 s1.getYear(), |
6089
0c3301fe23bd
towards issue1061: Store names of original BedHeights in the BedDiffYearResult.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
134 s2.getYear(), |
0c3301fe23bd
towards issue1061: Store names of original BedHeights in the BedDiffYearResult.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
135 s1.getName(), |
8273
5c3b36b519d0
Add metadata to bedheight facets in bed height differences.
"Tom Gottfried <tom@intevation.de>"
parents:
8202
diff
changeset
|
136 s2.getName(), |
5c3b36b519d0
Add metadata to bedheight facets in bed height differences.
"Tom Gottfried <tom@intevation.de>"
parents:
8202
diff
changeset
|
137 ids[0], |
5c3b36b519d0
Add metadata to bedheight facets in bed height differences.
"Tom Gottfried <tom@intevation.de>"
parents:
8202
diff
changeset
|
138 ids[1]); |
3887
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 } |
a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
140 } |
6948
d4108d6c4000
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6573
diff
changeset
|
141 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |