Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/AnalysisPeriod.java @ 4357:11cf29eb002c
FacetTypes: New type: exreme_wq_curve_base (for the Stuetz-Q-Poits).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 02 Nov 2012 11:58:11 +0100 |
parents | ae14f412ba10 |
children |
rev | line source |
---|---|
3005
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model.fixings; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
3210
ae14f412ba10
SQ: finished the access stuff.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3145
diff
changeset
|
3 import de.intevation.flys.artifacts.model.DateRange; |
ae14f412ba10
SQ: finished the access stuff.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3145
diff
changeset
|
4 |
3005
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.io.Serializable; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 public class AnalysisPeriod |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 implements Serializable |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 protected DateRange dateRange; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 protected QWD [] qwds; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 protected QWD [] qSectorAverages; |
3145
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
13 protected double [] qSectorStdDevs; |
3005
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 public AnalysisPeriod() { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 public AnalysisPeriod(DateRange dateRange) { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 this.dateRange = dateRange; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 public AnalysisPeriod(DateRange dateRange, QWD [] qwds) { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 this(dateRange); |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 this.dateRange = dateRange; |
3145
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
25 this.qwds = qwds; |
3005
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 public AnalysisPeriod( |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 DateRange dateRange, |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 QWD [] qwds, |
3145
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
31 QWD [] qSectorAverages, |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
32 double [] qSectorStdDevs |
3005
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 ) { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 this(dateRange, qwds); |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 this.qSectorAverages = qSectorAverages; |
3145
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
36 this.qSectorStdDevs = qSectorStdDevs; |
3005
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 public DateRange getDateRange() { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 return dateRange; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 public void setDateRange(DateRange dateRange) { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 this.dateRange = dateRange; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 public QWD [] getQWDs() { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 return qwds; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 public void setQWDs(QWD [] qwds) { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 this.qwds = qwds; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 public QWD [] getQSectorAverages() { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 return qSectorAverages; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 public void setQSectorAverages(QWD [] qSectorAverages) { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 this.qSectorAverages = qSectorAverages; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 public QWD getQSectorAverage(int i) { |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 return qSectorAverages[i]; |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 } |
3065
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
66 |
3145
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
67 public double [] getQSectorStdDevs() { |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
68 return qSectorStdDevs; |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
69 } |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
70 |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
71 public void setQSectorStdDevs(double [] qSectorStdDevs) { |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
72 this.qSectorStdDevs = qSectorStdDevs; |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
73 } |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
74 |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
75 public double getQSectorStdDev(int i) { |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
76 return qSectorStdDevs[i]; |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
77 } |
be612065993e
FixA: Calculate the standard deviation of the Q sector delta Ws, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3092
diff
changeset
|
78 |
3065
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
79 public double getMaxQ() { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
80 double maxQ = -Double.MAX_VALUE; |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
81 if (qwds != null) { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
82 for (QWD qwd: qwds) { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
83 if (qwd.getQ() > maxQ) { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
84 maxQ = qwd.getQ(); |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
85 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
86 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
87 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
88 if (qSectorAverages != null) { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
89 for (QWD qwd: qSectorAverages) { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
90 if (qwd != null && qwd.getQ() > maxQ) { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
91 maxQ = qwd.getQ(); |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
92 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
93 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
94 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
95 return maxQ; |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3005
diff
changeset
|
96 } |
3005
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 } |
9aa1d770da4a
Fix: Better model for storing results of the delta W/t calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |