From Photon
to Prayer Time
Follow sunlight through 100 km of atmosphere, scattered, absorbed, and refracted, until the moment it becomes visible to an observer on the ground.
Real-Time Atmospheric Data
We gather data from multiple weather services to build an accurate model of today's sky
Cloud Coverage
Multi-layer cloud data including low, mid, and high altitude coverage with optical depth estimation
Source: Met.no Weather APIAtmospheric Profile
Temperature, pressure, and humidity at 19 altitude levels from surface to 23km
Source: GFS via Open-MeteoAerosols & Dust
Pollution levels, desert dust concentration, and aerosol optical depth at 550nm
Source: CAMS Satellite DataTerrain Elevation
Precise observer height above sea level for accurate horizon calculations
Source: SRTM via Open-MeteoSnow Coverage
Surface reflectivity mapping. Snow reflects twilight back into the sky, changing visibility
Source: IMS/NOAA SatelliteSolar Position
Precise sun location computed using NASA Jet Propulsion Laboratory planetary ephemeris
Source: NASA JPL DE440Intelligent Cloud Modeling
Combining multiple data sources to build an accurate 3D cloud structure
What is Optical Depth?
Optical depth (OD) measures how much light a medium blocks. An OD of 1 blocks 63% of light. An OD of 30 (heavy overcast) blocks 99.9999999999% of direct light. The tiny fraction that survives, scattered multiple times, is what creates the faint twilight glow you see.
More clouds = less glow = later visible Fajr
Monte Carlo Radiative Transfer
Reverse-tracing 40 billion+ photons from observer to sun
We reverse-trace over 40 billion virtual photons from observer to sun through the atmosphere, 20 million for each of 41 wavelengths and 49 sun angles. Each photon can scatter off air molecules, interact with cloud droplets, pass through aerosols, or reflect off the ground. By tracing their paths backwards for efficiency, we calculate exactly how bright the sky appears at each sun angle.
Rayleigh Scattering
Photons scatter off air molecules. Blue light scatters more, which is why the sky is blue and why twilight has its characteristic color gradient.
Cloud Interaction
Cloud droplets scatter light in all directions (Mie scattering). They block direct paths but create diffuse glow. Ice crystals behave differently than water droplets.
Aerosol Effects
Dust, pollution, and haze particles absorb and scatter light based on their size and composition. Desert dust scatters differently than urban smog.
Ozone Absorption
The ozone layer absorbs certain wavelengths, affecting the color and intensity of scattered twilight light passing through the stratosphere.
Surface Reflection
Ground reflects light back up. Snow reflects 80% (making twilight brighter), dark forest only 10%. This affects overall sky brightness.
Human Vision Model
We weight the spectrum by mesopic (twilight) human eye sensitivity, centered at 530nm. This gives us the brightness you would actually perceive.
The Phases of Dawn
As the sun descends, twilight progresses through distinct phases
Civil Twilight
0° – 6° belowBright enough to read outdoors
Nautical Twilight
6° – 12° belowHorizon still visible at sea
Astronomical Twilight
12° – 18° belowSky nearly dark, stars visible
True Fajr (Takbir)
~14° – 16° typicallyWhite thread of dawn becomes visible
Our simulation calculates the actual sky brightness at each sun position, then finds precisely when it crosses the human visibility threshold.
Layers of the Sky
Each atmospheric layer affects light differently
Mesosphere
50–85 kmNegligible scattering
Stratosphere
12–50 kmOzone absorption, Rayleigh scattering
Upper Troposphere
6–12 kmIce cloud scattering, temperature inversion
Lower Troposphere
2–6 kmWater cloud scattering, main absorption zone
Boundary Layer
0–2 kmAerosols, pollution, surface reflection
From Location to Fajr Time
Eight steps from your coordinates to a physics-accurate prayer time
Input Location & Date
Your latitude, longitude, and the date you want to calculate.
Fetch Atmospheric Data
Gather real-time cloud coverage, temperature profiles, aerosols, elevation, and snow cover from meteorological satellites.
Build Cloud Model
Detect cloud layers using humidity profiles and verify against satellite observations. Apply hybrid GFS + Met.no strategy.
Construct Atmosphere
Create a virtual atmosphere with real-time temperature, pressure, and humidity up to 23km altitude.
Run Monte Carlo Simulation
Reverse-trace 40 billion+ photons from observer to sun, 20 million per each of 49 sun angles × 41 wavelengths, using GPU acceleration.
Process Spectra
Calculate human-perceivable brightness at each sun angle using mesopic vision response curves.
Build Twilight Curve
Create smooth interpolation of brightness vs. sun angle using PCHIP splines for sub-degree precision.
Find Threshold Crossing
Use Brent's root-finding algorithm to locate the exact moment when brightness equals the visibility threshold.
A first-of-its-kind physics-based approach to Islamic prayer time calculation, honoring both the Quranic definition and modern atmospheric science.
← Back to Home