Differences between alt/az in Stellarium and Astropy I've just started to learn Astropy. It's a nifty tool. Using some tutorials, I wrote and then made modifications to a little script that finds the Alt/Az of an object at a certain place and time. I then checked Stellarium's calculation for the Alt/Az of the same object (at exactly the same place and time) and found it to be slightly different. I suspected this was due to slight differences in the underlying coordinates, so I tried manually hard coding the coordinate data for the star from Stellarium; it still came out different. Here is the data without the hard coding:

Object: Rasalhague (alf Oph)
Time: 2018-08-28 23:00 (converted to universal in the script)
Latitude: 35
Longitude: -79
Stellarium reported Az/Alt: +247 35 12.3 / +48 00 57.8
Astropy reported Az/Alt: +247 35 37.4939s / +48 00 08.7586


Manually coding:

RA/Dec on date from Stellarium: 17 35 48.82, +12 32 55.9
Astropy reported Az/Alt: +247 22 42.0379 / +48 09 43.0755


I'm guessing that the difference stems from the conversion algorithm to alt/az.
Perhaps the difference stems from the conversion algorithm?


Almost certainly this is the answer.  It's not clear to me exactly what Stellarium assumes for is refraction calculation, but I know Astropy's algorithm.  Given that the altitude you've listed here is below the horizon (i.e., alt is negative), it's not really clear what the correct interpretation is: in particular, atmospheric refraction is not really well-defined below the horizon (since it should be invisible anyway!).

Additionally, even well above the horizon where refraction isn't that important, there are several finicky details that you have to account for to properly do the Az/Alt conversions.  In addition to the precession that the other answers mention, if you want to get exactly the same answer on two tools, you have to worry about things like how much the axis of the Earth shifts due to, say, major earthquakes ("true polar wander"), the effects of General Relativity on the apparent direction of the incoming light ,etc.  Most of these are pretty small, but together they mean it's very hard to ensure all of the software gives exactly the same answer unless they carefully follow the definitions set by the International Astronomical Union.

That said, the differences you see are only ~20 arcsec.  The human eye isn't even capable of telling that small of a difference, and almost all telescopes that people would use Stellarium with probably wouldn't either (at least in an absolute sense).  So for this particular application they essentially do match.