Skip to content

Debug sampling fix issue #15 and issue #38

Fix two pending issues #15 (closed) and #38 (closed) in sampling code.

For spatial shift issue is due to the fact that rasterio/affine library use upper left corner of image as origin (0,0). So to pass to rasterio patch origin coordinate to patch center we meed to add patch_size/2 in x dimension and remove in y dimension.

For grid sampling issue is due to wrong use of modulo operator (%) with float number and not int and also to adding 0.5*padding more than necessary when tight_mode is false.

Merge request reports