annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation6.java @ 6064:9e84e323bdf6

Fixed i18n key
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 23 May 2013 05:42:07 +0200
parents af13ceeba52a
children 20a32dbdbb59
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: 5962
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: 5962
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 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5339
diff changeset
9 package org.dive4elements.river.artifacts.model;
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
11 import java.util.ArrayList;
4241
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
12 import java.util.Arrays;
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
13 import java.util.Date;
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
14 import java.util.HashMap;
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
15 import java.util.List;
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
16 import java.util.Map;
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
17
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import org.apache.log4j.Logger;
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5339
diff changeset
20 import org.dive4elements.river.model.DischargeTable;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5339
diff changeset
21 import org.dive4elements.river.model.Gauge;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5339
diff changeset
22 import org.dive4elements.river.model.TimeInterval;
2219
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
23
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
24 import org.dive4elements.river.artifacts.access.HistoricalDischargeAccess;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
25 import org.dive4elements.river.artifacts.access.HistoricalDischargeAccess.EvaluationMode;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
26
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 /**
5339
1b73b731f7bd Doc, debug fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4281
diff changeset
29 * Historical Discharge Calculation.
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 */
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 public class Calculation6 extends Calculation {
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
34 private static final Logger log = Logger.getLogger(Calculation6.class);
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
36 private int mode;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
37 private long [] timerange;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
38 private double [] values;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
39 private Long officialGaugeNumber;
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
2219
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
41
4136
b6ba9bbb5122 #548 Fetch historical discharge table values with SCALE=1.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3452
diff changeset
42 public static final double SCALE = 1d;
2230
59af81364eb1 Improved the 'historical discharge' calculation: implemented findValueForW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2228
diff changeset
43
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
44 public Calculation6(HistoricalDischargeAccess access) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
45 EvaluationMode mode = access.getEvaluationMode();
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
46 Timerange tr = access.getEvaluationTimerange();
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
47 double [] vs = mode != null && mode == EvaluationMode.W
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
48 ? access.getWs()
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
49 : access.getQs();
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
50
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
51 Long officialGaugeNumber = access.getOfficialGaugeNumber();
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
52
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
53 if (mode == null) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
54 // TODO: i18n
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
55 addProblem("hist.discharge.mode.not.set");
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
56 }
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
57 if (tr == null) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
58 // TODO: i18n
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
59 addProblem("hist.discharge.time.interval.not.set");
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
60 }
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
61 if (vs == null || vs.length == 0) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
62 // TODO: i18n
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
63 addProblem("hist.discharge.values.not.set");
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
64 }
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
65
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
66 if (officialGaugeNumber == null) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
67 // TODO: i18n
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
68 addProblem("hist.discharge.reference.gauge.not.set");
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
69 }
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
70
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
71 if (!hasProblems()) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
72 set(
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5962
diff changeset
73 mode.getMode(),
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
74 new long [] { tr.getStart(), tr.getEnd()},
5918
46e85199b667 Historical discharge curve: Fixed NPE in setup.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5914
diff changeset
75 vs,
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
76 officialGaugeNumber);
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
77 }
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
78 }
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
79
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
80 protected void set(
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
81 int mode,
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
82 long [] timerange,
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
83 double [] values,
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
84 Long officialGaugeNumber
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
85 ) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
86 this.mode = mode;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
87 this.timerange = timerange;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
88 this.values = values;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
89 this.officialGaugeNumber = officialGaugeNumber;
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
90 }
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
91
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
92 protected CalculationResult error(String msg) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
93 addProblem(msg);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
94 return new CalculationResult(new HistoricalDischargeData(), this);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
95 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
96
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
97 public CalculationResult calculate() {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
98 if (hasProblems()) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
99 log.warn("Parameters not valid for calculation.");
2219
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
100 return null;
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
101 }
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
102
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
103 Gauge gauge = Gauge.getGaugeByOfficialNumber(officialGaugeNumber);
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
104 if (gauge == null) {
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
105 // TODO: i18n
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
106 return error("hist.discharge.gauge.not.found");
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
107 }
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
108
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
109 if (log.isDebugEnabled()) {
2219
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
110 debug();
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
111 }
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
112
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
113 List<DischargeTable> dts = fetchDischargeTables(gauge);
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
114 if (dts.isEmpty()) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
115 return error("cannot.find.hist.q.tables");
2304
abb390101595 #483 Display error message in calculation report for empty historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2250
diff changeset
116 }
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
117
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
118 DischargeTable refTable = fetchReferenceTable(dts);
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
119
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
120 boolean debug = log.isDebugEnabled();
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
121
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
122 if (debug) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
123 log.debug("Take " + dts.size() + " into account.");
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
124 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
125
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
126 ValuesCache vc = new ValuesCache();
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
127
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
128 WQTimerange [] wqt = prepareData(refTable, dts, vc);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
129 WQKms [] wqs = prepareWQData(dts, vc);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
130
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
131 if (debug) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
132 log.debug("Number of calculation results: " + wqt.length);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
133 }
2250
40608c82e9cb Bugfix: create a report facet for historical discharge curves even if no data has been computed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2244
diff changeset
134
4241
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
135 return new CalculationResult(new HistoricalDischargeData(wqt, wqs),
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
136 this);
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137 }
2219
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
138
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
139 /** The youngest discharge table of the selected set is the reference */
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
140 protected DischargeTable fetchReferenceTable(List<DischargeTable> dts) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
141 DischargeTable ref = null;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
142 long now = System.currentTimeMillis();
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
143 for (DischargeTable dt: dts) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
144 if (ref == null) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
145 ref = dt;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
146 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
147 else {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
148 TimeInterval cti = dt.getTimeInterval();
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
149 TimeInterval rti = ref.getTimeInterval();
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
150
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
151 long ct = cti.getStopTime() != null
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
152 ? cti.getStopTime().getTime()
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
153 : now;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
154 long rt = rti.getStopTime() != null
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
155 ? rti.getStopTime().getTime()
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
156 : now;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
157
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
158 if (ct > rt) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
159 ref = dt;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
160 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
161
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
162 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
163 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
164 return ref;
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
165 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
166
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
167 protected List<DischargeTable> fetchDischargeTables(Gauge gauge) {
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
168
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
169 List<DischargeTable> all = gauge.getDischargeTables();
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
170 List<DischargeTable> relevant = new ArrayList<DischargeTable>(all.size());
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
171
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
172 for (DischargeTable dt: all) {
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
173 if (isDischargeTableRelevant(dt)) {
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
174 relevant.add(dt);
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
175 }
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
176 }
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
177
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
178 return relevant;
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
179 }
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
180
5339
1b73b731f7bd Doc, debug fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4281
diff changeset
181 /** True if timerange of given discharge table overlaps with timerange. */
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
182 protected boolean isDischargeTableRelevant(DischargeTable dt) {
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
183
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
184 TimeInterval ti = dt.getTimeInterval();
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
185
2598
e96bf6c47c12 Improved selecting discharge tables for historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2418
diff changeset
186 if (dt.getKind() == Gauge.MASTER_DISCHARGE_TABLE || ti == null) {
2315
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
187 return false;
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
188 }
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
189
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
190 long dtStart = ti.getStartTime().getTime();
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
191 long dtStop = ti.getStopTime() != null
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
192 ? ti.getStopTime().getTime()
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
193 : System.currentTimeMillis();
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
194
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
195 return !(timerange[1] < dtStart || timerange[0] > dtStop);
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
196 }
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
197
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
198 protected WQKms[] prepareWQData(List<DischargeTable> dts, ValuesCache vc) {
4241
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
199 WQKms[] wqs = new WQKms[dts.size()];
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
200
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
201 for (int i = 0, N = wqs.length; i < N; ++i) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
202 DischargeTable dt = dts.get(i);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
203 wqs[i] = prepareWQ(dt, vc.getValues(dts.get(i)));
4241
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
204 }
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
205
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
206 return wqs;
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
207 }
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
208
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
209 protected WQKms prepareWQ(DischargeTable dt, double[][] values) {
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
210 double km = dt.getGauge().getStation().doubleValue();
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
211
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
212 double[] kms = new double[values[0].length];
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
213 Arrays.fill(kms, km);
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
214
4281
7b6c31390427 Fixed interchanged Ws and Qs in Historical Discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4241
diff changeset
215 return new HistoricalWQKms(kms, values[0], values[1],
4241
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
216 String.valueOf(km), dt.getTimeInterval());
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
217 }
49cb65d5932d Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4232
diff changeset
218
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
219 protected String name(double value) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
220 return mode == EvaluationMode.W.getMode()
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
221 ? "W=" + value
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
222 : "Q=" + value;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
223 }
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
224
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
225 /** With reference. */
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
226 protected HistoricalWQTimerange[] prepareData(
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
227 DischargeTable refTable,
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
228 List<DischargeTable> dts,
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
229 ValuesCache vc
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
230 ) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
231 List<HistoricalWQTimerange> wqts =
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
232 new ArrayList<HistoricalWQTimerange>(values.length);
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
233
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
234 boolean debug = log.isDebugEnabled();
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
235
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
236 for (double value: values) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
237 if (debug) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
238 log.debug("Prepare data plus diff for value: " + value);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
239 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
240
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
241 double ref = mode == EvaluationMode.W.getMode()
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
242 ? vc.findValueForW(refTable, value)
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
243 : vc.findValueForQ(refTable, value);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
244
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
245 if (Double.isNaN(ref)) {
6064
9e84e323bdf6 Fixed i18n key
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
246 addProblem("hist.discharge.no.value.in.ref", value);
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
247 continue;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
248 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
249
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
250 String name = name(value);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
251 HistoricalWQTimerange wqt = null;
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
252
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
253 for (DischargeTable dt : dts) {
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
254 Date[] ti = prepareTimeInterval(dt);
2315
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
255 Timerange t = new Timerange(ti[0], ti[1]);
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
256 double w;
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
257 double q;
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
258 double diff;
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
259
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
260 if (mode == EvaluationMode.W.getMode()) {
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
261 q = vc.findValueForW(dt, w = value);
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
262
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
263 if (Double.isNaN(q)) {
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
264 log.warn("Cannot find Q for W: " + w);
2315
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
265 addProblem("cannot.find.hist.q.for.w", w, ti[0], ti[1]);
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
266 continue;
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
267 }
2315
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
268
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
269 diff = ref - q;
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
270 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
271 else {
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
272 w = vc.findValueForQ(dt, q = value);
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
273
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
274 if (Double.isNaN(w)) {
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
275 log.warn("Cannot find W for Q: " + q);
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
276 addProblem("cannot.find.hist.w.for.q", q, ti[0], ti[1]);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
277 continue;
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
278 }
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
279 diff = ref - w;
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
280 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
281
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
282 if (debug) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
283 log.debug("Q=" + q + " | W=" + w + " | Ref = " + ref);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
284 }
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
285
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
286 if (wqt == null) {
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
287 wqt = new HistoricalWQTimerange(name);
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
288 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
289
2315
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
290 wqt.add(w, q, diff, t);
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
291 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
292
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
293 if (wqt != null) {
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
294 wqts.add(wqt);
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
295 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
296 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
297
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
298 return (HistoricalWQTimerange[])wqts.toArray(
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
299 new HistoricalWQTimerange[wqts.size()]);
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
300 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2304
diff changeset
301
5339
1b73b731f7bd Doc, debug fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4281
diff changeset
302 /** Returns discharge table interval as Date[]. */
2315
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
303 protected Date[] prepareTimeInterval(DischargeTable dt) {
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
304 TimeInterval ti = dt.getTimeInterval();
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
305
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
306 Date start = ti.getStartTime();
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4138
diff changeset
307 Date end = ti.getStopTime();
2315
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
308
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
309 if (end == null) {
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
310 log.warn("TimeInterval has no stop time set!");
2315
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
311
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
312 end = new Date();
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
313 }
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
314
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
315 return new Date[] { start, end };
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
316 }
c0dfa36add96 Some bugfixes and improvements in the calculation of historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
317
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
318
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
319 /** Helper to avoid redundant loading of discharge table values. */
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
320 private static final class ValuesCache {
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
321
5962
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
322 private Map<Integer, double[][]> cache;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
323
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
324 ValuesCache() {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
325 cache = new HashMap<Integer, double [][]>();
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
326 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
327
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
328 double [][] getValues(DischargeTable dt) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
329 Integer id = dt.getId();
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
330 double [][] vs = cache.get(id);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
331 if (vs == null) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
332 vs = DischargeTables.loadDischargeTableValues(
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
333 dt, DischargeTables.HISTORICAL_SCALE);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
334 cache.put(id, vs);
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
335 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
336 return vs;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
337 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
338
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
339 private static double firstOrNaN(double [] vs) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
340 return vs.length > 0 ? vs[0] : Double.NaN;
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
341 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
342
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
343 double findValueForW(DischargeTable dt, double w) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
344 return firstOrNaN(DischargeTables.getQsForW(getValues(dt), w));
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
345 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
346
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
347 double findValueForQ(DischargeTable dt, double q) {
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
348 return firstOrNaN(DischargeTables.getWsForQ(getValues(dt), q));
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
349 }
d861efa13272 Partial rewrite of historical discharge curves. Needs testing.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5959
diff changeset
350 } // class ValuesCache
2228
4db19a88bddb Implemented the first step of Calculation6; create Facets for each calculation results.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2219
diff changeset
351
2219
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
352 /**
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
353 * Writes the parameters used for this calculation to log.
2219
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
354 */
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
355 public void debug() {
5914
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
356 log.debug("========== Calculation6 ==========");
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
357 log.debug(" Mode: " + mode);
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
358 log.debug(" Timerange: " + timerange[0] + " - " + timerange[1]);
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
359 log.debug(" Input values: " + Arrays.toString(values));
1058b3436dad D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
360 log.debug("==================================");
2219
4b6e9b377a84 Fetch parameters for 'historical discharge curve' calculation; call Calculation6 with those information and check input parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2215
diff changeset
361 }
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
362 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
363 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org