batoulapps / adhan-js

High precision Islamic prayer time library for JavaScript
MIT License
378 stars 86 forks source link

Morocco Calculation method #118

Closed kafiln closed 3 months ago

kafiln commented 2 years ago

I have a list of all the cities in Morocco ( with their coordinates and alt ) and the prayer times can fetched using this service https://apisearch.hadithm6.com/api/prieres/ville/{id} where id is also part of the city data. Can you reverse engineer the calculation method based on this data ? I didn't find a way to include the altitude in the calculationMethod

kafiln commented 2 years ago

@z3bi any feedback please ?

benzid-wael commented 2 years ago

@kafiln Did you check this configuration? https://www.salahtimes.com/morocco/settings

kafiln commented 2 years ago

@benzid-wael it's not accurate, according to the Moroccan calculation method.

korbav commented 2 years ago

Hi @benzid-wael

@kafiln is right, and afaik, the official Moroccan prayers time are fixed by the "Minister of Habous and Islamic Affairs of the Kingdom of Morocco"

This ministry manually adjusts the time sets depending on the city and probably many other objective or subjective factors. They don't communicate at all about their calculation settings and it's an impossible mission to guess whatever.

Apps like Muslim Pro are synchronized (no calculation) with their official timetables (as well as many Middle Eastern countries for example).

z3bi commented 2 years ago

@kafiln sorry I've been unable to respond recently. The last time I tried to reverse engineer I couldn't find anything that worked with the few datasets I gathered, more datasets will actually make it more difficult. At this point I believe Morocco to be a very special case with the high altitude combined with the proximity to the ocean will make for an extreme line of sight to the sunset.

I am willing to offer my advice if you want to attempt the reverse engineering yourself. But unfortunately I don't think Morocco uses standard equations to get these prayer times.

kafiln commented 2 years ago

Thank you @z3bi

ismailezzaki96 commented 6 months ago

السلام عليكم و رحمة الله

@z3bi @kafiln try these configuration for morocco adhan : Fajr Angle : 19.1 Isha Angle: 17 dhuhr: add 5 minutes maghrib : add 7minutes High Latitude: Angle Based Rule Also note that you need to put the coordinates of the center of the city not your specific location

kafiln commented 6 months ago

Hello @ismailezzaki96 and thank you for you comment. What is the source of your parameters ?

ismailezzaki96 commented 6 months ago

hi @kafiln , I live in morocco and I use these parameters with this script script to get prayer times since all other options are close source or need internet to work , to get fajr and dhuhr and asr and isha times you need just to find the current coordinates of the center of the city then use these parameters : Fajr Angle : 19.1 Isha Angle: 17 dhuhr: add 5 minutes

but for maghrib and sunrise you need to take into account the elevation and modified some parameters from the code above

kafiln commented 6 months ago

@ismailezzaki96 I tried your params but I got no success. Here is an exemple showing calculated result in red compared to data from the Ministry website. You can test it yourself here Screenshot 2024-04-07 055613 I do get sometimes closer values depending on the elevation of the city, that's why I really believe that the Moroccan ministry use it somehow in the calculation. @z3bi does the elevation of a location changes the times considerably ?