Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java @ 2267:46918e6a831d
Return the Qs from the "Bezugslinienverfahren, too."
flys-artifacts/trunk@3924 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 06 Feb 2012 13:53:49 +0000 |
parents | 707b47d8c554 |
children | 4d30e38600b8 |
comparison
equal
deleted
inserted
replaced
2266:c9a40e3fdf16 | 2267:46918e6a831d |
---|---|
946 PolynomialSplineFunction qW1 = sf1.spline; | 946 PolynomialSplineFunction qW1 = sf1.spline; |
947 PolynomialSplineFunction qW2 = sf2.spline; | 947 PolynomialSplineFunction qW2 = sf2.spline; |
948 | 948 |
949 double [] ws1 = new double[numSamples]; | 949 double [] ws1 = new double[numSamples]; |
950 double [] ws2 = new double[numSamples]; | 950 double [] ws2 = new double[numSamples]; |
951 double [] qs1 = new double[numSamples]; | |
952 double [] qs2 = new double[numSamples]; | |
951 | 953 |
952 Arrays.fill(ws1, Double.NaN); | 954 Arrays.fill(ws1, Double.NaN); |
953 Arrays.fill(ws2, Double.NaN); | 955 Arrays.fill(ws2, Double.NaN); |
956 Arrays.fill(qs1, Double.NaN); | |
957 Arrays.fill(qs2, Double.NaN); | |
954 | 958 |
955 boolean hadErrors = false; | 959 boolean hadErrors = false; |
956 | 960 |
957 double p = 0d; | 961 double p = 0d; |
958 for (int i = 0; i < numSamples; ++i, p += stepWidth) { | 962 for (int i = 0; i < numSamples; ++i, p += stepWidth) { |
959 try { | 963 try { |
960 double q1 = iQ1.value(p); | 964 qs1[i] = iQ1.value(p); |
961 double w1 = qW1.value(q1); | 965 ws1[i] = qW1.value(qs1[i]); |
962 double q2 = iQ2.value(p); | 966 qs2[i] = iQ2.value(p); |
963 double w2 = qW2.value(q2); | 967 ws2[i] = qW2.value(qs2[i]); |
964 ws1[i] = w1; | |
965 ws2[i] = w2; | |
966 } | 968 } |
967 catch (ArgumentOutsideDomainException aode) { | 969 catch (ArgumentOutsideDomainException aode) { |
968 if (!hadErrors) { | 970 if (!hadErrors) { |
969 // XXX: I'm not sure if this really can happen | 971 // XXX: I'm not sure if this really can happen |
970 // and if we should report this more than once. | 972 // and if we should report this more than once. |
975 } | 977 } |
976 } | 978 } |
977 } | 979 } |
978 } | 980 } |
979 | 981 |
980 return new double [][] { ws1, ws2 }; | 982 return new double [][] { ws1, qs1, ws2, qs2 }; |
981 } | 983 } |
982 | 984 |
983 public QPosition getQPosition(double km, double q) { | 985 public QPosition getQPosition(double km, double q) { |
984 return getQPosition(km, q, new QPosition()); | 986 return getQPosition(km, q, new QPosition()); |
985 } | 987 } |