Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time series request rounds the request endDate resulting in omitting last value #289

Open
AliceBalfanz opened this issue May 11, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@AliceBalfanz
Copy link
Contributor

AliceBalfanz commented May 11, 2023

When we have a dataset, which last two values are e.g.

'2022-04-26T06:56:04.065999872', '2022-05-06T06:56:04.065999872'

the last value is rounded to 2022-05-06T06:56:04Z in xcube viewer. The last time stamp is displayed fine on the map, however due to rounding it is omitted in the time-series request.

https://bc-api.brockmann-consult.de/api/timeseries/bc-demo~cglops_lake_tanganjika_300m.zarr/turbidity_mean?aggMethods=median&startDate=2021-10-26T19:37:41Z&endDate=2022-05-06T06:56:04Z

POST https://bc-api.brockmann-consult.de/api/timeseries/bc-demo~cglops_lake_tanganjika_300m.zarr/turbidity_mean?aggMethods=median&startDate=2021-10-26T19:37:41Z&endDate=2022-05-06T06:56:04Z

e.g. for

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [29.40474395710414, -4.981605714204804]
  },
  "properties": {
    "name": "Point 1"
  }
}

result [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ]
0 Object { median: 0.31508904695510864, time: "2021-11-06T06:56:04Z" }
1 Object { median: 0.5600425004959106, time: "2021-11-16T06:56:04Z" }
2 Object { median: 0.5560182332992554, time: "2021-11-26T06:56:04Z" }
3 Object { median: 0.3041113018989563, time: "2021-12-06T06:56:04Z" }
4 Object { median: 0.4342271685600281, time: "2021-12-16T06:56:04Z" }
5 Object { time: "2021-12-26T19:37:41Z", median: null }
6 Object { time: "2022-01-06T06:56:04Z", median: null }
7 Object { median: 0.5325384736061096, time: "2022-01-16T06:56:04Z" }
8 Object { median: 0.4660368859767914, time: "2022-01-26T19:37:41Z" }
9 Object { median: 0.8200605511665344, time: "2022-02-06T06:56:04Z" }
10 Object { median: 0.5204707980155945, time: "2022-02-16T06:56:04Z" }
11 Object { median: 0.7293128967285156, time: "2022-02-25T05:32:51Z" }
12 Object { median: 0.7425397634506226, time: "2022-03-06T06:56:04Z" }
13 Object { median: 0.5542619228363037, time: "2022-03-16T06:56:04Z" }
14 Object { median: 0.3124908208847046, time: "2022-03-26T19:37:41Z" }
15 Object { time: "2022-04-06T06:56:04Z", median: null }
16 Object { median: 0.368571937084198, time: "2022-04-16T06:56:04Z" }
17 Object { median: 0.19854414463043213, time: "2022-04-26T06:56:04Z" }

the response therefore omits the last time stamp with the value 2022-05-06T06:56:04.065999872 as it is just later than 2022-05-06T06:56:04.

This happens for all datasets, where the milliseconds are rounded down, and therefore the timeseries display in the viewer is incomplete.

To reproduce:
Use https://bc-viewer.brockmann-consult.de/?dataset=bc-demo~cglops_lake_tanganjika_300m.zarr

which is located in our bc-demo-cubes s3 bucket.

@AliceBalfanz AliceBalfanz added the bug Something isn't working label May 11, 2023
@AliceBalfanz AliceBalfanz changed the title time series request round the request endDate resulting in omitting last values time series request round the request endDate resulting in omitting last value May 11, 2023
@AliceBalfanz AliceBalfanz changed the title time series request round the request endDate resulting in omitting last value time series request rounds the request endDate resulting in omitting last value May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant