I am using r.sun to calculate the daily insolation values for a region of a GeoTIFF.
I noticed that the resulting output has a 1-pixel wide artefact along the [0,:] row and the [:,0] column (assuming numpy axis conventions) - all the values in this region are unexpectedly NaN
I went back to look at some code from which my code is derived and noticed that this artefact also exists in that outputs generated by that code. Furthermore, that code sums across multiple r.sun runs (with r.mapcalc), and in that case, the artefact is 2 pixels wide (e.g. in the [0:2,:] rows and [:,0:2] columns).
It looks to me that the actual problem isn't r.sun but r.gdal.out (or perhaps r.gdal.in) since these are the only components that are used twice in the summed scenario.
It seems unlikely that r.gdal.in and r.gdal.out would introduce artefacts of this kind. What am I missing? Why is there this 1 pixel artefact in the single use case, and a 2 pixel artefact in the summed case?