Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixWQCurveFacet.java @ 3091:179e38aa678d
Some fixing charts are generated now
flys-artifacts/trunk@4690 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Mon, 18 Jun 2012 13:29:15 +0000 |
parents | 960307cf2adc |
children | cd309f8597f6 |
comparison
equal
deleted
inserted
replaced
3090:22def36d37b7 | 3091:179e38aa678d |
---|---|
11 | 11 |
12 import de.intevation.flys.artifacts.model.CalculationResult; | 12 import de.intevation.flys.artifacts.model.CalculationResult; |
13 import de.intevation.flys.artifacts.model.DataFacet; | 13 import de.intevation.flys.artifacts.model.DataFacet; |
14 import de.intevation.flys.artifacts.model.FacetTypes; | 14 import de.intevation.flys.artifacts.model.FacetTypes; |
15 import de.intevation.flys.artifacts.model.Parameters; | 15 import de.intevation.flys.artifacts.model.Parameters; |
16 | |
17 import de.intevation.flys.artifacts.model.fixings.FixFacetUtils; | |
16 | 18 |
17 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; | 19 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; |
18 | 20 |
19 import org.apache.log4j.Logger; | 21 import org.apache.log4j.Logger; |
20 | 22 |
88 } | 90 } |
89 | 91 |
90 de.intevation.flys.artifacts.math.Function mf = | 92 de.intevation.flys.artifacts.math.Function mf = |
91 ff.instantiate(coeffs); | 93 ff.instantiate(coeffs); |
92 | 94 |
93 double maxQ = getMaxQ(params, currentKm); | 95 double maxQ = FixFacetUtils.getMaxQ(params, currentKm); |
94 | |
95 logger.debug("getData: maxQ = " + maxQ); | 96 logger.debug("getData: maxQ = " + maxQ); |
96 | 97 |
97 FixFunction fix = new FixFunction( | 98 FixFunction fix = new FixFunction( |
98 ff.getName(), | 99 ff.getName(), |
99 ff.getDescription(), | 100 ff.getDescription(), |
106 logger.debug("Not an instance of FixationArtifact."); | 107 logger.debug("Not an instance of FixationArtifact."); |
107 return null; | 108 return null; |
108 } | 109 } |
109 } | 110 } |
110 | 111 |
111 | |
112 public static double getMaxQ(Parameters params, double km) { | |
113 double [] maxQ = params.interpolate("km", km, new String[] { "max_q" }); | |
114 if (maxQ == null) { | |
115 return 1000; | |
116 } | |
117 double mQ = Math.min(10000, Math.abs(maxQ[0])); | |
118 return mQ + 0.05*mQ; | |
119 } | |
120 | |
121 /** | 112 /** |
122 * Create a deep copy of this Facet. | 113 * Create a deep copy of this Facet. |
123 * @return a deep copy. | 114 * @return a deep copy. |
124 */ | 115 */ |
125 @Override | 116 @Override |