Thanks for the reply. You are correct – that is a typo about the NaNs… GRD 2 has the NaNs in its corners, not GRD3.

First, let me ask a couple basic questions just to make sure I understand what the taper is doing…

In the grdblend documentation, it says, “…weights are [1] inside the given -R [grid domain] and cosine taper to 0 at actual grid -R.”

What is meant by “actual grid -R”? Is that an individual input grid’s -R or the -R specified for the final blended product?

Is the cosine taper circularly symmetric from an input grid’s center or does it work in X and Y independently?

OK, now back to the challenge at hand…

Another important requirement is the order of precedence, specifically, GRD4 >> GRD3 >> GRD2 >> GRD1 in order of precedence. So, for example, every output pixel where GRD 4 exists should be set to the GRD 4 value *except* in its transition region where the cosine taper applies. Similarly, every output pixel where only GRDs 1,2,3 exist should be set to GRD3 *except* in its transition region where the cosine taper applies.

I think this amounts to a combined clobber+taper mode: clobber in the inner regions according to the order of precedence and weighted average in the taper edge regions. Perhaps this can be done with the absolute weights as you suggest. To set each grid’s absolute weight, would I just use a number other than 1 for the 3rd column of the input file?

I’ve attached an updated figure showing the inner regions of GRDs 4,3,2 as orange dashed lines.

Then the input file should be something like:

GRD4 <GRD4 -R shrunk by a small amount> 1e6

GRD3 <GRD3 -R shrunk by a small amount> 1e4

GRD2 <GRD2 -R shrunk by a small amount> 1e2

GRD1 <GRD1 full -R> 1

Where all 4 exist, the output value will be approximately equal to GRD4 (since its weight is >> the others). Similarly, where only GRDs 1,2,3 exist, the output value will be approximately GRD3 since its weight is >> GRD 1 and 2’s.

But, at the corners of GRD2, will the cosine ramp correctly taper to 0 at the solid black line of GRD2 given the irregular distance to its dashed orange line?

Also, since the absolute weights are so different does that make the cosine taper more of a hard step function, thereby reducing its ability to smooth out any seams between the grids? For example, in the outer edge of GRD4 that overlaps with GRD2, the ramp has to go from 1e6 to 1e2 in a short distance.

It seems that I might have to strike a balance between the desire to reduce seams (requiring tapering with similar absolute weights between the grids) and the desire to do clobbering in the inner regions (requiring vastly different weights to achieve the desired order of precedence).

Thanks a lot for your help!

Mike