Islamic natural philosophers and mathematicians achieved a level of absolute excellence in the construction of astronomical instruments, particularly celestial globes and astrolabes which represented the structure and movement of the celestial bodies (in three and two dimensions respectively). An enormous number of instruments was produced, and their manufacture was accompanied by the drafting of treatises explaining their construction and use. Celestial globes and astrolabes were used for astrological purposes and the calculation of time, a fundamental function to help ensure that religious functions were properly conducted. One special instrument allowed Muslims to determine qībla, i.e. the direction of Mecca, which they must face when praying.