I noticed that depending on the size of the queried area using CDS API (more specifically the cdsapi
Python library), I receive slightly different values of precipitations for the same coordinates.
Let's take an example: I want to get daily precipitation of 2009-11-30
at coordinates (9.75 lat, 122.75 lon) local time, which makes me query for the range 2009-11-29
to 2009-11-30
and make 8 hours shift in case someone would want to reproduce it.
In bbox = [12.50, 118.00, 7.75, 125.50]
the value at (9.75 lat, 122.75 lon) is 0.000308474
.
In bbox = [10.50, 122.50, 9.50, 125.00]
the value at (9.75 lat, 122.75 lon) is 0.000308558
.
Both of the requests are snapped to a 0.25 grid so I would expect that there is no difference between them. Of course, we are talking about 1/1000 of a millimeter here, but it would mess with my tests for data consistency.
Do you know what can be a reason for that? Is it just caused by a common problem with float inaccuracy?
answer from provider: "The data values in netCDF files from the CDS are 'packed' using a scale factor and an offset (with some loss of precision). These packing values will vary depending on the range of actual data values. The 2 different selected areas will very likely have different min/max values, hence different scale factor and offset values, and I suspect that these lead to the numerical differences you see when the data are unpacked to get the data values.