Prayer Times Calculation
Assr

Calculating Assr Time

Overview

  1. Determine the Solar Altitude Angle (angle at which the sun rays hit the earth) at the beginning of Zuhr time
  2. Based on that angle, determine the corresponding shadow length of a 2 meters tall object at that time
  3. Determine the required Solar Altitude Angle at which a 2 m tall object's shadow length would exceed the zuhr shadow length by 2 m
  4. Determine the time that corresponds to that Solar Altitude Angle

Calculation Step by Step

1. Solar Altitude Angle at the beginning of Zuhr time

αnoon=90ϕδ\alpha_{\text{noon}} = 90^\circ - |\phi - \delta|

Where:

  • δ\delta is the Declination (opens in a new tab) on that day.
  • ϕ\phi is the Latitude of the location (positive for the northern hemisphere and negative for the southern hemisphere).

2. Shadow Length at the beginning of Zuhr time

Shadow Length=2tan(αnoon)\text{Shadow Length} = \frac{2}{\tan(\alpha_{\text{noon}})}

Where:

  • 2 is the height of the object casting the shadow. (in our example 2m)
  • αnoon\alpha_{\text{noon}} is the Solar Altitude Angle from step 1.

3. Required Solar Altitude Angle for reaching the shadow lenght that marks the beginning of Assr

α=arctan(2Shadow Length+2)\alpha = \arctan\left(\frac{2}{\text{Shadow Length}+2}\right)

4. Time at which the sun rays hit the earth at that angle

The following is the general formula to calculate the Solar Altitude Angle at any given time (whereas the one used in step 1 works for noon time only):

sin(α)=sin(δ)sin(ϕ)+cos(δ)cos(ϕ)cos(H)\sin(\alpha) = \sin(\delta) \cdot \sin(\phi) + \cos(\delta) \cdot \cos(\phi) \cdot \cos(H)

Where:

  • α\alpha is the Solar Altitude Angle
  • δ\delta is the solar declination for the specific day
  • ϕ\phi is the latitude of your location
  • HH is the Hour Angle (opens in a new tab)

At solar noon the hour angle (H)(H) is zero degrees, with the time before solar noon expressed as negative degrees, and the local time after solar noon expressed as positive degrees. So HH basically is the time of the day expressed in degrees.

Hence to get from a Solar Altitude Angle to an actual time, we will rearrange the SAA formula to solve for HH:

cos(H)=sin(α)sin(δ)sin(ϕ)cos(δ)cos(ϕ)\cos(H) = \frac{\sin(\alpha) - \sin(\delta) \cdot \sin(\phi)}{\cos(\delta) \cdot \cos(\phi)}

H=arccos(sin(α)sin(δ)sin(ϕ)cos(δ)cos(ϕ))H = \arccos\left(\frac{\sin(\alpha) - \sin(\delta) \cdot \sin(\phi)}{\cos(\delta) \cdot \cos(\phi)}\right)

Then, to convert the resulting Hour Angle HH to a time, we use the following formula to convert it to the corresponding Local Solar Time (LST):

The Hour Angle H is related to time by:

H=15×(LST12)H = 15^\circ \times (\text{LST} - 12)

Solve for LST:

LST=12+H15\text{LST} = 12 + \frac{H}{15^\circ}

Convert Local Solar Time to the actual clock time:

Clock Time=LST+Standard Meridian LongitudeLocal Longitude15Equation of Time\text{Clock Time} = \text{LST} + \frac{\text{Standard Meridian Longitude} - \text{Local Longitude}}{15^\circ} - \text{Equation of Time}

Example

  • Date: May 1st, 2024
  • Local time zone: UTC+2
  • λ\lambda Longitude: 6°
  • ϕ\phi Latitude: 50.8º
  • Assumed Object height: 2 m
  • EoT: 2.95 minutes (= 2:57 min)
  • δ\delta Declination: 15.28875 degrees

αnoon=54.48875=9035.51125\alpha_{\text{noon}} = 54.48875^\circ = 90^\circ - |35.51125^\circ| = 90^\circ - |50.8^\circ - 15.28875^\circ|$

Shadow Length Zuhr=1.427178718=2tan(54.48875)\text{Shadow Length Zuhr} = 1.427178718 = \dfrac{2}{\tan(54.48875^\circ)}

Shadow Length Assr=3.427178718\text{Shadow Length Assr} = 3.427178718 = 1.427178718 + 2$

αAssr=30.26656=arctan(23.427178718)\alpha_{\text{Assr}} = 30.26656^\circ = \arctan\left(\dfrac{2}{3.427178718^\circ}\right)

Convert Solar Altitude Angle to Sun Hour Angle:

H=60.55701=arccos(sin(30.26656)sin(15.28875)sin(50.8)cos(15.28875)cos(50.8))H = 60.55701^\circ = \arccos\left(\dfrac{\sin(30.26656^\circ) - \sin(15.28875^\circ) \cdot \sin(50.8)}{\cos(15.28875^\circ) \cdot \cos(50.8^\circ)}\right)

Convert the resulting Hour Angle HH to the corresponding Local Solar Time (LST):

LST=16.037134=12+60.5570115\text{LST} = 16.037134 = 12 + \dfrac{60.55701^\circ}{15^\circ}

Convert Local Solar Time to the actual clock time:

Clock Time=17.58797=16.037134+306152.95\text{Clock Time} = 17.58797 = 16.037134 + \dfrac{30^\circ - 6^\circ}{15^\circ} - 2.95

Therefore, the time for Assr prayer is 17:35 h (5:35 PM) local time.

Code Implementation

../prayertimes2025//pt_engine/compute_times/compute_assr_time.py

import math
from datetime import datetime, timedelta
from pt_engine.astro_helpers import hour_angle_for_solar_altitude


def compute_assr_time(date: datetime, utc_offset: float, longitude: float, latitude: float, declination: float, eot: float) -> datetime:

    # Step 1: Calculate Solar Altitude Angle at the beginning of Zuhr time
    alpha_noon = 90 - abs(latitude - declination)

    # Step 2: Calculate Shadow Length at the beginning of Zuhr time
    shadow_length_zuhr = 1 / math.tan(math.radians(alpha_noon))

    # Step 3: Required Solar Altitude Angle for Assr
    shadow_length_assr = shadow_length_zuhr + 1
    alpha_assr = math.degrees(math.atan(1 / shadow_length_assr))

    # Step 4: Calculate Hour Angle H for Assr time
    hour_angle = hour_angle_for_solar_altitude(latitude, declination, alpha_assr)

    # Convert Hour Angle H to Local Solar Time (LST)
    local_solar_time = 12 + hour_angle / 15

    # Convert Local Solar Time to the actual clock time
    standard_meridian = 15 * utc_offset
    clock_time_hours = local_solar_time + (standard_meridian - longitude) / 15 - eot / 60

    # Convert to datetime object
    assr_time_of_day = datetime.combine(date, datetime.min.time()) + timedelta(hours=clock_time_hours)

    return assr_time_of_day
↗ View in github