sfcostaper applies cosine tapering to the edges of the input data.
Cosine tapering amounts to multiplying the edges by
$$\sin^2\left(\frac{\pi\,x}{2}\right) = \frac{1+\cos{(\pi\,x)}}{2}$$,
where $x$ is the relative distance from the start of the taper.
sfcostaper works in N dimensions, the size of the taper in #th dimension in samples is specified by nw#=. In the following example from gee/ajt/igrad1 the images are tapered at both edges by specifying nw1=50 nw2=50.