Exactly that. Not only the calculations actually. Given the advanced state of current imaging, image recognition and processing, you could automate the whole thing end-to-end, with a machine that takes it's own star readings, processes them, identifies the stars based on internal maps*, does all the necessary calculations and outputs the result.
As long as it has a clear view of the sky it can continuously keep a position reading, and perhaps use some form of dead reckoning to estimate a position when it can't get a star/sun reading. Also might be possible (I'm sure someone more knowledgeable than me about these things) to use not just visible light detection but other frequencies. For example would it be possible to use some form of radio telescope to identify where the stars are even if it's cloudy?
*as you mention these need to be downloaded into the machine occasionally, the machine itself should be airgapped otherwise that negates the whole anti-hacking thing