Closed iSWORD closed 2 years ago
Hello @iSWORD,
Thank you for the feedback.
In fact, this is a known issue for the method I implemented (see issue #19), the term s
here:
https://github.com/abougouffa/pyIslam/blob/5ed813b67b4414739ef914012e41b4bbad335d10/pyIslam/praytimes.py#L188-L190
Represents the s = cos(diff_time * 15)
, with delta_time
is the time shift to add to the Dohr time in order to calculate times for other prayers. The (atan(-s / sqrt(-s * s + 1)) + pi / 2))
part in the return line should be equivalent to acos(s)
; Although, I don't remember why I wrote it this way!
This time shift is then added to or subtracted from Dohr time to calculate times for other prayers. For example, in the _get_asr_time()
method:
The issue is, for zones with latitudes beyond [48.5 North, 48.5 South], the used method gives a value for s
which is not in the range [-1, 1], this means that the sun is either below the horizon or above the horizon for the whole day (which occurs in the zones beyond [48.5, 48.5S]).
In the issue number #19, I've listed two references which talks about this specific case; however, I didn't find the time to test and implement it. I will plan to do it during my vacation next June.
Thank you again for pointing this issue. Ramadan Mubarak!
Duplicate of #19
The following inputs:
will result in a
ValueError: math domain error
insidepraytimes@_get_time_for_angle
when trying to evaluatesqrt(-s * s + 1)
because the value of-s * s + 1
is negative.I wanted to submit a patch instead of reporting the issue but I have no idea what all the variables represent :(