mihrab-methods 0.0.0-stage → 1.0.1
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/LICENSE +373 -0
- package/README.md +319 -2
- package/certification.json +120 -0
- package/data/corrections/algeria.json +784 -0
- package/data/corrections/diyanet.json +18444 -0
- package/data/corrections/indonesia.json +210 -0
- package/data/corrections/morocco.json +993 -0
- package/data/corrections/sweden.json +516 -0
- package/dist/cjs/algeria.d.ts +4 -0
- package/dist/cjs/algeria.js +22 -0
- package/dist/cjs/authorities/algeria.d.ts +3 -0
- package/dist/cjs/authorities/algeria.js +57 -0
- package/dist/cjs/authorities/diyanet.d.ts +9 -0
- package/dist/cjs/authorities/diyanet.js +90 -0
- package/dist/cjs/authorities/indonesia.d.ts +4 -0
- package/dist/cjs/authorities/indonesia.js +82 -0
- package/dist/cjs/authorities/morocco.d.ts +5 -0
- package/dist/cjs/authorities/morocco.js +65 -0
- package/dist/cjs/authorities/slug.d.ts +2 -0
- package/dist/cjs/authorities/slug.js +17 -0
- package/dist/cjs/authorities/sweden.d.ts +3 -0
- package/dist/cjs/authorities/sweden.js +58 -0
- package/dist/cjs/core/api.d.ts +61 -0
- package/dist/cjs/core/api.js +177 -0
- package/dist/cjs/core/civilDate.d.ts +17 -0
- package/dist/cjs/core/civilDate.js +41 -0
- package/dist/cjs/core/clock.d.ts +22 -0
- package/dist/cjs/core/clock.js +67 -0
- package/dist/cjs/core/compute.d.ts +10 -0
- package/dist/cjs/core/compute.js +59 -0
- package/dist/cjs/core/correctionList.d.ts +25 -0
- package/dist/cjs/core/correctionList.js +62 -0
- package/dist/cjs/core/fetchLatest.d.ts +61 -0
- package/dist/cjs/core/fetchLatest.js +192 -0
- package/dist/cjs/core/index.d.ts +14 -0
- package/dist/cjs/core/index.js +45 -0
- package/dist/cjs/core/registry.d.ts +28 -0
- package/dist/cjs/core/registry.js +34 -0
- package/dist/cjs/core/types.d.ts +193 -0
- package/dist/cjs/core/types.js +22 -0
- package/dist/cjs/core.d.ts +2 -0
- package/dist/cjs/core.js +18 -0
- package/dist/cjs/data/generated/algeriaCertification.d.ts +3 -0
- package/dist/cjs/data/generated/algeriaCertification.js +4 -0
- package/dist/cjs/data/generated/algeriaCities.d.ts +8 -0
- package/dist/cjs/data/generated/algeriaCities.js +5 -0
- package/dist/cjs/data/generated/algeriaCorrections.d.ts +3 -0
- package/dist/cjs/data/generated/algeriaCorrections.js +4 -0
- package/dist/cjs/data/generated/algeriaMethodPoints.d.ts +2 -0
- package/dist/cjs/data/generated/algeriaMethodPoints.js +5 -0
- package/dist/cjs/data/generated/countryOutlines.d.ts +5 -0
- package/dist/cjs/data/generated/countryOutlines.js +5 -0
- package/dist/cjs/data/generated/diyanetCertification.d.ts +3 -0
- package/dist/cjs/data/generated/diyanetCertification.js +4 -0
- package/dist/cjs/data/generated/diyanetCorrections.d.ts +3 -0
- package/dist/cjs/data/generated/diyanetCorrections.js +4 -0
- package/dist/cjs/data/generated/diyanetCountries.d.ts +5 -0
- package/dist/cjs/data/generated/diyanetCountries.js +5 -0
- package/dist/cjs/data/generated/diyanetTurkeyPoints.d.ts +7 -0
- package/dist/cjs/data/generated/diyanetTurkeyPoints.js +5 -0
- package/dist/cjs/data/generated/diyanetWorldPoints.d.ts +10 -0
- package/dist/cjs/data/generated/diyanetWorldPoints.js +5 -0
- package/dist/cjs/data/generated/indonesiaCertification.d.ts +3 -0
- package/dist/cjs/data/generated/indonesiaCertification.js +4 -0
- package/dist/cjs/data/generated/indonesiaCorrections.d.ts +3 -0
- package/dist/cjs/data/generated/indonesiaCorrections.js +4 -0
- package/dist/cjs/data/generated/kemenagMethodPoints.d.ts +2 -0
- package/dist/cjs/data/generated/kemenagMethodPoints.js +5 -0
- package/dist/cjs/data/generated/kemenagPlaces.d.ts +8 -0
- package/dist/cjs/data/generated/kemenagPlaces.js +5 -0
- package/dist/cjs/data/generated/moroccoCertification.d.ts +3 -0
- package/dist/cjs/data/generated/moroccoCertification.js +4 -0
- package/dist/cjs/data/generated/moroccoCities.d.ts +8 -0
- package/dist/cjs/data/generated/moroccoCities.js +5 -0
- package/dist/cjs/data/generated/moroccoCorrections.d.ts +3 -0
- package/dist/cjs/data/generated/moroccoCorrections.js +4 -0
- package/dist/cjs/data/generated/moroccoMethodPoints.d.ts +2 -0
- package/dist/cjs/data/generated/moroccoMethodPoints.js +5 -0
- package/dist/cjs/data/generated/swedenCertification.d.ts +3 -0
- package/dist/cjs/data/generated/swedenCertification.js +4 -0
- package/dist/cjs/data/generated/swedenCorrections.d.ts +3 -0
- package/dist/cjs/data/generated/swedenCorrections.js +4 -0
- package/dist/cjs/data/generated/swedenPlaces.d.ts +5 -0
- package/dist/cjs/data/generated/swedenPlaces.js +5 -0
- package/dist/cjs/diyanet.d.ts +4 -0
- package/dist/cjs/diyanet.js +22 -0
- package/dist/cjs/index.d.ts +19 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/indonesia.d.ts +4 -0
- package/dist/cjs/indonesia.js +22 -0
- package/dist/cjs/locate.d.ts +21 -0
- package/dist/cjs/locate.js +204 -0
- package/dist/cjs/methods/algeria.d.ts +56 -0
- package/dist/cjs/methods/algeria.js +119 -0
- package/dist/cjs/methods/indonesia.d.ts +31 -0
- package/dist/cjs/methods/indonesia.js +94 -0
- package/dist/cjs/methods/morocco.d.ts +61 -0
- package/dist/cjs/methods/morocco.js +113 -0
- package/dist/cjs/methods/revisions.d.ts +15 -0
- package/dist/cjs/methods/revisions.js +18 -0
- package/dist/cjs/methods/scratch-congress.d.ts +87 -0
- package/dist/cjs/methods/scratch-congress.js +539 -0
- package/dist/cjs/methods/sweden.d.ts +88 -0
- package/dist/cjs/methods/sweden.js +568 -0
- package/dist/cjs/morocco.d.ts +4 -0
- package/dist/cjs/morocco.js +22 -0
- package/dist/cjs/sun/preciseSun.d.ts +19 -0
- package/dist/cjs/sun/preciseSun.js +185 -0
- package/dist/cjs/sweden.d.ts +4 -0
- package/dist/cjs/sweden.js +22 -0
- package/dist/esm/algeria.d.ts +4 -0
- package/dist/esm/algeria.js +4 -0
- package/dist/esm/authorities/algeria.d.ts +3 -0
- package/dist/esm/authorities/algeria.js +51 -0
- package/dist/esm/authorities/diyanet.d.ts +9 -0
- package/dist/esm/authorities/diyanet.js +83 -0
- package/dist/esm/authorities/indonesia.d.ts +4 -0
- package/dist/esm/authorities/indonesia.js +75 -0
- package/dist/esm/authorities/morocco.d.ts +5 -0
- package/dist/esm/authorities/morocco.js +59 -0
- package/dist/esm/authorities/slug.d.ts +2 -0
- package/dist/esm/authorities/slug.js +14 -0
- package/dist/esm/authorities/sweden.d.ts +3 -0
- package/dist/esm/authorities/sweden.js +52 -0
- package/dist/esm/core/api.d.ts +61 -0
- package/dist/esm/core/api.js +163 -0
- package/dist/esm/core/civilDate.d.ts +17 -0
- package/dist/esm/core/civilDate.js +36 -0
- package/dist/esm/core/clock.d.ts +22 -0
- package/dist/esm/core/clock.js +60 -0
- package/dist/esm/core/compute.d.ts +10 -0
- package/dist/esm/core/compute.js +56 -0
- package/dist/esm/core/correctionList.d.ts +25 -0
- package/dist/esm/core/correctionList.js +56 -0
- package/dist/esm/core/fetchLatest.d.ts +61 -0
- package/dist/esm/core/fetchLatest.js +184 -0
- package/dist/esm/core/index.d.ts +14 -0
- package/dist/esm/core/index.js +14 -0
- package/dist/esm/core/registry.d.ts +28 -0
- package/dist/esm/core/registry.js +28 -0
- package/dist/esm/core/types.d.ts +193 -0
- package/dist/esm/core/types.js +18 -0
- package/dist/esm/core.d.ts +2 -0
- package/dist/esm/core.js +2 -0
- package/dist/esm/data/generated/algeriaCertification.d.ts +3 -0
- package/dist/esm/data/generated/algeriaCertification.js +2 -0
- package/dist/esm/data/generated/algeriaCities.d.ts +8 -0
- package/dist/esm/data/generated/algeriaCities.js +3 -0
- package/dist/esm/data/generated/algeriaCorrections.d.ts +3 -0
- package/dist/esm/data/generated/algeriaCorrections.js +2 -0
- package/dist/esm/data/generated/algeriaMethodPoints.d.ts +2 -0
- package/dist/esm/data/generated/algeriaMethodPoints.js +3 -0
- package/dist/esm/data/generated/countryOutlines.d.ts +5 -0
- package/dist/esm/data/generated/countryOutlines.js +3 -0
- package/dist/esm/data/generated/diyanetCertification.d.ts +3 -0
- package/dist/esm/data/generated/diyanetCertification.js +2 -0
- package/dist/esm/data/generated/diyanetCorrections.d.ts +3 -0
- package/dist/esm/data/generated/diyanetCorrections.js +2 -0
- package/dist/esm/data/generated/diyanetCountries.d.ts +5 -0
- package/dist/esm/data/generated/diyanetCountries.js +3 -0
- package/dist/esm/data/generated/diyanetTurkeyPoints.d.ts +7 -0
- package/dist/esm/data/generated/diyanetTurkeyPoints.js +3 -0
- package/dist/esm/data/generated/diyanetWorldPoints.d.ts +10 -0
- package/dist/esm/data/generated/diyanetWorldPoints.js +3 -0
- package/dist/esm/data/generated/indonesiaCertification.d.ts +3 -0
- package/dist/esm/data/generated/indonesiaCertification.js +2 -0
- package/dist/esm/data/generated/indonesiaCorrections.d.ts +3 -0
- package/dist/esm/data/generated/indonesiaCorrections.js +2 -0
- package/dist/esm/data/generated/kemenagMethodPoints.d.ts +2 -0
- package/dist/esm/data/generated/kemenagMethodPoints.js +3 -0
- package/dist/esm/data/generated/kemenagPlaces.d.ts +8 -0
- package/dist/esm/data/generated/kemenagPlaces.js +3 -0
- package/dist/esm/data/generated/moroccoCertification.d.ts +3 -0
- package/dist/esm/data/generated/moroccoCertification.js +2 -0
- package/dist/esm/data/generated/moroccoCities.d.ts +8 -0
- package/dist/esm/data/generated/moroccoCities.js +3 -0
- package/dist/esm/data/generated/moroccoCorrections.d.ts +3 -0
- package/dist/esm/data/generated/moroccoCorrections.js +2 -0
- package/dist/esm/data/generated/moroccoMethodPoints.d.ts +2 -0
- package/dist/esm/data/generated/moroccoMethodPoints.js +3 -0
- package/dist/esm/data/generated/swedenCertification.d.ts +3 -0
- package/dist/esm/data/generated/swedenCertification.js +2 -0
- package/dist/esm/data/generated/swedenCorrections.d.ts +3 -0
- package/dist/esm/data/generated/swedenCorrections.js +2 -0
- package/dist/esm/data/generated/swedenPlaces.d.ts +5 -0
- package/dist/esm/data/generated/swedenPlaces.js +3 -0
- package/dist/esm/diyanet.d.ts +4 -0
- package/dist/esm/diyanet.js +4 -0
- package/dist/esm/index.d.ts +19 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/indonesia.d.ts +4 -0
- package/dist/esm/indonesia.js +4 -0
- package/dist/esm/locate.d.ts +21 -0
- package/dist/esm/locate.js +196 -0
- package/dist/esm/methods/algeria.d.ts +56 -0
- package/dist/esm/methods/algeria.js +114 -0
- package/dist/esm/methods/indonesia.d.ts +31 -0
- package/dist/esm/methods/indonesia.js +90 -0
- package/dist/esm/methods/morocco.d.ts +61 -0
- package/dist/esm/methods/morocco.js +107 -0
- package/dist/esm/methods/revisions.d.ts +15 -0
- package/dist/esm/methods/revisions.js +15 -0
- package/dist/esm/methods/scratch-congress.d.ts +87 -0
- package/dist/esm/methods/scratch-congress.js +534 -0
- package/dist/esm/methods/sweden.d.ts +88 -0
- package/dist/esm/methods/sweden.js +563 -0
- package/dist/esm/morocco.d.ts +4 -0
- package/dist/esm/morocco.js +4 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/sun/preciseSun.d.ts +19 -0
- package/dist/esm/sun/preciseSun.js +181 -0
- package/dist/esm/sweden.d.ts +4 -0
- package/dist/esm/sweden.js +4 -0
- package/docs/methods.md +190 -0
- package/package.json +178 -4
- package/schemas/certification.schema.json +59 -0
- package/schemas/corrections.schema.json +29 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* A precise apparent Sun: the Earth's VSOP87 series (truncated), IAU 2006
|
|
4
|
+
* precession, IAU 2000B nutation and light time, after Don Cross's
|
|
5
|
+
* Astronomy Engine (MIT licence). It agrees with JPL DE421 to about 0.05 s
|
|
6
|
+
* in the equation of time and 0.5″ in declination, where Meeus's short
|
|
7
|
+
* series (`meeusApparentSun`) drifts by about a second over the year —
|
|
8
|
+
* enough to move a published minute.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.deltaT = deltaT;
|
|
12
|
+
exports.preciseApparentSun = preciseApparentSun;
|
|
13
|
+
const ASEC2RAD = 4.848136811095359935899141e-6;
|
|
14
|
+
const ASEC360 = 1296000;
|
|
15
|
+
const DEG = Math.PI / 180;
|
|
16
|
+
const C_AUDAY = 173.1446326846693;
|
|
17
|
+
const DAYS_PER_MILLENNIUM = 365250;
|
|
18
|
+
/** Heliocentric ecliptic (J2000) longitude, latitude and radius of the Earth: [ampl, phase, freq] per power of t. */
|
|
19
|
+
const EARTH = [
|
|
20
|
+
[
|
|
21
|
+
[
|
|
22
|
+
[1.75347045673, 0, 0], [0.03341656453, 4.66925680415, 6283.0758499914], [0.00034894275, 4.62610242189, 12566.1516999828],
|
|
23
|
+
[0.00003417572, 2.82886579754, 3.523118349], [0.00003497056, 2.74411783405, 5753.3848848968], [0.00003135899, 3.62767041756, 77713.7714681205],
|
|
24
|
+
[0.00002676218, 4.41808345438, 7860.4193924392], [0.00002342691, 6.13516214446, 3930.2096962196], [0.00001273165, 2.03709657878, 529.6909650946],
|
|
25
|
+
[0.00001324294, 0.74246341673, 11506.7697697936], [0.00000901854, 2.04505446477, 26.2983197998], [0.00001199167, 1.10962946234, 1577.3435424478],
|
|
26
|
+
[0.00000857223, 3.50849152283, 398.1490034082], [0.00000779786, 1.17882681962, 5223.6939198022], [0.0000099025, 5.23268072088, 5884.9268465832],
|
|
27
|
+
[0.00000753141, 2.53339052847, 5507.5532386674], [0.00000505267, 4.58292599973, 18849.2275499742], [0.00000492392, 4.20505711826, 775.522611324],
|
|
28
|
+
[0.00000356672, 2.91954114478, 0.0673103028], [0.00000284125, 1.89869240932, 796.2980068164], [0.00000242879, 0.34481445893, 5486.777843175],
|
|
29
|
+
[0.00000317087, 5.84901948512, 11790.6290886588], [0.00000271112, 0.31486255375, 10977.078804699], [0.00000206217, 4.80646631478, 2544.3144198834],
|
|
30
|
+
[0.00000205478, 1.86953770281, 5573.1428014331], [0.00000202318, 2.45767790232, 6069.7767545534], [0.00000126225, 1.08295459501, 20.7753954924],
|
|
31
|
+
[0.00000155516, 0.83306084617, 213.299095438],
|
|
32
|
+
],
|
|
33
|
+
[[6283.0758499914, 0, 0], [0.00206058863, 2.67823455808, 6283.0758499914], [0.00004303419, 2.63512233481, 12566.1516999828]],
|
|
34
|
+
[[0.00008721859, 1.07253635559, 6283.0758499914]],
|
|
35
|
+
],
|
|
36
|
+
[[], [[0.00227777722, 3.4137662053, 6283.0758499914], [0.00003805678, 3.37063423795, 12566.1516999828]]],
|
|
37
|
+
[
|
|
38
|
+
[
|
|
39
|
+
[1.00013988784, 0, 0], [0.01670699632, 3.09846350258, 6283.0758499914], [0.00013956024, 3.05524609456, 12566.1516999828],
|
|
40
|
+
[0.0000308372, 5.19846674381, 77713.7714681205], [0.00001628463, 1.17387558054, 5753.3848848968], [0.00001575572, 2.84685214877, 7860.4193924392],
|
|
41
|
+
[0.00000924799, 5.45292236722, 11506.7697697936], [0.00000542439, 4.56409151453, 3930.2096962196], [0.0000047211, 3.66100022149, 5884.9268465832],
|
|
42
|
+
[0.00000085831, 1.27079125277, 161000.6857376741], [0.00000057056, 2.01374292245, 83996.84731811189], [0.00000055736, 5.2415979917, 71430.69561812909],
|
|
43
|
+
[0.00000174844, 3.01193636733, 18849.2275499742], [0.00000243181, 4.2734953079, 11790.6290886588],
|
|
44
|
+
],
|
|
45
|
+
[[0.00103018607, 1.10748968172, 6283.0758499914], [0.00001721238, 1.06442300386, 12566.1516999828]],
|
|
46
|
+
[[0.00004359385, 5.78455133808, 6283.0758499914]],
|
|
47
|
+
],
|
|
48
|
+
];
|
|
49
|
+
function vsop(formula, t, clamp) {
|
|
50
|
+
let tp = 1;
|
|
51
|
+
let out = 0;
|
|
52
|
+
for (const series of formula) {
|
|
53
|
+
let sum = 0;
|
|
54
|
+
for (const [a, p, f] of series)
|
|
55
|
+
sum += a * Math.cos(p + t * f);
|
|
56
|
+
let incr = tp * sum;
|
|
57
|
+
if (clamp)
|
|
58
|
+
incr %= 2 * Math.PI;
|
|
59
|
+
out += incr;
|
|
60
|
+
tp *= t;
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
/** Earth−J2000 equatorial position (AU) at `tt` days from J2000. */
|
|
65
|
+
function earthJ2000(tt) {
|
|
66
|
+
const t = tt / DAYS_PER_MILLENNIUM;
|
|
67
|
+
const lon = vsop(EARTH[0], t, true);
|
|
68
|
+
const lat = vsop(EARTH[1], t, false);
|
|
69
|
+
const r = vsop(EARTH[2], t, false);
|
|
70
|
+
const x = r * Math.cos(lat) * Math.cos(lon);
|
|
71
|
+
const y = r * Math.cos(lat) * Math.sin(lon);
|
|
72
|
+
const z = r * Math.sin(lat);
|
|
73
|
+
return [
|
|
74
|
+
x + 0.00000044036 * y - 0.000000190919 * z,
|
|
75
|
+
-0.000000479966 * x + 0.917482137087 * y - 0.397776982902 * z,
|
|
76
|
+
0.397776982902 * y + 0.917482137087 * z,
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
/** ΔT (s), Espenak & Meeus, for UT days from J2000 — held at its 2017 value onward (about 69 s, as observed), as JPL Horizons does. */
|
|
80
|
+
function deltaT(ut) {
|
|
81
|
+
const y = 2000 + (Math.min(ut, 17 * 365.24217) - 14) / 365.24217;
|
|
82
|
+
if (y >= 2005 && y < 2050) {
|
|
83
|
+
const u = y - 2000;
|
|
84
|
+
return 62.92 + 0.32217 * u + 0.005589 * u * u;
|
|
85
|
+
}
|
|
86
|
+
if (y >= 2050 && y < 2150) {
|
|
87
|
+
const u = (y - 1820) / 100;
|
|
88
|
+
return -20 + 32 * u * u - 0.5628 * (2150 - y);
|
|
89
|
+
}
|
|
90
|
+
if (y >= 1986 && y < 2005) {
|
|
91
|
+
const u = y - 2000;
|
|
92
|
+
return 63.86 + 0.3345 * u - 0.060374 * u ** 2 + 0.0017275 * u ** 3 + 0.000651814 * u ** 4 + 0.00002373599 * u ** 5;
|
|
93
|
+
}
|
|
94
|
+
const u = (y - 1820) / 100;
|
|
95
|
+
return -20 + 32 * u * u;
|
|
96
|
+
}
|
|
97
|
+
function nutation(tt) {
|
|
98
|
+
const mod = (x) => (x % ASEC360) * ASEC2RAD;
|
|
99
|
+
const t = tt / 36525;
|
|
100
|
+
const elp = mod(1287104.79305 + t * 129596581.0481);
|
|
101
|
+
const f = mod(335779.526232 + t * 1739527262.8478);
|
|
102
|
+
const d = mod(1072260.70369 + t * 1602961601.209);
|
|
103
|
+
const om = mod(450160.398036 - t * 6962890.5431);
|
|
104
|
+
let dp = (-172064161.0 - 174666.0 * t) * Math.sin(om) + 33386.0 * Math.cos(om);
|
|
105
|
+
let de = (92052331.0 + 9086.0 * t) * Math.cos(om) + 15377.0 * Math.sin(om);
|
|
106
|
+
let a = 2 * (f - d + om);
|
|
107
|
+
dp += (-13170906.0 - 1675.0 * t) * Math.sin(a) - 13696.0 * Math.cos(a);
|
|
108
|
+
de += (5730336.0 - 3015.0 * t) * Math.cos(a) - 4587.0 * Math.sin(a);
|
|
109
|
+
a = 2 * (f + om);
|
|
110
|
+
dp += (-2276413.0 - 234.0 * t) * Math.sin(a) + 2796.0 * Math.cos(a);
|
|
111
|
+
de += (978459.0 - 485.0 * t) * Math.cos(a) + 1374.0 * Math.sin(a);
|
|
112
|
+
a = 2 * om;
|
|
113
|
+
dp += (2074554.0 + 207.0 * t) * Math.sin(a) - 698.0 * Math.cos(a);
|
|
114
|
+
de += (-897492.0 + 470.0 * t) * Math.cos(a) - 291.0 * Math.sin(a);
|
|
115
|
+
dp += (1475877.0 - 3633.0 * t) * Math.sin(elp) + 11817.0 * Math.cos(elp);
|
|
116
|
+
de += (73871.0 - 184.0 * t) * Math.cos(elp) - 1924.0 * Math.sin(elp);
|
|
117
|
+
return { dpsi: -0.000135 + dp * 1e-7, deps: 0.000388 + de * 1e-7 };
|
|
118
|
+
}
|
|
119
|
+
function meanObliquity(tt) {
|
|
120
|
+
const t = tt / 36525;
|
|
121
|
+
return ((((-0.0000000434 * t - 0.000000576) * t + 0.0020034) * t - 0.0001831) * t - 46.836769) * t + 84381.406;
|
|
122
|
+
}
|
|
123
|
+
/** J2000 equatorial → mean equator and equinox of date (IAU 2006). */
|
|
124
|
+
function precess(v, tt) {
|
|
125
|
+
const t = tt / 36525;
|
|
126
|
+
const eps0 = 84381.406 * ASEC2RAD;
|
|
127
|
+
const psia = (((((-0.0000000951 * t + 0.000132851) * t - 0.00114045) * t - 1.0790069) * t + 5038.481507) * t) * ASEC2RAD;
|
|
128
|
+
const omegaa = (((((0.0000003337 * t - 0.000000467) * t - 0.00772503) * t + 0.0512623) * t - 0.025754) * t + 84381.406) * ASEC2RAD;
|
|
129
|
+
const chia = (((((-0.000000056 * t + 0.000170663) * t - 0.00121197) * t - 2.3814292) * t + 10.556403) * t) * ASEC2RAD;
|
|
130
|
+
const sa = Math.sin(eps0), ca = Math.cos(eps0);
|
|
131
|
+
const sb = Math.sin(-psia), cb = Math.cos(-psia);
|
|
132
|
+
const sc = Math.sin(-omegaa), cc = Math.cos(-omegaa);
|
|
133
|
+
const sd = Math.sin(chia), cd = Math.cos(chia);
|
|
134
|
+
const xx = cd * cb - sb * sd * cc;
|
|
135
|
+
const yx = cd * sb * ca + sd * cc * cb * ca - sa * sd * sc;
|
|
136
|
+
const zx = cd * sb * sa + sd * cc * cb * sa + ca * sd * sc;
|
|
137
|
+
const xy = -sd * cb - sb * cd * cc;
|
|
138
|
+
const yy = -sd * sb * ca + cd * cc * cb * ca - sa * cd * sc;
|
|
139
|
+
const zy = -sd * sb * sa + cd * cc * cb * sa + ca * cd * sc;
|
|
140
|
+
const xz = sb * sc;
|
|
141
|
+
const yz = -sc * cb * ca - sa * cc;
|
|
142
|
+
const zz = -sc * cb * sa + cc * ca;
|
|
143
|
+
return [xx * v[0] + yx * v[1] + zx * v[2], xy * v[0] + yy * v[1] + zy * v[2], xz * v[0] + yz * v[1] + zz * v[2]];
|
|
144
|
+
}
|
|
145
|
+
/** Mean → true equator and equinox of date. */
|
|
146
|
+
function nutate(v, oblm, oblt, psi) {
|
|
147
|
+
const cobm = Math.cos(oblm), sobm = Math.sin(oblm);
|
|
148
|
+
const cobt = Math.cos(oblt), sobt = Math.sin(oblt);
|
|
149
|
+
const cpsi = Math.cos(psi), spsi = Math.sin(psi);
|
|
150
|
+
const xx = cpsi;
|
|
151
|
+
const yx = -spsi * cobm;
|
|
152
|
+
const zx = -spsi * sobm;
|
|
153
|
+
const xy = spsi * cobt;
|
|
154
|
+
const yy = cpsi * cobm * cobt + sobm * sobt;
|
|
155
|
+
const zy = cpsi * sobm * cobt - cobm * sobt;
|
|
156
|
+
const xz = spsi * sobt;
|
|
157
|
+
const yz = cpsi * cobm * sobt - sobm * cobt;
|
|
158
|
+
const zz = cpsi * sobm * sobt + cobm * cobt;
|
|
159
|
+
return [xx * v[0] + yx * v[1] + zx * v[2], xy * v[0] + yy * v[1] + zy * v[2], xz * v[0] + yz * v[1] + zz * v[2]];
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The apparent Sun at `d` days from J2000.0 (UT): declination (rad) and
|
|
163
|
+
* equation of time (minutes), such that the transit at longitude λ (east) is
|
|
164
|
+
* 720 − 4λ − eot minutes UT. Same contract as `meeusApparentSun`.
|
|
165
|
+
*/
|
|
166
|
+
function preciseApparentSun(d) {
|
|
167
|
+
const tt = d + deltaT(d) / 86400;
|
|
168
|
+
const e = earthJ2000(tt - 1 / C_AUDAY);
|
|
169
|
+
const nut = nutation(tt);
|
|
170
|
+
const mobl = meanObliquity(tt);
|
|
171
|
+
const oblm = (mobl / 3600) * DEG;
|
|
172
|
+
const oblt = ((mobl + nut.deps) / 3600) * DEG;
|
|
173
|
+
const v = nutate(precess([-e[0], -e[1], -e[2]], tt), oblm, oblt, nut.dpsi * ASEC2RAD);
|
|
174
|
+
const ra = Math.atan2(v[1], v[0]) / DEG;
|
|
175
|
+
const dec = Math.atan2(v[2], Math.hypot(v[0], v[1]));
|
|
176
|
+
// Greenwich apparent sidereal time (degrees): Earth rotation angle + the precession and equation of the equinoxes.
|
|
177
|
+
const t = tt / 36525;
|
|
178
|
+
const era = 360 * (((0.779057273264 + 0.00273781191135448 * d + (d % 1)) % 1) + 1);
|
|
179
|
+
const eqeq = nut.dpsi * Math.cos(oblm);
|
|
180
|
+
const st = eqeq + 0.014506 + ((((-0.0000000368 * t - 0.000029956) * t - 0.00000044) * t + 1.3915817) * t + 4612.156534) * t;
|
|
181
|
+
const gast = era + st / 3600;
|
|
182
|
+
const tmin = (d - Math.floor(d + 0.5) + 0.5) * 1440; // minutes past 0h UT
|
|
183
|
+
const eotDeg = ((((gast - ra - (tmin - 720) / 4 + 180) % 360) + 360) % 360) - 180;
|
|
184
|
+
return { dec, eot: 4 * eotDeg };
|
|
185
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.places = void 0;
|
|
18
|
+
/** mihrab-methods/sweden — the sweden method with its places and correction list, and nothing else's. */
|
|
19
|
+
require("./authorities/sweden.js");
|
|
20
|
+
__exportStar(require("./core/index.js"), exports);
|
|
21
|
+
var sweden_js_1 = require("./authorities/sweden.js");
|
|
22
|
+
Object.defineProperty(exports, "places", { enumerable: true, get: function () { return sweden_js_1.places; } });
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Algeria — the Ministry of Religious Affairs and Wakfs: its cities at the
|
|
3
|
+
* points its table is computed at.
|
|
4
|
+
*/
|
|
5
|
+
import cities from '../data/generated/algeriaCities.js';
|
|
6
|
+
import points from '../data/generated/algeriaMethodPoints.js';
|
|
7
|
+
import corrections from '../data/generated/algeriaCorrections.js';
|
|
8
|
+
import certification from '../data/generated/algeriaCertification.js';
|
|
9
|
+
import { METHOD_REVISION } from '../methods/revisions.js';
|
|
10
|
+
import { registerAuthority } from '../core/registry.js';
|
|
11
|
+
const AUTHORITY = 'algeria';
|
|
12
|
+
function buildPlaces() {
|
|
13
|
+
return cities.map(c => {
|
|
14
|
+
const key = String(c.id);
|
|
15
|
+
return {
|
|
16
|
+
authority: AUTHORITY,
|
|
17
|
+
id: `${AUTHORITY}:${key}`,
|
|
18
|
+
key,
|
|
19
|
+
name: c.nameEn ?? c.name,
|
|
20
|
+
country: 'DZ',
|
|
21
|
+
lat: points[key]?.[0] ?? c.lat,
|
|
22
|
+
lon: points[key]?.[1] ?? c.lon,
|
|
23
|
+
tz: 'Africa/Algiers',
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export const algeria = registerAuthority({
|
|
28
|
+
authority: AUTHORITY,
|
|
29
|
+
revision: METHOD_REVISION.algeria,
|
|
30
|
+
places: buildPlaces(),
|
|
31
|
+
corrections,
|
|
32
|
+
certification,
|
|
33
|
+
description: {
|
|
34
|
+
name: 'Algeria — Ministry of Religious Affairs and Wakfs',
|
|
35
|
+
method: 'NOAA’s solar formulas; Dhuhr at the transit; every other time the transit plus or minus the hour angle, the declination taken at that prayer’s own moment and the equation of time kept at noon’s; Fajr 18°, Isha 17°, sunrise and sunset at −0.833°; Asr from the signed noon shadow; Maghrib three minutes after sunset; every time rounded up to the minute.',
|
|
36
|
+
countries: ['DZ'],
|
|
37
|
+
parameters: {
|
|
38
|
+
fajrAngle: 18,
|
|
39
|
+
ishaAngle: 17,
|
|
40
|
+
sunriseAltitude: -0.833,
|
|
41
|
+
asrShadow: 1,
|
|
42
|
+
asrNoonShadow: 'tan(φ − δ) with its sign',
|
|
43
|
+
maghribAfterSunsetMinutes: 3,
|
|
44
|
+
rounding: 'up to the minute',
|
|
45
|
+
sun: 'NOAA solar calculator series; declination iterated at each prayer, equation of time at noon',
|
|
46
|
+
},
|
|
47
|
+
sources: [{ title: 'Ministry of Religious Affairs and Wakfs — مواقيت الصلاة', url: 'https://www.marw.dz/' }],
|
|
48
|
+
spec: 'docs/methods.md#algeria',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export const places = algeria.places;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Place } from '../core/types.js';
|
|
2
|
+
/** Diyanet's own country numbers → ISO 3166-1 alpha-2 (Northern Cyprus is 'CY'). */
|
|
3
|
+
export declare function diyanetCountry(id: string): {
|
|
4
|
+
name: string;
|
|
5
|
+
iso: string;
|
|
6
|
+
};
|
|
7
|
+
declare const places: Place[];
|
|
8
|
+
export declare const diyanet: import("../core/registry.js").AuthorityData;
|
|
9
|
+
export { places };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diyanet — Türkiye's districts (a point per prayer per year) and its
|
|
3
|
+
* places worldwide, each at the point Diyanet computes it, in the zone its
|
|
4
|
+
* table is printed in, with Isha's angle for its country.
|
|
5
|
+
*/
|
|
6
|
+
import world from '../data/generated/diyanetWorldPoints.js';
|
|
7
|
+
import turkey from '../data/generated/diyanetTurkeyPoints.js';
|
|
8
|
+
import countries from '../data/generated/diyanetCountries.js';
|
|
9
|
+
import corrections from '../data/generated/diyanetCorrections.js';
|
|
10
|
+
import certification from '../data/generated/diyanetCertification.js';
|
|
11
|
+
import { METHOD_REVISION } from '../methods/revisions.js';
|
|
12
|
+
import { registerAuthority } from '../core/registry.js';
|
|
13
|
+
const AUTHORITY = 'diyanet';
|
|
14
|
+
/** Diyanet's own country numbers → ISO 3166-1 alpha-2 (Northern Cyprus is 'CY'). */
|
|
15
|
+
export function diyanetCountry(id) {
|
|
16
|
+
return countries[id] ?? { name: `Country ${id}`, iso: 'ZZ' };
|
|
17
|
+
}
|
|
18
|
+
function buildPlaces() {
|
|
19
|
+
const out = Object.entries(world).map(([iid, v]) => ({
|
|
20
|
+
authority: AUTHORITY,
|
|
21
|
+
id: `${AUTHORITY}:${iid}`,
|
|
22
|
+
key: iid,
|
|
23
|
+
name: v.name,
|
|
24
|
+
country: diyanetCountry(v.country).iso,
|
|
25
|
+
lat: v.lat,
|
|
26
|
+
lon: v.lon,
|
|
27
|
+
tz: v.tz,
|
|
28
|
+
ishaDeg: v.ishaDeg,
|
|
29
|
+
...(v.clock ? { clock: v.clock } : {}),
|
|
30
|
+
}));
|
|
31
|
+
// Türkiye's districts (and Northern Cyprus's), with a point per prayer per year
|
|
32
|
+
for (const [iid, v] of Object.entries(turkey)) {
|
|
33
|
+
const base = v.years['2026'] ?? Object.values(v.years)[0];
|
|
34
|
+
out.push({
|
|
35
|
+
authority: AUTHORITY,
|
|
36
|
+
id: `${AUTHORITY}:${iid}`,
|
|
37
|
+
key: iid,
|
|
38
|
+
name: v.name,
|
|
39
|
+
country: v.country === '1' ? 'CY' : 'TR',
|
|
40
|
+
lat: base[1][0],
|
|
41
|
+
lon: base[1][1],
|
|
42
|
+
tz: v.country === '1' ? 'Asia/Nicosia' : 'Europe/Istanbul',
|
|
43
|
+
ishaDeg: 17,
|
|
44
|
+
prayerPoints: v.years,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
const places = buildPlaces();
|
|
50
|
+
export const diyanet = registerAuthority({
|
|
51
|
+
authority: AUTHORITY,
|
|
52
|
+
revision: METHOD_REVISION.diyanet,
|
|
53
|
+
places,
|
|
54
|
+
corrections,
|
|
55
|
+
certification,
|
|
56
|
+
description: {
|
|
57
|
+
name: 'Diyanet — Türkiye and worldwide',
|
|
58
|
+
method: 'The Congress method as Diyanet computes it (see Sweden), with Isha at 16° in most of Europe, Russia, Central Asia, China and North America and 17° elsewhere; in Türkiye and Northern Cyprus each prayer at a point of its own per district and year; tables printed on their own clocks where Diyanet keeps one.',
|
|
59
|
+
countries: [...new Set(places.map(p => p.country))].sort(),
|
|
60
|
+
parameters: {
|
|
61
|
+
fajrAngle: 18,
|
|
62
|
+
ishaAngle: '16 or 17, by country (Place.ishaDeg)',
|
|
63
|
+
sunriseAltitude: -0.833,
|
|
64
|
+
asrShadow: 1,
|
|
65
|
+
'temkin.sunrise': -7,
|
|
66
|
+
'temkin.dhuhr': 5,
|
|
67
|
+
'temkin.asr': 4,
|
|
68
|
+
'temkin.maghrib': 7,
|
|
69
|
+
minimumDayMinutes: 300,
|
|
70
|
+
minimumNightMinutes: 300,
|
|
71
|
+
transitionBandMinutes: 20,
|
|
72
|
+
highLatitudeRule: 'the Congress’s, worked at 16° whatever the printed Isha angle; midsummer is the takdir’s day where its true Isha falls later than the carried share',
|
|
73
|
+
rounding: 'to the nearest minute, after the method’s own temkin',
|
|
74
|
+
coordinatePrecision: '0.001°',
|
|
75
|
+
},
|
|
76
|
+
sources: [
|
|
77
|
+
{ title: 'Diyanet — Namaz Vakitleri', url: 'https://namazvakti.diyanet.gov.tr/' },
|
|
78
|
+
{ title: 'Diyanet — the Congress’s criteria (Tespit Kriterleri)', url: 'https://awqatsalah.com/' },
|
|
79
|
+
],
|
|
80
|
+
spec: 'docs/methods.md#sweden-and-diyanet',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
export { places };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indonesia — Kemenag: every regency and city, at the point its table is
|
|
3
|
+
* computed at, in the zone it is printed in.
|
|
4
|
+
*/
|
|
5
|
+
import regencies from '../data/generated/kemenagPlaces.js';
|
|
6
|
+
import points from '../data/generated/kemenagMethodPoints.js';
|
|
7
|
+
import corrections from '../data/generated/indonesiaCorrections.js';
|
|
8
|
+
import certification from '../data/generated/indonesiaCertification.js';
|
|
9
|
+
import { METHOD_REVISION } from '../methods/revisions.js';
|
|
10
|
+
import { registerAuthority } from '../core/registry.js';
|
|
11
|
+
const AUTHORITY = 'indonesia';
|
|
12
|
+
/** Indonesia prints each regency in its own zone; the province says which. */
|
|
13
|
+
const WITA = new Set([
|
|
14
|
+
'Kalimantan Selatan', 'Kalimantan Timur', 'Kalimantan Utara', 'Bali',
|
|
15
|
+
'Nusa Tenggara Barat', 'Nusa Tenggara Timur', 'Sulawesi Barat', 'Sulawesi Selatan',
|
|
16
|
+
'Sulawesi Tengah', 'Sulawesi Tenggara', 'Sulawesi Utara', 'Gorontalo',
|
|
17
|
+
]);
|
|
18
|
+
const WIT = new Set(['Maluku', 'Maluku Utara', 'Papua', 'Papua Barat']);
|
|
19
|
+
export function indonesiaZone(province) {
|
|
20
|
+
if (WIT.has(province))
|
|
21
|
+
return 'Asia/Jayapura';
|
|
22
|
+
if (WITA.has(province))
|
|
23
|
+
return 'Asia/Makassar';
|
|
24
|
+
return 'Asia/Jakarta';
|
|
25
|
+
}
|
|
26
|
+
function buildPlaces() {
|
|
27
|
+
return regencies.map(c => {
|
|
28
|
+
const key = String(c.id);
|
|
29
|
+
const province = /\(([^)]*)\)\s*$/.exec(c.nameEn ?? '')?.[1] ?? '';
|
|
30
|
+
const p = points[key];
|
|
31
|
+
return {
|
|
32
|
+
authority: AUTHORITY,
|
|
33
|
+
id: `${AUTHORITY}:${key}`,
|
|
34
|
+
key,
|
|
35
|
+
name: c.nameEn ?? c.name,
|
|
36
|
+
country: 'ID',
|
|
37
|
+
lat: p?.[0] ?? c.lat,
|
|
38
|
+
lon: p?.[1] ?? c.lon,
|
|
39
|
+
tz: indonesiaZone(province),
|
|
40
|
+
highland: p ? (p[2] & 1) !== 0 : false,
|
|
41
|
+
twilightDip: p ? (p[2] & 2) !== 0 : false,
|
|
42
|
+
...(p && p.length >= 5 ? { afternoon: [p[3], p[4]] } : {}),
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export const indonesia = registerAuthority({
|
|
47
|
+
authority: AUTHORITY,
|
|
48
|
+
revision: METHOD_REVISION.indonesia,
|
|
49
|
+
places: buildPlaces(),
|
|
50
|
+
corrections,
|
|
51
|
+
certification,
|
|
52
|
+
description: {
|
|
53
|
+
name: 'Indonesia — Kemenag (Ministry of Religious Affairs)',
|
|
54
|
+
method: 'The precise apparent sun (VSOP87, as JPL’s to a tenth of a second) taken at each prayer’s own moment; Fajr 20°, Isha 18°; sunrise and Maghrib at −1° (−2° in the highland class); Asr when the shadow is its length plus the noon shadow, the noon shadow from the declination at 00:00 UT; every time rounded up after a margin of two minutes (three for Dhuhr, minus three for sunrise).',
|
|
55
|
+
countries: ['ID'],
|
|
56
|
+
parameters: {
|
|
57
|
+
fajrAngle: 20,
|
|
58
|
+
ishaAngle: 18,
|
|
59
|
+
sunriseAltitude: '−1°, or −2° in the highland class (Place.highland); the highland degree on Fajr and Isha too where Place.twilightDip',
|
|
60
|
+
asrShadow: 1,
|
|
61
|
+
asrNoonShadow: 'from the declination at 00:00 UT of the day',
|
|
62
|
+
'margin.fajr': 2,
|
|
63
|
+
'margin.sunrise': -3,
|
|
64
|
+
'margin.dhuhr': 3,
|
|
65
|
+
'margin.asr': 2,
|
|
66
|
+
'margin.maghrib': 2,
|
|
67
|
+
'margin.isha': 2,
|
|
68
|
+
rounding: 'up to the minute, after the margin',
|
|
69
|
+
sun: 'VSOP87 apparent sun (src/sun/preciseSun.ts), iterated at each prayer',
|
|
70
|
+
},
|
|
71
|
+
sources: [{ title: 'Kemenag — Jadwal Shalat', url: 'https://bimasislam.kemenag.go.id/jadwalshalat' }],
|
|
72
|
+
spec: 'docs/methods.md#indonesia',
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
export const places = indonesia.places;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Place } from '../core/types.js';
|
|
2
|
+
/** The ministry's clock: GMT+1, then GMT — its tables print GMT from 17 September 2026, three days before the clocks moved. */
|
|
3
|
+
export declare const MOROCCO_CLOCK: [string, number][];
|
|
4
|
+
export declare const morocco: import("../core/registry.js").AuthorityData;
|
|
5
|
+
export declare const places: readonly Place[];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Morocco — the Ministry of Habous and Islamic Affairs: its cities at the
|
|
3
|
+
* points and horizons its tables are computed with.
|
|
4
|
+
*/
|
|
5
|
+
import cities from '../data/generated/moroccoCities.js';
|
|
6
|
+
import points from '../data/generated/moroccoMethodPoints.js';
|
|
7
|
+
import corrections from '../data/generated/moroccoCorrections.js';
|
|
8
|
+
import certification from '../data/generated/moroccoCertification.js';
|
|
9
|
+
import { METHOD_REVISION } from '../methods/revisions.js';
|
|
10
|
+
import { registerAuthority } from '../core/registry.js';
|
|
11
|
+
const AUTHORITY = 'morocco';
|
|
12
|
+
/**
|
|
13
|
+
* Morocco left GMT+1 for GMT on 2026-09-20 for good; the tz databases still
|
|
14
|
+
* move its clock, so the zone is pinned rather than named.
|
|
15
|
+
*/
|
|
16
|
+
const MOROCCO_TZ = 'Etc/GMT';
|
|
17
|
+
/** The ministry's clock: GMT+1, then GMT — its tables print GMT from 17 September 2026, three days before the clocks moved. */
|
|
18
|
+
export const MOROCCO_CLOCK = [['2020-01-01', 60], ['2026-09-17', 0]];
|
|
19
|
+
const MOROCCO_DIP_PER_SQRT_M = 0.02;
|
|
20
|
+
function buildPlaces() {
|
|
21
|
+
return cities
|
|
22
|
+
.filter(c => typeof c.lat === 'number' && typeof c.lng === 'number')
|
|
23
|
+
.map(c => {
|
|
24
|
+
const key = String(c.id);
|
|
25
|
+
const base = { authority: AUTHORITY, id: `${AUTHORITY}:${key}`, key, name: c.name, country: 'MA', tz: MOROCCO_TZ, clock: MOROCCO_CLOCK };
|
|
26
|
+
const p = points[key];
|
|
27
|
+
return p
|
|
28
|
+
? { ...base, lat: p[0], lon: p[1], dipDeg: p[2], ...(p.length > 3 ? { dipMaghribDeg: p[3] } : {}) }
|
|
29
|
+
: { ...base, lat: c.lat, lon: c.lng, dipDeg: MOROCCO_DIP_PER_SQRT_M * Math.sqrt(c.heightM ?? 0) };
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export const morocco = registerAuthority({
|
|
33
|
+
authority: AUTHORITY,
|
|
34
|
+
revision: METHOD_REVISION.morocco,
|
|
35
|
+
places: buildPlaces(),
|
|
36
|
+
corrections,
|
|
37
|
+
certification,
|
|
38
|
+
description: {
|
|
39
|
+
name: 'Morocco — Ministry of Habous and Islamic Affairs',
|
|
40
|
+
method: 'Meeus’s apparent sun taken at each prayer’s own moment; Fajr 19°, Isha 17°, Asr one shadow; Dhuhr five minutes after transit; sunrise 2.85 minutes before and Maghrib 3.7 minutes after the upper limb on the horizon, less each city’s own horizon dip east and west; Fajr rounded down, the rest to the nearest minute; printed on the ministry’s clock (GMT+1 until 17 September 2026, then GMT).',
|
|
41
|
+
countries: ['MA'],
|
|
42
|
+
parameters: {
|
|
43
|
+
fajrAngle: 19,
|
|
44
|
+
ishaAngle: 17,
|
|
45
|
+
asrShadow: 1,
|
|
46
|
+
dhuhrAfterTransitMinutes: 5,
|
|
47
|
+
sunriseMarginMinutes: -2.85,
|
|
48
|
+
maghribMarginMinutes: 3.7,
|
|
49
|
+
refractionArcmin: 34,
|
|
50
|
+
sunSemidiameter: 'by the sun’s distance that day',
|
|
51
|
+
horizonDip: 'per city and per side, fitted (Place.dipDeg, Place.dipMaghribDeg); else 0.02°·√height, 0.86 of it at Maghrib',
|
|
52
|
+
rounding: 'Fajr down to the minute, the rest to the nearest',
|
|
53
|
+
sun: 'Meeus, apparent, with the full nutation; chapter-28 equation of time; iterated at each prayer',
|
|
54
|
+
},
|
|
55
|
+
sources: [{ title: 'Ministry of Habous and Islamic Affairs — horaires des prières', url: 'https://www.habous.gov.ma/' }],
|
|
56
|
+
spec: 'docs/methods.md#morocco',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
export const places = morocco.places;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Islamiska Förbundet's file names for its cities (the Swedish places' keys). */
|
|
2
|
+
export function citySlug(name) {
|
|
3
|
+
return name
|
|
4
|
+
.trim()
|
|
5
|
+
.toLowerCase()
|
|
6
|
+
.replace(/[àáâã]/g, 'a')
|
|
7
|
+
.replace(/[å]/g, 'a')
|
|
8
|
+
.replace(/[ä]/g, 'a')
|
|
9
|
+
.replace(/[ö]/g, 'o')
|
|
10
|
+
.replace(/[ø]/g, 'o')
|
|
11
|
+
.replace(/[é]/g, 'e')
|
|
12
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
13
|
+
.replace(/^-+|-+$/g, '');
|
|
14
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sweden — Diyanet's Congress method, as Islamiska Förbundet's timetables
|
|
3
|
+
* print it: the towns at the points Diyanet computes them.
|
|
4
|
+
*/
|
|
5
|
+
import coords from '../data/generated/swedenPlaces.js';
|
|
6
|
+
import corrections from '../data/generated/swedenCorrections.js';
|
|
7
|
+
import certification from '../data/generated/swedenCertification.js';
|
|
8
|
+
import { METHOD_REVISION } from '../methods/revisions.js';
|
|
9
|
+
import { registerAuthority } from '../core/registry.js';
|
|
10
|
+
import { citySlug } from './slug.js';
|
|
11
|
+
const AUTHORITY = 'sweden';
|
|
12
|
+
function buildPlaces() {
|
|
13
|
+
return Object.entries(coords).map(([name, c]) => {
|
|
14
|
+
const key = citySlug(name);
|
|
15
|
+
return { authority: AUTHORITY, id: `${AUTHORITY}:${key}`, key, name, country: 'SE', lat: c.lat, lon: c.lng, tz: 'Europe/Stockholm' };
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export const sweden = registerAuthority({
|
|
19
|
+
authority: AUTHORITY,
|
|
20
|
+
revision: METHOD_REVISION.sweden,
|
|
21
|
+
places: buildPlaces(),
|
|
22
|
+
corrections,
|
|
23
|
+
certification,
|
|
24
|
+
description: {
|
|
25
|
+
name: 'Sweden — Diyanet’s method, as used by Islamiska Förbundet',
|
|
26
|
+
method: 'The International Prayer Times Congress method (Istanbul, 2021) as Diyanet computes it: true Fajr at 18° and Isha at 16°, with the night’s share carried through the summer gap, five-hour floors on the day and the night, and gradual transitions; the sun taken once a day from Meeus’s mean elements.',
|
|
27
|
+
countries: ['SE'],
|
|
28
|
+
parameters: {
|
|
29
|
+
fajrAngle: 18,
|
|
30
|
+
ishaAngle: 16,
|
|
31
|
+
sunriseAltitude: -0.833,
|
|
32
|
+
asrShadow: 1,
|
|
33
|
+
'temkin.sunrise': -7,
|
|
34
|
+
'temkin.dhuhr': 5,
|
|
35
|
+
'temkin.asr': 4,
|
|
36
|
+
'temkin.maghrib': 7,
|
|
37
|
+
minimumDayMinutes: 300,
|
|
38
|
+
minimumNightMinutes: 300,
|
|
39
|
+
transitionBandMinutes: 20,
|
|
40
|
+
highLatitudeRule: 'the share of the night carried from the last day the 18° dawn formed; Fajr’s share scaled by 18/16',
|
|
41
|
+
rounding: 'to the nearest minute, after the method’s own temkin',
|
|
42
|
+
coordinatePrecision: '0.001°',
|
|
43
|
+
},
|
|
44
|
+
sources: [
|
|
45
|
+
{ title: 'Islamiska Förbundet i Sverige — bönetider', url: 'https://www.islamiskaforbundet.se/' },
|
|
46
|
+
{ title: 'Diyanet — Namaz Vakitleri', url: 'https://namazvakti.diyanet.gov.tr/' },
|
|
47
|
+
{ title: 'Diyanet — the Congress’s criteria (Tespit Kriterleri)', url: 'https://awqatsalah.com/' },
|
|
48
|
+
],
|
|
49
|
+
spec: 'docs/methods.md#sweden-and-diyanet',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
export const places = sweden.places;
|