Calculating Assr Time
Overview
- Determine the Solar Altitude Angle (angle at which the sun rays hit the earth) at the beginning of Zuhr time
- Based on that angle, determine the corresponding shadow length of a 2 meters tall object at that time
- 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
- Determine the time that corresponds to that Solar Altitude Angle
Calculation Step by Step
1. Solar Altitude Angle at the beginning of Zuhr time
Where:
- is the Declination (opens in a new tab) on that day.
- 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
Where:
- 2 is the height of the object casting the shadow. (in our example 2m)
- is the Solar Altitude Angle from step 1.
3. Required Solar Altitude Angle for reaching the shadow lenght that marks the beginning of Assr
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):
Where:
- is the Solar Altitude Angle
- is the solar declination for the specific day
- is the latitude of your location
- is the Hour Angle (opens in a new tab)
At solar noon the hour angle 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 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 :
Then, to convert the resulting Hour Angle 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:
Solve for LST:
Convert Local Solar Time to the actual clock time:
Example
- Date: May 1st, 2024
- Local time zone: UTC+2
- Longitude: 6°
- Latitude: 50.8º
- Assumed Object height: 2 m
- EoT: 2.95 minutes (= 2:57 min)
- Declination: 15.28875 degrees
= 90^\circ - |50.8^\circ - 15.28875^\circ|$
= 1.427178718 + 2$
Convert Solar Altitude Angle to Sun Hour Angle:
Convert the resulting Hour Angle to the corresponding Local Solar Time (LST):
Convert Local Solar Time to the actual clock time:
Therefore, the time for Assr prayer is 17:35 h (5:35 PM) local time.
Code Implementation
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