mihrab-methods 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -6
- package/certification.json +22 -22
- package/data/corrections/indonesia.json +721 -28
- package/data/corrections/morocco.json +201 -914
- package/dist/cjs/authorities/morocco.js +7 -6
- package/dist/cjs/core/compute.js +1 -1
- package/dist/cjs/data/generated/algeriaCertification.js +1 -1
- package/dist/cjs/data/generated/diyanetCertification.js +1 -1
- package/dist/cjs/data/generated/diyanetWorldPoints.js +1 -1
- package/dist/cjs/data/generated/indonesiaCertification.js +1 -1
- package/dist/cjs/data/generated/indonesiaCorrections.js +1 -1
- package/dist/cjs/data/generated/moroccoCertification.js +1 -1
- package/dist/cjs/data/generated/moroccoCorrections.js +1 -1
- package/dist/cjs/data/generated/moroccoMethodPoints.js +1 -1
- package/dist/cjs/data/generated/swedenCertification.js +1 -1
- package/dist/cjs/methods/morocco.d.ts +43 -20
- package/dist/cjs/methods/morocco.js +59 -25
- package/dist/cjs/methods/revisions.d.ts +1 -1
- package/dist/cjs/methods/revisions.js +1 -1
- package/dist/cjs/server.d.ts +12 -0
- package/dist/cjs/server.js +132 -0
- package/dist/esm/authorities/morocco.js +7 -6
- package/dist/esm/core/compute.js +1 -1
- package/dist/esm/data/generated/algeriaCertification.js +1 -1
- package/dist/esm/data/generated/diyanetCertification.js +1 -1
- package/dist/esm/data/generated/diyanetWorldPoints.js +1 -1
- package/dist/esm/data/generated/indonesiaCertification.js +1 -1
- package/dist/esm/data/generated/indonesiaCorrections.js +1 -1
- package/dist/esm/data/generated/moroccoCertification.js +1 -1
- package/dist/esm/data/generated/moroccoCorrections.js +1 -1
- package/dist/esm/data/generated/moroccoMethodPoints.js +1 -1
- package/dist/esm/data/generated/swedenCertification.js +1 -1
- package/dist/esm/methods/morocco.d.ts +43 -20
- package/dist/esm/methods/morocco.js +54 -24
- package/dist/esm/methods/revisions.d.ts +1 -1
- package/dist/esm/methods/revisions.js +1 -1
- package/dist/esm/server.d.ts +12 -0
- package/dist/esm/server.js +126 -0
- package/docs/methods.md +24 -8
- package/package.json +3 -1
- package/dist/cjs/methods/scratch-congress.d.ts +0 -87
- package/dist/cjs/methods/scratch-congress.js +0 -539
- package/dist/esm/methods/scratch-congress.d.ts +0 -87
- package/dist/esm/methods/scratch-congress.js +0 -534
package/docs/methods.md
CHANGED
|
@@ -110,7 +110,11 @@ statement of it that gives the tables.
|
|
|
110
110
|
## Morocco
|
|
111
111
|
|
|
112
112
|
`src/methods/morocco.ts`. The Ministry of Habous and Islamic Affairs, read
|
|
113
|
-
off its tables for 164 cities
|
|
113
|
+
off its tables for 164 cities: 96 days of 2026 for all of them, and — through
|
|
114
|
+
the Internet Archive's copies of its pages — 2014 to 2025 for Rabat, Figuig,
|
|
115
|
+
Tangier, Casablanca, Laayoune and a dozen more, every month of the year. The
|
|
116
|
+
ministry's program changed between 2019 and 2023 (until then Asr was the
|
|
117
|
+
noon shadow on the true sun); this is the program it has used since.
|
|
114
118
|
|
|
115
119
|
- The sun is **Meeus's apparent sun** with the full nutation (the mean
|
|
116
120
|
elements above; apparent longitude `L0 + C − 0.00569 + Δψ`, with
|
|
@@ -118,14 +122,26 @@ off its tables for 164 cities.
|
|
|
118
122
|
and his chapter-28 equation of time
|
|
119
123
|
`E = L0 − 0.0057183 − α + Δψ cos ε`, taken at **each prayer's own
|
|
120
124
|
moment** (iterated), declination and equation of time alike.
|
|
121
|
-
- Fajr −19°, Isha −17°,
|
|
125
|
+
- Fajr −19°, Isha −17°, true altitudes.
|
|
122
126
|
- Dhuhr five minutes after the transit.
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
- Asr on the **apparent** sun, by the classical rule: with δ the noon
|
|
128
|
+
declination, the noon altitude `h = 90° − |φ − δ|` is raised by
|
|
129
|
+
refraction, `h' = h + R(h)`, `R(h) = 1.02′ / tan(h + 10.3/(h + 5.11))`
|
|
130
|
+
(Sæmundsson, Meeus 16.4, h in degrees); the gnomon's shadow is `cot h'`,
|
|
131
|
+
and Asr is when the apparent sun's shadow is one length more:
|
|
132
|
+
apparent altitude `a' = arctan(1 / (1 + cot h'))`, and the true altitude
|
|
133
|
+
the hour angle is solved for, `a = a' − R'(a')`,
|
|
134
|
+
`R'(a') = 1′ / tan(a' + 7.31/(a' + 4.4))` (Bennett, Meeus 16.3), with the
|
|
135
|
+
declination at the event. Hanafi takes two lengths.
|
|
136
|
+
- Sunrise one minute before, and Maghrib 1.8 minutes after, the sun on the
|
|
137
|
+
altitude `−(34′ + s) − dip`, with s the sun's semi-diameter for its
|
|
138
|
+
distance that day and dip the city's own horizon allowance — eastward at
|
|
139
|
+
sunrise (`Place.dipDeg`), westward at Maghrib (`Place.dipMaghribDeg`),
|
|
140
|
+
each fitted from the tables with the city's point. It is an angle: the
|
|
141
|
+
minutes it is worth grow towards the solstices, as the ministry's do.
|
|
142
|
+
It follows the city's height (92 % correlation), and a city not fitted
|
|
143
|
+
gets `0.32° + 0.025°·√height(m)` east and `0.37° + 0.021°·√height(m)`
|
|
144
|
+
west.
|
|
129
145
|
- Fajr rounded **down** to the minute, every other time to the nearest.
|
|
130
146
|
- The ministry's clock is GMT+1 until 17 September 2026 and GMT from then
|
|
131
147
|
on (`Place.clock`); the zone databases still move Morocco's clock, so the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mihrab-methods",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "The prayer-time authorities' own calculation methods, each reproducing its published timetable to the minute: Sweden (Diyanet, as Islamiska Förbundet prints it), Diyanet worldwide, Morocco (Habous), Algeria (Ministry of Religious Affairs), Indonesia (Kemenag).",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "Hassan El Ghamri",
|
|
@@ -169,6 +169,8 @@
|
|
|
169
169
|
"precertify": "npm run embed",
|
|
170
170
|
"certify": "tsx tools/certify.ts",
|
|
171
171
|
"vectors": "npm run embed && tsx tools/vectors.ts",
|
|
172
|
+
"prefeed-check": "npm run embed",
|
|
173
|
+
"feed-check": "tsx tools/feed-check.ts",
|
|
172
174
|
"readme": "node scripts/readme.mjs",
|
|
173
175
|
"preflight": "npm run typecheck && npm test && node scripts/readme.mjs --check",
|
|
174
176
|
"serve": "npm run embed && tsx tools/serve.ts"
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The International Prayer Times Congress method (Istanbul, 2021 — the
|
|
3
|
-
* Diyanet and the European Council for Fatwa and Research) as Diyanet's
|
|
4
|
-
* tables realise it. Islamiska Förbundet's Swedish tables are those
|
|
5
|
-
* tables, row for row, so this is Sweden's method (id 24).
|
|
6
|
-
*
|
|
7
|
-
* The published rules (awqatsalah.com, "Tespit Kriterleri"):
|
|
8
|
-
* - Dhuhr five minutes after transit; Asr one shadow (Dhuhr when the
|
|
9
|
-
* shadow never forms), four minutes late; sunrise seven early,
|
|
10
|
-
* Maghrib seven late ("temkin").
|
|
11
|
-
* - Neither the day nor the night is shorter than five hours.
|
|
12
|
-
* - True Fajr at 18°, true Isha at 16°. Where the 18° dawn no longer
|
|
13
|
-
* forms, the share of the night the sharia night's third took on the
|
|
14
|
-
* last day it did is carried: Isha that share of the night after
|
|
15
|
-
* Maghrib, Fajr the same share scaled by 18/16 before sunrise.
|
|
16
|
-
* - The move from true times to the carried ones is gradual, starting
|
|
17
|
-
* twenty minutes before (Isha) or after (Fajr) the takdir.
|
|
18
|
-
*
|
|
19
|
-
* What the tables turn out to do with them, read off Diyanet's own tables
|
|
20
|
-
* for all 160 Swedish places, 2024–2027 (99.98 % of times on the printed
|
|
21
|
-
* minute, the rest a fraction of a second from the rounding point):
|
|
22
|
-
* - The sun is taken once a day, at 0h UT less 45 s: Meeus's mean
|
|
23
|
-
* elements and equation of the centre, the TRUE (geometric) longitude,
|
|
24
|
-
* the apparent obliquity (mean plus nutation), the equation of time as
|
|
25
|
-
* the mean longitude less the right ascension, 0.106 s later; and
|
|
26
|
-
* two small waves by the mean longitude the formula leaves out: a few
|
|
27
|
-
* hundredths of a second on the transit, a tenth of an arc-second on
|
|
28
|
-
* the declination.
|
|
29
|
-
* - Coordinates are kept to three decimals of a degree.
|
|
30
|
-
* - Asr that never forms is printed at Dhuhr's time.
|
|
31
|
-
* - The night a share is taken of is the day's own: 24 h less the
|
|
32
|
-
* printed day, sunrise to Maghrib.
|
|
33
|
-
* - The five-hour floors hold each end separately, 150 minutes from the
|
|
34
|
-
* printed Dhuhr or from the midnight after it. Where midsummer's
|
|
35
|
-
* night is floored at both ends (to within a minute), that night
|
|
36
|
-
* anchors the season, and the floored times never step back: before
|
|
37
|
-
* midsummer no sunrise earlier than midsummer's and a floored Maghrib
|
|
38
|
-
* no earlier than the day before; after it no sunrise earlier nor
|
|
39
|
-
* Maghrib later than on any day since midsummer — and Fajr and Isha
|
|
40
|
-
* carried the same way.
|
|
41
|
-
* - The gradual transition is a straight line across the days next to
|
|
42
|
-
* the gap on which the true time lies within twenty minutes of the
|
|
43
|
-
* takdir at the gap's edge: twenty minutes away at the far end, the
|
|
44
|
-
* takdir at the edge.
|
|
45
|
-
*
|
|
46
|
-
* Beyond Sweden the same code gives Diyanet's tables worldwide, read off
|
|
47
|
-
* them for places on six continents:
|
|
48
|
-
* - Where the dawn forms all summer but midsummer's true Isha (at 16°)
|
|
49
|
-
* falls later than the share carried from that night, midsummer is the
|
|
50
|
-
* takdir's day — a gap of one day, with its ramps (from about 44.4°
|
|
51
|
-
* north: Austria, central France, northern Bosnia).
|
|
52
|
-
* - Isha is printed at 16° in some countries and 17° in others; the
|
|
53
|
-
* high-latitude rules are worked at 16° either way (`ishaDeg`).
|
|
54
|
-
*
|
|
55
|
-
* Times are minutes past 0h UT of the date, a frame the clock changes
|
|
56
|
-
* cannot bend; `congressTimes` turns them into instants.
|
|
57
|
-
*/
|
|
58
|
-
/**
|
|
59
|
-
* Isha's depression: the Congress's 16° (Diyanet's in much of Europe,
|
|
60
|
-
* Russia, Central Asia, China and North America), or Diyanet's own 17°
|
|
61
|
-
* (elsewhere). The high-latitude rules are the Congress's at 16° either way;
|
|
62
|
-
* the angle sets only the true Isha printed.
|
|
63
|
-
*/
|
|
64
|
-
export declare const CONGRESS_ISHA_DEG = 16;
|
|
65
|
-
export declare const DIYANET_ISHA_DEG = 17;
|
|
66
|
-
export type CongressInstants = {
|
|
67
|
-
fajr: Date;
|
|
68
|
-
sunrise: Date;
|
|
69
|
-
dhuhr: Date;
|
|
70
|
-
asr: Date;
|
|
71
|
-
maghrib: Date;
|
|
72
|
-
isha: Date;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* The Congress method's times for a calendar date (year, month 0–11, day),
|
|
76
|
-
* as instants, unrounded. `asrShadow` is 1 for the standard Asr, 2 for the
|
|
77
|
-
* Hanafi one; the tables print the standard. `ishaDeg` is Isha's depression:
|
|
78
|
-
* 16° (the Congress's, Diyanet's in Europe and North America) or 17°
|
|
79
|
-
* (Diyanet's everywhere else).
|
|
80
|
-
*/
|
|
81
|
-
export declare function congressTimes(latitude: number, longitude: number, year: number, month: number, day: number, asrShadow?: number, ishaDeg?: number): CongressInstants;
|
|
82
|
-
/** For tests and the verification tool: the year's structure as the method sees it. */
|
|
83
|
-
export declare function congressYearInfo(latitude: number, longitude: number, year: number): {
|
|
84
|
-
gap: [string, string] | null;
|
|
85
|
-
ratio: number | null;
|
|
86
|
-
midsummerFloors: boolean;
|
|
87
|
-
};
|