uchagani / prayer-times-calculator

Python wrapper around https://aladhan.com. Created to be used by Home Assistant.
MIT License
15 stars 16 forks source link

Can't get right times #7

Closed fuzunspm closed 3 years ago

fuzunspm commented 3 years ago

Hi,

I coulnd't get correct times with my settings below.

Fajr: 0 minutes Sunrise: +8 minutes Dhuhr: -5 minutes Asr: +38 minutes Maghrib: -9 minutes Isha: -2 minutes

I'm comparing official timings of 13 (Turkey) for the same location

my settings:

calc_method = "turkey"
date = datetime.now().strftime("%Y-%m-%d")
school = "hanafi"
midnightMode = "jafari"
latitudeAdjustmentMethod = "one seventh"
tune = False
imsak_tune = 0
fajr_tune = 0
sunrise_tune = 0
dhuhr_tune = 0
asr_tune = 0
maghrib_tune = 0
sunset_tune = 0
isha_tune = 0
midnight_tune = 0
fajr_angle = 15
maghrib_angle = None
isha_angle = 15
uchagani commented 3 years ago

@dheche can you help?

dheche commented 3 years ago

I'm comparing official timings of 13 (Turkey) for the same location

Can i get the url of turkey official timing ? can i get you latitude and longitude settings?

fuzunspm commented 3 years ago

https://namazvakitleri.diyanet.gov.tr/en-US/9954/karadeniz-eregli-icin-namaz-vakti

lat = 41.2064
long = 31.4491
dheche commented 3 years ago

I think we should ask aladhan.com, because this library only call aladhan api.

curl --location --request GET 'http://api.aladhan.com/v1/timings/2020-10-28?latitude=41.2064&longitude=31.4491&method=13&school=1&midnightMode=1&latitudeAdjustmentMethod=2'
{
    "code": 200,
    "status": "OK",
    "data": {
        "timings": {
            "Fajr": "05:48",
            "Sunrise": "07:21",
            "Dhuhr": "12:38",
            "Asr": "16:13",
            "Sunset": "17:54",
            "Maghrib": "17:54",
            "Isha": "19:22",
            "Imsak": "05:38",
            "Midnight": "23:51"
        },
        "date": {
            "readable": "28 Oct 2028",
            "timestamp": "1856300400",
            "hijri": {
                "date": "09-06-1450",
                "format": "DD-MM-YYYY",
                "day": "09",
                "weekday": {
                    "en": "Al Sabt",
                    "ar": "السبت"
                },
                "month": {
                    "number": 6,
                    "en": "Jumādá al-ākhirah",
                    "ar": "جُمادى الآخرة"
                },
                "year": "1450",
                "designation": {
                    "abbreviated": "AH",
                    "expanded": "Anno Hegirae"
                },
                "holidays": []
            },
            "gregorian": {
                "date": "28-10-2028",
                "format": "DD-MM-YYYY",
                "day": "28",
                "weekday": {
                    "en": "Saturday"
                },
                "month": {
                    "number": 10,
                    "en": "October"
                },
                "year": "2028",
                "designation": {
                    "abbreviated": "AD",
                    "expanded": "Anno Domini"
                }
            }
        },
        "meta": {
            "latitude": 41.2064,
            "longitude": 31.4491,
            "timezone": "Europe/Istanbul",
            "method": {
                "id": 13,
                "name": "Diyanet İşleri Başkanlığı, Turkey",
                "params": {
                    "Fajr": 18,
                    "Isha": 17
                }
            },
            "latitudeAdjustmentMethod": "ONE_SEVENTH",
            "midnightMode": "JAFARI",
            "school": "HANAFI",
            "offset": {
                "Imsak": 0,
                "Fajr": 0,
                "Sunrise": 0,
                "Dhuhr": 0,
                "Asr": 0,
                "Maghrib": 0,
                "Sunset": 0,
                "Isha": 0,
                "Midnight": 0
            }
        }
    }
}
dheche commented 3 years ago

Can you try this settings?

calc_method = "custom"
date = datetime.now().strftime("%Y-%m-%d")
school = "hanafi"
midnightMode = "jafari"
latitudeAdjustmentMethod = "angle based"
tune = True
imsak_tune = 0
fajr_tune = 0
sunrise_tune = -8
dhuhr_tune = 5
asr_tune = -38
maghrib_tune = 9
sunset_tune = 2
isha_tune = 0
midnight_tune = 0
fajr_angle = 18
maghrib_angle = None
isha_angle = 17
fuzunspm commented 3 years ago

yes it's ok with these adjustments