ARPA-SIMC / dballe

Fast on-disk database for meteorological observed and forecast data.
Other
19 stars 6 forks source link

query parameters querying summary #240

Closed pat1 closed 4 years ago

pat1 commented 4 years ago

Seem to me that date* parameters are not taken in account querying summaries. Which parameter are taken in account or is this a bug ?

spanezz commented 4 years ago

Looking at the code, datetime extremes are taken into account when querying summaries, both xapian-based and in-memory ones.

However, summaries are summaries and not detailed data, and are aggregated by time interval. Querying by datetime bounds will return all summaries that intersect the query bounds.

For example, if you have a variable that's measured for a given station, report, level, and timerange, over the course of 5 years, and you query that variable with datetime bounds of one hour in that 5 years interval, you get the whole 5 years in the result set.

What the summary is telling you, is "the datetime bounds in your query are within the interval in which we have measurements for that variable".

Note that it doesn't necessarily mean that there are going to be data in that interval: if a variable is measured every monday, but you query_summary about it on a tuesday, you still get a result if that variable has been measured before and after that tuesday.

At least, this is what I can infer from your request. If you think this is not what is going on, please provide a test case, like a JSON summary and a query, which doesn't give you the results that you expect.

pat1 commented 4 years ago

Effettuato test con questi dati e programma pare essere tutto coerente. temperature.zip

Procedo con debug della mia applicazione.