Sunset on [Mountain] from [Viewing Point] How do I get the days in this year when the sun will set exactly on top of Fuji as viewed from Enoshima.

I shamefully admit that I just want to take a nice picture of Fuji.
My attempt at an answer of my own question. I have no confidence that it is correct, and I'd like to know whether there's an easier way to do this…

https://www.movable-type.co.uk/scripts/latlong.html tells me that the bearing is 90.3°.

A quick application of middle school trigonometry tells me that the visible elevation of Fuji is about 3413 m or 2.90°.

Next, I went to Stellarium, fixed my position to Enoshima, and exported the Ephemeris (F10 menu) of the Sun in a 5 minute intervals with horizontal coordinates from February till May.

Finally, I used a quick python script to find the line in the Ephimeris export where the sun is closest to my desired coordinates (90.3°, 2.9°)



import re
from pprint import pprint

height = "Height"
azi = "Azimut"

# Quick and dirty parser
pre = re.compile("([+-])(\\d+)°(\\d+)'([0-9.]+)\"")
def ph(v):
    m = pre.match(v)
    if m:
        sign, *nums = m.groups()
        return sum([float(s) * 60 ** (-e) for e,s in enumerate(nums)]) * float(sign + "1")
    try:
        return float(v)
    except:
        pass
    return v

res = []
with open('ephemeris2.csv') as f:
    head = next(f).split(", ")
    for line in f:
        php = [ph(v) for v in line.split(", ")]
        res.append(dict(zip(head, php)))

# This is where the magic happens!
filt = [k for k in res if k is not None and height in k and azi in k]
filt.sort(key = lambda v: (v[height] - 2.9) ** 2 + (v[azi] - 270.3) ** 2)
pprint(filt[:5])


This yielded me



{ 'Azimut': 270.13194444444446,
  'Datum and Time': '2019-03-25 17:39:00',
  'Height': 3.0792222222222225 }


I'm unsure whether I can just convert the Bearing to Azimuth like that, but I suspect that a simple mathematical mistake is even more likely…