reinderien / isochrones

Toy visualisation for salat isochrones

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

This is a project to explore astro-geological calculation and visualisation for Muslim prayer times. It's not meant to be authoritative (either scientifically or religiously); it's only for fun and interest. It's written from a perspective having only an introductory familiarity with the complex and nuanced Muslim praxis and with astrodynamics.

Theory and terms

Salah (صَلَاة) is the practice of daily Muslim prayer.

Geodesics

The Kaaba (ٱلْكَعْبَة) in Mecca (مكة), Saudi Arabia is the geographical centre of the Islam religion. Muslims face toward it when praying. Since the Earth is an oblate spheroid, the shortest surface path to the Kaaba is via geodesic. This geodesic's initial heading is called the qibla (قِبْلَة). This is the same path and initial heading that an airplane takes when flying to Saudi Arabia.

The user's screen is flat, so all maps need to choose a projection to draw the spheroidal globe. The orthographic projection is convenient because it is easy to understand, appears to the viewer as if they are viewing one hemisphere of a 3D globe, and draws all geodesics through the centre as straight lines that otherwise appear curved on non-azimuthal projections. Thus, this program draws two hemispheres, one centred on the user's home location and one on the Kaaba.

Reference frames and time

The typical five daily salah prayers are

  • fajr (صلاة الفجر, at dawn),
  • zuhr (صَلَاة ٱلظُّهْر, at noon),
  • asr (صلاة العصر, at afternoon),
  • maghrib (صلاة المغرب, at sunset), and
  • isha (صلاة العشاء, at dusk).

Each is tied to a specific solar time. Calculations relating solar time and coordinated time require some background in terrestrial frames of reference. The Earth has at least four different kinds of pole:

  • The terrestrial poles - also called geodetic, geographic or true poles - are intersection points of Earth's rotational axis through its surface. We colloquially call these the north and south pole. They slowly precess over tens of thousands of years.
  • The magnetic poles orient a compass. When Muslims determine the qibla for a given location, they need to account for magnetic declination to translate from the magnetic frame to the terrestrial frame, in turn determining a heading from true north. These magnetic poles wander slowly over millions of years.
  • The celestial poles sit at arbitrary heights above the terrestrial poles and are independent of the Earth's surface, instead intersecting a virtual celestial sphere.
  • The ecliptic (or orbital) poles sit on the normal to the solar system orbital plane. The boundary of day and night will always intersect the ecliptic poles, before correcting for diffraction. The ecliptic moves through an annual cycle.

Isochrones

At any given time, for a specific prayer, there is one curve across the Earth where all points on that curve satisfy the solar conditions for that prayer. This curve is an isochrone. If the celestial and ecliptic poles were aligned, then prayer isochrones would be meridians in the rotational frame. However, since the Earth's rotation has an axial tilt or ecliptic obliquity, the poles are offset by about 23° and the isochrones are actually ecliptic meridians extending to the ecliptic poles, not the terrestrial poles. This has the effect of changing prayer times through the year.

Further, since all of the prayer definitions need various amounts of angular correction to account for refraction, they are not really meridians. They're paths offset (sometimes significantly, up to 20-some degrees) from the ecliptic poles.

Degenerate locations

The ecliptic poles for the current day of year are gimbal-locked, which implies an undefined prayer schedule at that location: it is both always time for zuhr and never time for zuhr. At this location, the sun circles the horizon but never rises or sets.

There are two degenerate polar regions; whether they appear in the north or south depends on the time of year. In one region spanning from an ecliptic pole to the terminus of the fajr/isha isochrones, it is always dark but never dark enough to meet the refraction threshold for fajr and isha, so fajr and isha cannot happen. In the other region bounded by the other ecliptic pole, it is always bright, the sun never sets, and fajr and isha still cannot happen.

Fatwa 2769 attempted to clear these ambiguities.

Implementation

This code follows (some of the) schedule definitions from Hamid's prayer time guide.

Setup

Install third-party packages via

pip install -r requirements.txt

Usage

Populate .home.json with the location of prayer, to look like

{
  "lat": 40,
  "lon": -80
}

then run demo.py.

About

Toy visualisation for salat isochrones

License:MIT License


Languages

Language:Python 100.0%