WIthin QGIS you can use Grass tool r.horizon.height to calculate sun height for desired bearings. Result is raster map representing horizon height for each point. However, since you need this for each bearing (I presume 360?) this would mean you would have to generate 360 maps. One
One way i was thinking of for similar problem couldis by using Viewshed Analysis plugin avalible in QGIS which can be used to create viewshed,calculate horizon. If you vectorize it, to get vector lineresult of horizon, break it into points, read DEM valuse on points and thenthat you could calculate their angular elevation.height angles in combination with DEM.