What was the purpose of observatories?

to watch the stars
to study cartography
to chart the progress of ships
to develop tools like the astrolabe