How do I adjust the code for the Gaussian Blur posted in the thread:
What raster smoothing/generalization tools are available?
to retain the resolution/gradients in the y direction and blur only in the x direction (rather than over a square area)?
How do I adjust the code for the Gaussian Blur posted in the thread:
What raster smoothing/generalization tools are available?
to retain the resolution/gradients in the y direction and blur only in the x direction (rather than over a square area)?
Here is how to make @whuber 's answer directional.
1) take the mean of a 3 pixels by 1 window centered on your pixel. (equivalent to a custom linear neighbourhood with weights of 1/3, 1/3 and 1/3)
2) repeat several times
alternatively, you can define a custom neighborhood with the weights extracted from a Gaussian distribution or other smoothing kernel.
It depends on the kernel shape. The linked answer in the question uses a circular kernel shape (not square), since the size of x and y values are identical. However, the source code was based on this cookbook which defines a kernel on size and optional sizey, for a different size in the y-direction. Therefore, the kernel is elliptical, and should do what you are looking for (i.e., a rectangle stretched out in the x-direction).