Calculating horizon altitudes with raster pyramids

In August, there will be an eclipse in Spain. The catch is that it'll be low above the horizon (only about 5°) so if I want to find the best place to observe it, I need to find a place where the apparent horizon, like hills and trees (mostly hills), does not get in the way.

However, this is not readily obvious from a topographic map. One gets an idea to look at hilltops but how do you know if a hilltop is good enough? Is this hilltop better than that hilltop? How do you quickly find a good hilltop that's reasonably accessible by car?

I set out to get an elevation map of (parts of) Spain, and for each pixel, calculate the altitude of the apparent horizon when looking from that point in the 285° azimuth, which is approximately the azimuth of the Sun during the eclipse.

How does one calculate that efficiently? I wrote up one way to do it (PDF).