Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation2.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | 898afcce1d0a |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
18 | 18 |
19 /** ComputedDischargeCurve. */ | 19 /** ComputedDischargeCurve. */ |
20 public class Calculation2 | 20 public class Calculation2 |
21 extends Calculation | 21 extends Calculation |
22 { | 22 { |
23 private static Logger logger = Logger.getLogger(Calculation2.class); | 23 private static Logger log = Logger.getLogger(Calculation2.class); |
24 | 24 |
25 protected double km; | 25 protected double km; |
26 | 26 |
27 public Calculation2() { | 27 public Calculation2() { |
28 } | 28 } |
49 } | 49 } |
50 | 50 |
51 pw.flush(); | 51 pw.flush(); |
52 } | 52 } |
53 catch (IOException ioe) { | 53 catch (IOException ioe) { |
54 logger.error(ioe); | 54 log.error(ioe); |
55 } | 55 } |
56 finally { | 56 finally { |
57 if (pw != null) { | 57 if (pw != null) { |
58 pw.close(); | 58 pw.close(); |
59 } | 59 } |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 public CalculationResult calculate(WstValueTable wst) { | 63 public CalculationResult calculate(WstValueTable wst) { |
64 | 64 |
65 boolean debug = logger.isDebugEnabled(); | 65 boolean debug = log.isDebugEnabled(); |
66 | 66 |
67 if (debug) { | 67 if (debug) { |
68 logger.debug("Calculation2.calculate: km " + km); | 68 log.debug("Calculation2.calculate: km " + km); |
69 } | 69 } |
70 | 70 |
71 double [][] wqs = wst.interpolateWQ(km, this); | 71 double [][] wqs = wst.interpolateWQ(km, this); |
72 | 72 |
73 if (debug) { | 73 if (debug) { |
74 if (hasProblems()) { | 74 if (hasProblems()) { |
75 logger.debug("problems: " + problemsToString()); | 75 log.debug("problems: " + problemsToString()); |
76 } | 76 } |
77 logger.debug("wqs: " + wqs); | 77 log.debug("wqs: " + wqs); |
78 if (wqs != null && wqs[0] != null) { | 78 if (wqs != null && wqs[0] != null) { |
79 logger.debug("wqs length: " + wqs[0].length); | 79 log.debug("wqs length: " + wqs[0].length); |
80 // TODO: Uncomment to see the data externally. | 80 // TODO: Uncomment to see the data externally. |
81 //dump(wqs); | 81 //dump(wqs); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
94 Arrays.fill(kms, km); | 94 Arrays.fill(kms, km); |
95 | 95 |
96 WQKms wqkms = new WQKms(kms, qs, ws, String.valueOf(km)); | 96 WQKms wqkms = new WQKms(kms, qs, ws, String.valueOf(km)); |
97 | 97 |
98 if (hasProblems()) { | 98 if (hasProblems()) { |
99 logger.debug("found " + numProblems() + " problems."); | 99 log.debug("found " + numProblems() + " problems."); |
100 wqkms.removeNaNs(); | 100 wqkms.removeNaNs(); |
101 } | 101 } |
102 | 102 |
103 return new CalculationResult(new WQKms[] { wqkms }, this); | 103 return new CalculationResult(new WQKms[] { wqkms }, this); |
104 } | 104 } |