Mercurial > gemma
comparison pkg/controllers/gauges.go @ 2763:a06d11d1f0b3
Fixed gauge selection in Nash Sutcliffe calculation.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 21 Mar 2019 18:19:44 +0100 |
parents | f95ec0bb565c |
children | 1f173d1a731d |
comparison
equal
deleted
inserted
replaced
2762:f95ec0bb565c | 2763:a06d11d1f0b3 |
---|---|
41 ON a.fk_gauge_id = b.fk_gauge_id AND | 41 ON a.fk_gauge_id = b.fk_gauge_id AND |
42 a.measure_date = b.measure_date AND | 42 a.measure_date = b.measure_date AND |
43 a.predicted AND NOT b.predicted | 43 a.predicted AND NOT b.predicted |
44 WHERE | 44 WHERE |
45 a.fk_gauge_id = ( | 45 a.fk_gauge_id = ( |
46 $1::char(1), | 46 $1::char(2), |
47 $2::char(2), | 47 $2::char(3), |
48 $3::char(3), | 48 $3::char(5), |
49 $4::char(4), | 49 $4::char(5), |
50 $5::int | 50 $5::int |
51 ) AND | 51 ) AND |
52 a.measure_date BETWEEN | 52 a.measure_date BETWEEN |
53 $6::timestamp AND $6::timestamp - '72hours'::interval | 53 $6::timestamp AND $6::timestamp - '72hours'::interval |
54 ORDER BY a.measure_date | 54 ORDER BY a.measure_date |
55 ` | 55 ` |
74 $2::char(3), | 74 $2::char(3), |
75 $3::char(5), | 75 $3::char(5), |
76 $4::char(5), | 76 $4::char(5), |
77 $5::int | 77 $5::int |
78 ) | 78 ) |
79 AND | 79 AND measure_date BETWEEN |
80 measure_date BETWEEN | 80 $6::timestamp with time zone AND |
81 $6::timestamp with time zone AND $7::timestamp with time zone | 81 $7::timestamp with time zone |
82 ORDER BY measure_date | 82 ORDER BY measure_date |
83 ` | 83 ` |
84 ) | 84 ) |
85 | 85 |
86 func averageWaterlevels(rw http.ResponseWriter, req *http.Request) { | 86 func averageWaterlevels(rw http.ResponseWriter, req *http.Request) { |