I want to resample a raster from 15m to 460m using a Gaussian filter.
The goal
I am having a coarse image which I want to downscale. I also have a fine resolution band to assist the downscaling. The downscaling method I am using is called geographically weighted area-to-point regression Kriging (GWATPRK). The method consists of two steps:
In order to perform GWR using raster data, those needs to have the same pixel size. This means that, my fine resolution image needs to be upscaled to match the spatial resolution of the coarse band. This upscaling of the fine band needs to be done using a Gaussian kernel (i.e., the PSF). I have found that GRASS GIS
has a tool called r.resamp.filter
.
I am trying to run the function but I am getting the following error(s):
- ERROR: Differing number of values for filter= and [xy_]radius=
This error occurs when I use two filter kernels (e.g., gauss
+ box
, or gauss
+ bartlett
). I am using two kernels because according to the Manual:
Kernels with infinite extent (Gauss, normal, sinc, Hann, Hamming, Blackman) must be used in conjunction with a finite windowing function (box, Bartlett, Hermite, Lanczos).
Doesn't matter what numbers I put in the Filter radius
or Filter radius (horizontal)
and Filter radius (vertical)
(see image below), I tested A LOT of numbers.
- ERROR: At least one filter must be finite
This error occurs when I use one filter kernel (I am interested in applying a Gaussian filter, because I want to model the point spread function during downscaling satellite imagery).
The steps I followed were:
r.external
to import the rasterg.region
where I set the region using my original fine resolution image BUT in Resolution tab I changed the 2D resolution into 460r.resamp.filter
and the errors I mentionedUltimately, I want to apply a Gaussian filter with sigma (std) = 0.5 to my image.
Here the image I am using
I had to check two filter kernels, the box
and the gaussian
. For the filter radius
I had to insert 250, 250 (each value corresponds to a kernel). The output was an image of ~460m pixel size.