@neaps/tide-predictor 0.4.0 → 0.4.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/dist/index.cjs +13 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -305,10 +305,10 @@ var node_corrections_default = corrections;
|
|
|
305
305
|
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region src/constituents/definition.ts
|
|
308
|
-
function defineConstituent(
|
|
308
|
+
function defineConstituent(names, coefficients$1, u, f) {
|
|
309
309
|
if (!coefficients$1) throw new Error("Coefficient must be defined for a constituent");
|
|
310
310
|
return Object.freeze({
|
|
311
|
-
|
|
311
|
+
names: Array.isArray(names) ? names : [names],
|
|
312
312
|
coefficients: coefficients$1,
|
|
313
313
|
value: (astro$1) => {
|
|
314
314
|
return dotArray(coefficients$1, astronomicValues(astro$1));
|
|
@@ -320,7 +320,7 @@ function defineConstituent(name, coefficients$1, u, f) {
|
|
|
320
320
|
f: typeof f !== "undefined" ? f : node_corrections_default.fUnity
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
function defineCompoundConstituent(
|
|
323
|
+
function defineCompoundConstituent(names, members) {
|
|
324
324
|
const coefficients$1 = [];
|
|
325
325
|
members.forEach(({ constituent, factor }) => {
|
|
326
326
|
constituent.coefficients.forEach((coefficient, index) => {
|
|
@@ -329,7 +329,7 @@ function defineCompoundConstituent(name, members) {
|
|
|
329
329
|
});
|
|
330
330
|
});
|
|
331
331
|
return Object.freeze({
|
|
332
|
-
|
|
332
|
+
names: Array.isArray(names) ? names : [names],
|
|
333
333
|
coefficients: coefficients$1,
|
|
334
334
|
speed: (astro$1) => {
|
|
335
335
|
let speed = 0;
|
|
@@ -713,7 +713,7 @@ var K2_default = defineConstituent("K2", [
|
|
|
713
713
|
* Amplitude typically <5% of M2; important in detailed constituent analysis.
|
|
714
714
|
* IHO standard designation (previously abbreviated as LAM2).
|
|
715
715
|
*/
|
|
716
|
-
var LAMBDA2_default = defineConstituent("LAMBDA2", [
|
|
716
|
+
var LAMBDA2_default = defineConstituent(["LAM2", "LAMBDA2"], [
|
|
717
717
|
2,
|
|
718
718
|
1,
|
|
719
719
|
-2,
|
|
@@ -723,15 +723,6 @@ var LAMBDA2_default = defineConstituent("LAMBDA2", [
|
|
|
723
723
|
2
|
|
724
724
|
], node_corrections_default.uM2, node_corrections_default.fM2);
|
|
725
725
|
|
|
726
|
-
//#endregion
|
|
727
|
-
//#region src/constituents/LAM2.ts
|
|
728
|
-
/**
|
|
729
|
-
* Alias for compatibility between NOAA and IHO
|
|
730
|
-
*
|
|
731
|
-
* @see LAMBDA2
|
|
732
|
-
*/
|
|
733
|
-
var LAM2_default = LAMBDA2_default;
|
|
734
|
-
|
|
735
726
|
//#endregion
|
|
736
727
|
//#region src/constituents/M1.ts
|
|
737
728
|
/**
|
|
@@ -1190,7 +1181,7 @@ var R3_default = defineCompoundConstituent("R3", [{
|
|
|
1190
1181
|
* Amplitude typically very small; rarely significant.
|
|
1191
1182
|
* Found only in shallow-water regions with strong tidal distortion.
|
|
1192
1183
|
*/
|
|
1193
|
-
var RHO1_default = defineCompoundConstituent("RHO1", [{
|
|
1184
|
+
var RHO1_default = defineCompoundConstituent(["RHO", "RHO1"], [{
|
|
1194
1185
|
constituent: NU2_default,
|
|
1195
1186
|
factor: 1
|
|
1196
1187
|
}, {
|
|
@@ -1198,15 +1189,6 @@ var RHO1_default = defineCompoundConstituent("RHO1", [{
|
|
|
1198
1189
|
factor: -1
|
|
1199
1190
|
}]);
|
|
1200
1191
|
|
|
1201
|
-
//#endregion
|
|
1202
|
-
//#region src/constituents/RHO.ts
|
|
1203
|
-
/**
|
|
1204
|
-
* Alias for compatibility between NOAA and IHO
|
|
1205
|
-
*
|
|
1206
|
-
* @see RHO1
|
|
1207
|
-
*/
|
|
1208
|
-
var RHO_default = RHO1_default;
|
|
1209
|
-
|
|
1210
1192
|
//#endregion
|
|
1211
1193
|
//#region src/constituents/S1.ts
|
|
1212
1194
|
/**
|
|
@@ -1274,7 +1256,7 @@ var S6_default = defineCompoundConstituent("S6", [{
|
|
|
1274
1256
|
* Solar annual (Sa).
|
|
1275
1257
|
* Long-term constituent driven by solar declination variations over the year.
|
|
1276
1258
|
*/
|
|
1277
|
-
var SA_default = defineConstituent("Sa", [
|
|
1259
|
+
var SA_default = defineConstituent(["SA", "Sa"], [
|
|
1278
1260
|
0,
|
|
1279
1261
|
0,
|
|
1280
1262
|
1,
|
|
@@ -1292,7 +1274,7 @@ var SA_default = defineConstituent("Sa", [
|
|
|
1292
1274
|
*
|
|
1293
1275
|
* Note: Often has small amplitude; closely related to K1 and O1 variations.
|
|
1294
1276
|
*/
|
|
1295
|
-
var SGM_default = defineConstituent("SGM", [
|
|
1277
|
+
var SGM_default = defineConstituent(["SGM", "SIGMA1"], [
|
|
1296
1278
|
1,
|
|
1297
1279
|
-3,
|
|
1298
1280
|
2,
|
|
@@ -1308,7 +1290,7 @@ var SGM_default = defineConstituent("SGM", [
|
|
|
1308
1290
|
* Solar semi-annual (Ssa).
|
|
1309
1291
|
* Semi-annual constituent from solar declination with twice-yearly periodicity.
|
|
1310
1292
|
*/
|
|
1311
|
-
var SSA_default = defineConstituent("Ssa", [
|
|
1293
|
+
var SSA_default = defineConstituent(["Ssa", "SSA"], [
|
|
1312
1294
|
0,
|
|
1313
1295
|
0,
|
|
1314
1296
|
2,
|
|
@@ -1368,7 +1350,6 @@ const constituentModules = {
|
|
|
1368
1350
|
"./K1.ts": K1_default,
|
|
1369
1351
|
"./K2.ts": K2_default,
|
|
1370
1352
|
"./L2.ts": L2_default,
|
|
1371
|
-
"./LAM2.ts": LAM2_default,
|
|
1372
1353
|
"./LAMBDA2.ts": LAMBDA2_default,
|
|
1373
1354
|
"./M1.ts": M1_default,
|
|
1374
1355
|
"./M2.ts": M2_default,
|
|
@@ -1397,7 +1378,6 @@ const constituentModules = {
|
|
|
1397
1378
|
"./Q1.ts": Q1_default,
|
|
1398
1379
|
"./R2.ts": R2_default,
|
|
1399
1380
|
"./R3.ts": R3_default,
|
|
1400
|
-
"./RHO.ts": RHO_default,
|
|
1401
1381
|
"./RHO1.ts": RHO1_default,
|
|
1402
1382
|
"./S1.ts": S1_default,
|
|
1403
1383
|
"./S2.ts": S2_default,
|
|
@@ -1414,10 +1394,10 @@ const constituentModules = {
|
|
|
1414
1394
|
};
|
|
1415
1395
|
const constituents = {};
|
|
1416
1396
|
for (const [path, module$1] of Object.entries(constituentModules)) {
|
|
1417
|
-
if (path.
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1397
|
+
if (path.match(/index|definition/)) continue;
|
|
1398
|
+
module$1.names.forEach((name) => {
|
|
1399
|
+
constituents[name] = module$1;
|
|
1400
|
+
});
|
|
1421
1401
|
}
|
|
1422
1402
|
var constituents_default = constituents;
|
|
1423
1403
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["coefficients: Coefficients","result: number[]","modulus","result: any","polynomials: Record<string, number[]>","coefficients","functions: Record<string, (N: number, i: number, omega: number) => number>","coefficients","astro","nodeCorrections","coefficients: number[]","f: number[]","results: number[]","nc","nc","M2","O1","nc","M2","K1","M2","O1","nc","M2","S2","nc","nc","nc","N2","J1","S2","M2","nc","L2","N2","nc","nc","nc","LAMBDA2","nc","nc","M2","M2","M2","nc","nc","nc","M2","K1","M2","K1","S2","nc","M2","N2","M2","S2","S2","M2","M2","S2","K1","nc","M2","T2","M2","S2","N2","nc","nc","nc","nc","nc","R2","NU2","K1","RHO1","nc","S2","S2","S2","nc","nc","nc","T2","nc","constituents: Record<string, Constituent>","module","amplitudes: number[]","prediction: Prediction","results: Extreme[]","results: TimelinePoint[]","prediction: TimelinePoint","prediction","astro","baseValue: Record<string, number>","baseSpeed: Record<string, number>","u: Record<string, number>[]","f: Record<string, number>[]","constituentModels","uItem: Record<string, number>","fItem: Record<string, number>","items: Date[]","hours: number[]","constituents: HarmonicConstituent[]","constituentModels","harmonics: Harmonics","prediction","constituents","harmonics"],"sources":["../src/astronomy/constants.ts","../src/astronomy/coefficients.ts","../src/astronomy/index.ts","../src/node-corrections/index.ts","../src/constituents/definition.ts","../src/constituents/M2.ts","../src/constituents/O1.ts","../src/constituents/2MK3.ts","../src/constituents/K1.ts","../src/constituents/2MK5.ts","../src/constituents/2MO5.ts","../src/constituents/S2.ts","../src/constituents/2MS6.ts","../src/constituents/2N2.ts","../src/constituents/N2.ts","../src/constituents/J1.ts","../src/constituents/2Q1.ts","../src/constituents/2SM2.ts","../src/constituents/L2.ts","../src/constituents/3L2.ts","../src/constituents/3N2.ts","../src/constituents/EP2.ts","../src/constituents/K2.ts","../src/constituents/LAMBDA2.ts","../src/constituents/LAM2.ts","../src/constituents/M1.ts","../src/constituents/M3.ts","../src/constituents/M4.ts","../src/constituents/M6.ts","../src/constituents/M8.ts","../src/constituents/MA2.ts","../src/constituents/MB2.ts","../src/constituents/MF.ts","../src/constituents/MK3.ts","../src/constituents/MKS2.ts","../src/constituents/MM.ts","../src/constituents/MN4.ts","../src/constituents/MS4.ts","../src/constituents/MSF.ts","../src/constituents/MSQM.ts","../src/constituents/T2.ts","../src/constituents/MTM.ts","../src/constituents/MU2.ts","../src/constituents/N4.ts","../src/constituents/NU2.ts","../src/constituents/OO1.ts","../src/constituents/P1.ts","../src/constituents/Q1.ts","../src/constituents/R2.ts","../src/constituents/R3.ts","../src/constituents/RHO1.ts","../src/constituents/RHO.ts","../src/constituents/S1.ts","../src/constituents/S3.ts","../src/constituents/S4.ts","../src/constituents/S6.ts","../src/constituents/SA.ts","../src/constituents/SGM.ts","../src/constituents/SSA.ts","../src/constituents/T3.ts","../src/constituents/Z0.ts","../src/constituents/index.ts","../src/harmonics/prediction.ts","../src/harmonics/index.ts","../src/index.ts"],"sourcesContent":["export const d2r = Math.PI / 180.0;\nexport const r2d = 180.0 / Math.PI;\n","// Convert a sexagesimal angle into decimal degrees\nconst sexagesimalToDecimal = (\n degrees: number,\n arcmins: number = 0,\n arcsecs: number = 0,\n mas: number = 0,\n muas: number = 0,\n): number => {\n return (\n degrees +\n arcmins / 60.0 +\n arcsecs / (60.0 * 60.0) +\n mas / (60.0 * 60.0 * 1e3) +\n muas / (60.0 * 60.0 * 1e6)\n );\n};\n\ninterface Coefficients {\n terrestrialObliquity: number[];\n solarPerigee: number[];\n solarLongitude: number[];\n lunarInclination: number[];\n lunarLongitude: number[];\n lunarNode: number[];\n lunarPerigee: number[];\n}\n\nconst coefficients: Coefficients = {\n // Meeus formula 21.3\n terrestrialObliquity: [\n sexagesimalToDecimal(23, 26, 21.448),\n -sexagesimalToDecimal(0, 0, 4680.93),\n -sexagesimalToDecimal(0, 0, 1.55),\n sexagesimalToDecimal(0, 0, 1999.25),\n -sexagesimalToDecimal(0, 0, 51.38),\n -sexagesimalToDecimal(0, 0, 249.67),\n -sexagesimalToDecimal(0, 0, 39.05),\n sexagesimalToDecimal(0, 0, 7.12),\n sexagesimalToDecimal(0, 0, 27.87),\n sexagesimalToDecimal(0, 0, 5.79),\n sexagesimalToDecimal(0, 0, 2.45),\n ].map((number, index) => {\n return number * Math.pow(1e-2, index);\n }),\n\n solarPerigee: [280.46645 - 357.5291, 36000.76932 - 35999.0503, 0.0003032 + 0.0001559, 0.00000048],\n\n solarLongitude: [280.46645, 36000.76983, 0.0003032],\n\n lunarInclination: [5.145],\n\n lunarLongitude: [218.3164591, 481267.88134236, -0.0013268, 1 / 538841.0 - 1 / 65194000.0],\n\n lunarNode: [125.044555, -1934.1361849, 0.0020762, 1 / 467410.0, -1 / 60616000.0],\n\n lunarPerigee: [83.353243, 4069.0137111, -0.0103238, -1 / 80053.0, 1 / 18999000.0],\n};\n\nexport default coefficients;\nexport { sexagesimalToDecimal };\nexport type { Coefficients };\n","import { d2r, r2d } from \"./constants.js\";\nimport coefficients from \"./coefficients.js\";\n\nexport interface AstroValue {\n value: number;\n speed: number;\n}\n\nexport interface AstroData {\n s: AstroValue;\n h: AstroValue;\n p: AstroValue;\n N: AstroValue;\n pp: AstroValue;\n \"90\": AstroValue;\n omega: AstroValue;\n i: AstroValue;\n I: AstroValue;\n xi: AstroValue;\n nu: AstroValue;\n nup: AstroValue;\n nupp: AstroValue;\n \"T+h-s\": AstroValue;\n P: AstroValue;\n}\n\n// Evaluates a polynomial at argument\nconst polynomial = (coefficients: number[], argument: number): number => {\n const result: number[] = [];\n coefficients.forEach((coefficient, index) => {\n result.push(coefficient * Math.pow(argument, index));\n });\n return result.reduce((a, b) => a + b);\n};\n\n// Evaluates a derivative polynomial at argument\nconst derivativePolynomial = (coefficients: number[], argument: number): number => {\n const result: number[] = [];\n coefficients.forEach((coefficient, index) => {\n result.push(coefficient * index * Math.pow(argument, index - 1));\n });\n return result.reduce((a, b) => a + b);\n};\n\n// Meeus formula 11.1\nconst T = (t: Date): number => {\n return (JD(t) - 2451545.0) / 36525;\n};\n\n// Meeus formula 7.1\nconst JD = (t: Date): number => {\n let Y = t.getUTCFullYear();\n let M = t.getUTCMonth() + 1;\n const D =\n t.getUTCDate() +\n t.getUTCHours() / 24.0 +\n t.getUTCMinutes() / (24.0 * 60.0) +\n t.getUTCSeconds() / (24.0 * 60.0 * 60.0) +\n t.getUTCMilliseconds() / (24.0 * 60.0 * 60.0 * 1e6);\n if (M <= 2) {\n Y = Y - 1;\n M = M + 12;\n }\n const A = Math.floor(Y / 100.0);\n const B = 2 - A + Math.floor(A / 4.0);\n return Math.floor(365.25 * (Y + 4716)) + Math.floor(30.6001 * (M + 1)) + D + B - 1524.5;\n};\n\nconst _I = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n const cosI = Math.cos(i) * Math.cos(omega) - Math.sin(i) * Math.sin(omega) * Math.cos(N);\n return r2d * Math.acos(cosI);\n};\n\nconst _xi = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n let e1 = (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) * Math.tan(0.5 * N);\n let e2 = (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) * Math.tan(0.5 * N);\n e1 = Math.atan(e1);\n e2 = Math.atan(e2);\n e1 = e1 - 0.5 * N;\n e2 = e2 - 0.5 * N;\n return -(e1 + e2) * r2d;\n};\n\nconst _nu = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n let e1 = (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) * Math.tan(0.5 * N);\n let e2 = (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) * Math.tan(0.5 * N);\n e1 = Math.atan(e1);\n e2 = Math.atan(e2);\n e1 = e1 - 0.5 * N;\n e2 = e2 - 0.5 * N;\n return (e1 - e2) * r2d;\n};\n\n// Schureman equation 224\nconst _nup = (N: number, i: number, omega: number): number => {\n const I = d2r * _I(N, i, omega);\n const nu = d2r * _nu(N, i, omega);\n return (\n r2d * Math.atan((Math.sin(2 * I) * Math.sin(nu)) / (Math.sin(2 * I) * Math.cos(nu) + 0.3347))\n );\n};\n\n// Schureman equation 232\nconst _nupp = (N: number, i: number, omega: number): number => {\n const I = d2r * _I(N, i, omega);\n const nu = d2r * _nu(N, i, omega);\n const tan2nupp =\n (Math.sin(I) ** 2 * Math.sin(2 * nu)) / (Math.sin(I) ** 2 * Math.cos(2 * nu) + 0.0727);\n return r2d * 0.5 * Math.atan(tan2nupp);\n};\n\nconst modulus = (a: number, b: number): number => {\n return ((a % b) + b) % b;\n};\n\nconst astro = (time: Date): AstroData => {\n // This gets cast to `AstroData` later, but we build it up step by step here\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: any = {};\n\n const polynomials: Record<string, number[]> = {\n s: coefficients.lunarLongitude,\n h: coefficients.solarLongitude,\n p: coefficients.lunarPerigee,\n N: coefficients.lunarNode,\n pp: coefficients.solarPerigee,\n \"90\": [90.0],\n omega: coefficients.terrestrialObliquity,\n i: coefficients.lunarInclination,\n };\n\n // Polynomials are in T, that is Julian Centuries; we want our speeds to be\n // in the more convenient unit of degrees per hour.\n const dTdHour = 1 / (24 * 365.25 * 100);\n for (const name in polynomials) {\n result[name] = {\n value: modulus(polynomial(polynomials[name], T(time)), 360.0),\n speed: derivativePolynomial(polynomials[name], T(time)) * dTdHour,\n };\n }\n\n // Some other parameters defined by Schureman which are dependent on the\n // parameters N, i, omega for use in node factor calculations. We don't need\n // their speeds.\n const functions: Record<string, (N: number, i: number, omega: number) => number> = {\n I: _I,\n xi: _xi,\n nu: _nu,\n nup: _nup,\n nupp: _nupp,\n };\n Object.keys(functions).forEach((name) => {\n const functionCall = functions[name];\n result[name] = {\n value: modulus(functionCall(result.N.value, result.i.value, result.omega.value), 360.0),\n speed: null,\n };\n });\n\n // We don't work directly with the T (hours) parameter, instead our spanning\n // set for equilibrium arguments #is given by T+h-s, s, h, p, N, pp, 90.\n // This is in line with convention.\n const hour = {\n value: (JD(time) - Math.floor(JD(time))) * 360.0,\n speed: 15.0,\n };\n\n result[\"T+h-s\"] = {\n value: hour.value + result.h.value - result.s.value,\n speed: hour.speed + result.h.speed - result.s.speed,\n };\n\n // It is convenient to calculate Schureman's P here since several node\n // factors need it, although it could be argued that these\n // (along with I, xi, nu etc) belong somewhere else.\n result.P = {\n value: result.p.value - (result.xi.value % 360.0),\n speed: null,\n };\n\n return result as AstroData;\n};\n\nexport default astro;\nexport { polynomial, derivativePolynomial, T, JD, _I, _xi, _nu, _nup, _nupp };\n","import { d2r, r2d } from \"../astronomy/constants.js\";\nimport type { AstroData } from \"../astronomy/index.js\";\n\nexport type NodeCorrectionFunction = (a: AstroData, ...args: unknown[]) => number;\n\nconst corrections = {\n fUnity(): number {\n return 1;\n },\n\n // Schureman equations 73, 65\n fMm(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n (2 / 3.0 - Math.pow(Math.sin(omega), 2)) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n return (2 / 3.0 - Math.pow(Math.sin(I), 2)) / mean;\n },\n\n // Schureman equations 74, 66\n fMf(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.pow(Math.sin(omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return Math.pow(Math.sin(I), 2) / mean;\n },\n\n // Schureman equations 75, 67\n fO1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n Math.sin(omega) * Math.pow(Math.cos(0.5 * omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return (Math.sin(I) * Math.pow(Math.cos(0.5 * I), 2)) / mean;\n },\n\n // Schureman equations 76, 68\n fJ1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.sin(2 * omega) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n return Math.sin(2 * I) / mean;\n },\n\n // Schureman equations 77, 69\n fOO1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n Math.sin(omega) * Math.pow(Math.sin(0.5 * omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return (Math.sin(I) * Math.pow(Math.sin(0.5 * I), 2)) / mean;\n },\n\n // Schureman equations 78, 70\n fM2(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.pow(Math.cos(0.5 * omega), 4) * Math.pow(Math.cos(0.5 * i), 4);\n return Math.pow(Math.cos(0.5 * I), 4) / mean;\n },\n\n // Schureman equations 227, 226, 68\n // Should probably eventually include the derivations of the magic numbers (0.5023 etc).\n fK1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const nu = d2r * a.nu.value;\n const sin2IcosnuMean = Math.sin(2 * omega) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n const mean = 0.5023 * sin2IcosnuMean + 0.1681;\n return (\n Math.pow(\n 0.2523 * Math.pow(Math.sin(2 * I), 2) + 0.1689 * Math.sin(2 * I) * Math.cos(nu) + 0.0283,\n 0.5,\n ) / mean\n );\n },\n\n // Schureman equations 215, 213, 204\n // It can be (and has been) confirmed that the exponent for R_a reads 1/2 via Schureman Table 7\n fL2(a: AstroData): number {\n const P = d2r * a.P.value;\n const I = d2r * a.I.value;\n const rAInv = Math.pow(\n 1 -\n 12 * Math.pow(Math.tan(0.5 * I), 2) * Math.cos(2 * P) +\n 36 * Math.pow(Math.tan(0.5 * I), 4),\n 0.5,\n );\n return corrections.fM2(a) * rAInv;\n },\n\n // Schureman equations 235, 234, 71\n // Again, magic numbers\n fK2(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const nu = d2r * a.nu.value;\n const sinsqIcos2nuMean = Math.sin(omega) ** 2 * (1 - (3 / 2.0) * Math.sin(i) ** 2);\n const mean = 0.5023 * sinsqIcos2nuMean + 0.0365;\n return (\n Math.pow(\n 0.2523 * Math.pow(Math.sin(I), 4) +\n 0.0367 * Math.pow(Math.sin(I), 2) * Math.cos(2 * nu) +\n 0.0013,\n 0.5,\n ) / mean\n );\n },\n\n // Schureman equations 206, 207, 195\n fM1(a: AstroData): number {\n const P = d2r * a.P.value;\n const I = d2r * a.I.value;\n const qAInv = Math.pow(\n 0.25 +\n 1.5 * Math.cos(I) * Math.cos(2 * P) * Math.pow(Math.cos(0.5 * I), -0.5) +\n 2.25 * Math.pow(Math.cos(I), 2) * Math.pow(Math.cos(0.5 * I), -4),\n 0.5,\n );\n return corrections.fO1(a) * qAInv;\n },\n\n // See e.g. Schureman equation 149\n fModd(a: AstroData, n: number): number {\n return Math.pow(corrections.fM2(a), n / 2.0);\n },\n\n // Node factors u, see Table 2 of Schureman.\n\n uZero(): number {\n return 0.0;\n },\n\n uMf(a: AstroData): number {\n return -2.0 * a.xi.value;\n },\n\n uO1(a: AstroData): number {\n return 2.0 * a.xi.value - a.nu.value;\n },\n\n uJ1(a: AstroData): number {\n return -a.nu.value;\n },\n\n uOO1(a: AstroData): number {\n return -2.0 * a.xi.value - a.nu.value;\n },\n\n uM2(a: AstroData): number {\n return 2.0 * a.xi.value - 2.0 * a.nu.value;\n },\n\n uK1(a: AstroData): number {\n return -a.nup.value;\n },\n\n // Schureman 214\n uL2(a: AstroData): number {\n const I = d2r * a.I.value;\n const P = d2r * a.P.value;\n const R =\n r2d *\n Math.atan(Math.sin(2 * P) / ((1 / 6.0) * Math.pow(Math.tan(0.5 * I), -2) - Math.cos(2 * P)));\n return 2.0 * a.xi.value - 2.0 * a.nu.value - R;\n },\n\n uK2(a: AstroData): number {\n return -2.0 * a.nupp.value;\n },\n\n // Schureman 202\n uM1(a: AstroData): number {\n const I = d2r * a.I.value;\n const P = d2r * a.P.value;\n const Q = r2d * Math.atan(((5 * Math.cos(I) - 1) / (7 * Math.cos(I) + 1)) * Math.tan(P));\n return a.xi.value - a.nu.value + Q;\n },\n\n uModd(a: AstroData, n: number): number {\n return (n / 2.0) * corrections.uM2(a);\n },\n};\n\nexport default corrections;\n","import type { AstroData } from \"../astronomy/index.js\";\nimport nodeCorrections, { type NodeCorrectionFunction } from \"../node-corrections/index.js\";\n\nexport interface Constituent {\n name: string;\n coefficients: number[];\n value: (astro: AstroData) => number;\n speed: (astro: AstroData) => number;\n u: NodeCorrectionFunction;\n f: NodeCorrectionFunction;\n}\n\nexport function defineConstituent(\n name: string,\n coefficients: number[],\n u?: NodeCorrectionFunction,\n f?: NodeCorrectionFunction,\n): Constituent {\n if (!coefficients) {\n throw new Error(\"Coefficient must be defined for a constituent\");\n }\n\n return Object.freeze({\n name,\n coefficients,\n\n value: (astro: AstroData): number => {\n return dotArray(coefficients, astronomicValues(astro));\n },\n\n speed(astro: AstroData): number {\n return dotArray(coefficients, astronomicSpeed(astro));\n },\n\n u: typeof u !== \"undefined\" ? u : nodeCorrections.uZero,\n\n f: typeof f !== \"undefined\" ? f : nodeCorrections.fUnity,\n });\n}\n\nexport interface ConstituentMember {\n constituent: Constituent;\n factor: number;\n}\n\nexport function defineCompoundConstituent(name: string, members: ConstituentMember[]): Constituent {\n const coefficients: number[] = [];\n members.forEach(({ constituent, factor }) => {\n constituent.coefficients.forEach((coefficient, index) => {\n if (typeof coefficients[index] === \"undefined\") {\n coefficients[index] = 0;\n }\n coefficients[index] += coefficient * factor;\n });\n });\n\n return Object.freeze({\n name,\n coefficients,\n\n speed: (astro: AstroData): number => {\n let speed = 0;\n members.forEach(({ constituent, factor }) => {\n speed += constituent.speed(astro) * factor;\n });\n return speed;\n },\n\n value: (astro: AstroData): number => {\n let value = 0;\n members.forEach(({ constituent, factor }) => {\n value += constituent.value(astro) * factor;\n });\n return value;\n },\n\n u: (astro: AstroData): number => {\n let u = 0;\n members.forEach(({ constituent, factor }) => {\n u += constituent.u(astro) * factor;\n });\n return u;\n },\n\n f: (astro: AstroData): number => {\n const f: number[] = [];\n members.forEach(({ constituent, factor }) => {\n f.push(Math.pow(constituent.f(astro), Math.abs(factor)));\n });\n return f.reduce((previous, value) => previous * value);\n },\n });\n}\n\n/**\n * Computes the dot notation of two arrays\n */\nfunction dotArray(a: number[], b: number[]): number {\n const results: number[] = [];\n a.forEach((value, index) => {\n results.push(value * b[index]);\n });\n return results.reduce((total, value) => total + value);\n}\n\nexport function astronimicDoodsonNumber(astro: AstroData): AstroData[keyof AstroData][] {\n return [astro[\"T+h-s\"], astro.s, astro.h, astro.p, astro.N, astro.pp, astro[\"90\"]];\n}\n\nexport function astronomicSpeed(astro: AstroData): number[] {\n const results: number[] = [];\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.speed);\n });\n return results;\n}\n\nexport function astronomicValues(astro: AstroData): number[] {\n const results: number[] = [];\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.value);\n });\n return results;\n}\n\n// Silence TS warning for empty module\nexport default {};\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (M2).\n * Primary principal lunar constituent; largest semi-diurnal tidal component globally.\n * Amplitude varies 10-20% over lunar node cycle; typically 0.2-0.5m in coastal areas.\n * Base constituent for many compound shallow-water constituents.\n */\nexport default defineConstituent(\"M2\", [2, 0, 0, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (O1).\n * Primary lunar diurnal constituent; one-per-lunar-day oscillation.\n * Amplitude varies 10-20% due to lunar node effects.\n */\nexport default defineConstituent(\"O1\", [1, -1, 0, 0, 0, 0, 1], nc.uO1, nc.fO1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport O1 from \"./O1.js\";\n\n/**\n * Shallow-water terdiurnal (2MK3 = M2 + O1).\n * Lunar-lunar interaction from M2 semi-diurnal and O1 diurnal components.\n * Generated in shallow-water environments; typical amplitude <1 cm.\n */\nexport default defineCompoundConstituent(\"2MK3\", [\n { constituent: M2, factor: 1 },\n { constituent: O1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunisolar diurnal (K1).\n * Combined lunar and solar diurnal constituent; strongest diurnal tide in many regions.\n * Often comparable in amplitude to O1; amplitude ratio K1/O1 varies with latitude.\n */\nexport default defineConstituent(\"K1\", [1, 1, 0, 0, 0, 0, -1], nc.uK1, nc.fK1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water fifth-diurnal from M2-K1 interaction.\n *\n * Note: Found in coastal tide predictions, especially in enclosed bays and harbors.\n * Amplitude typically 0.1-0.5 cm depending on location and water depth.\n * Shallow-water constituent only; not present in deep ocean.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"2MK5\", [\n { constituent: M2, factor: 2 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport O1 from \"./O1.js\";\n\n/**\n * Shallow-water fifth-diurnal from M2-O1 interaction.\n *\n * Note: Primarily shallow-water coastal phenomenon, not present in deep ocean.\n * Amplitude typically <0.5 cm except in extreme shallow-water or enclosed basins.\n * Found in coastal tide predictions alongside other shallow-water constituents.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"2MO5\", [\n { constituent: M2, factor: 2 },\n { constituent: O1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar semi-diurnal (S2).\n * Principal solar semi-diurnal constituent; largest solar tide component.\n * Amplitude typically 20-50% of M2; varies with geographic location and latitude.\n * Ratio M2/S2 determines tidal form factor (diurnal vs semi-diurnal regimes).\n * Base constituent for many compound shallow-water constituents.\n */\nexport default defineConstituent(\"S2\", [2, 2, -2, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Sixth-diurnal shallow-water interaction: 2×M2 + S2.\n *\n * Generated only in shallow water; typical amplitude 0.01-0.2 meters depending on depth.\n * Included in IHO shallow-water constituent tables and NOAA analysis (order #37).\n */\nexport default defineCompoundConstituent(\"2MS6\", [\n { constituent: M2, factor: 2 },\n { constituent: S2, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (2N2).\n * Second-order lunar semi-diurnal from Moon's orbital ellipticity.\n * Amplitude typically 5-10% of M2; significant in semi-diurnal analysis.\n */\nexport default defineConstituent(\"2N2\", [2, -2, 0, 2, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (N2).\n * Primary lunar elliptic semi-diurnal constituent from Moon's orbital variations.\n * Amplitude typically 5-15% of M2; third-largest semi-diurnal constituent.\n */\nexport default defineConstituent(\"N2\", [2, -1, 0, 1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (J1).\n * Shallow-water lunar diurnal constituent; generally much smaller than O1 and K1.\n * Typically important only in shallow-water systems and enclosed basins.\n * Amplitude usually <5% of O1; rarely significant in routine predictions.\n */\nexport default defineConstituent(\"J1\", [1, 2, 0, -1, 0, 0, -1], nc.uJ1, nc.fJ1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\nimport J1 from \"./J1.js\";\n\n/**\n * Shallow-water diurnal (2Q1 = N2-J1).\n * Derived from interaction of semi-diurnal N2 and diurnal J1 constituents.\n * Amplitude typically very small; rarely significant.\n * Found only in shallow-water regions with strong tidal distortion.\n */\nexport default defineCompoundConstituent(\"2Q1\", [\n { constituent: N2, factor: 1 },\n { constituent: J1, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water semi-diurnal (2SM2).\n * Compound constituent: 2×S2 - M2\n * Solar-lunar interaction constituent generated in shallow-water environments.\n * Amplitude typically <2% of M2; complementary to MU2.\n */\nexport default defineCompoundConstituent(\"2SM2\", [\n { constituent: S2, factor: 2 },\n { constituent: M2, factor: -1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (L2).\n * Secondary lunar elliptic semi-diurnal from Moon's orbital variations and perigee effects.\n * Amplitude typically 1-3% of M2; often grouped with other lunar elliptic constituents.\n * Important in detailed harmonic analyses of semi-diurnal tides.\n */\nexport default defineConstituent(\"L2\", [2, 1, 0, -1, 0, 0, 2], nc.uL2, nc.fL2);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport L2 from \"./L2.js\";\n\n/**\n * Triple lunar elliptic; 3 times L2 interaction.\n *\n * Warning: Not in standard IHO constituent bank. Mainly historical/theoretical interest.\n * Very small amplitude (<0.1 cm); found only in extreme shallow water or enclosed basins.\n * Often ignored in routine tide predictions.\n *\n * @see Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides\n */\nexport default defineCompoundConstituent(\"3L2\", [{ constituent: L2, factor: 3 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Triple N2 shallow-water harmonic (3 × N2).\n *\n * Note: Shallow-water constituent with definition based on compound frequency estimates.\n * Typical amplitude <0.5 cm; often <0.1 cm except in extreme shallow-water or enclosed basins.\n * Rarely significant in routine tide predictions.\n *\n * @see NOAA CO-OPS shallow-water constituents\n */\nexport default defineCompoundConstituent(\"3N2\", [{ constituent: N2, factor: 3 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal constituent (ε2).\n */\nexport default defineConstituent(\"EP2\", [2, -3, 2, 1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunisolar semi-diurnal (K2).\n * Combined lunar and solar semi-diurnal constituent from declination effects.\n * Amplitude typically 10-30% of S2; second-largest solar-related semi-diurnal component.\n * Important in semi-diurnal tidal analysis, especially at mid-latitudes.\n */\nexport default defineConstituent(\"K2\", [2, 2, 0, 0, 0, 0, 0], nc.uK2, nc.fK2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (λ2, lambda2).\n * Lunar semi-diurnal constituent from Moon's perigee effects.\n * Amplitude typically <5% of M2; important in detailed constituent analysis.\n * IHO standard designation (previously abbreviated as LAM2).\n */\nexport default defineConstituent(\"LAMBDA2\", [2, 1, -2, 1, 0, 0, 2], nc.uM2, nc.fM2);\n","import LAMBDA2 from \"./LAMBDA2.js\";\n\n/**\n * Alias for compatibility between NOAA and IHO\n *\n * @see LAMBDA2\n */\nexport default LAMBDA2;\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal elliptic (M1).\n * Secondary lunar diurnal constituent from Moon's elliptical orbit.\n * Typically very small amplitude; usually <1% of O1.\n * Rarely significant except in detailed harmonic analyses.\n */\nexport default defineConstituent(\"M1\", [1, 0, 0, 0, 0, 0, 1], nc.uM1, nc.fM1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar terdiurnal (M3).\n * Third-diurnal lunar constituent from Moon's orbital motion.\n * Typically found in shallow water and resonant systems.\n * Amplitude usually <2% of M2; important in some shallow-water analyses.\n */\n// Third diurnal\nexport default defineConstituent(\n \"M3\",\n [3, 0, 0, 0, 0, 0, 0],\n (a) => {\n return nc.uModd(a, 3);\n },\n (a) => {\n return nc.fModd(a, 3);\n },\n);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water quarter-diurnal (M4 = 2×M2).\n * First overtide of M2; generated in shallow-water environments.\n * Amplitude typically 2-10% of M2; largest of the quarter-diurnal constituents.\n * Important indicator of shallow-water tidal distortion.\n */\nexport default defineCompoundConstituent(\"M4\", [{ constituent: M2, factor: 2 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water sixth-diurnal (M6 = 3×M2).\n * Second overtide of M2; generated in shallow-water environments.\n * Amplitude typically 0.5-3% of M2; important in extreme shallow water.\n * Indicator of significant tidal distortion and non-linear effects.\n */\nexport default defineCompoundConstituent(\"M6\", [{ constituent: M2, factor: 3 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water eighth-diurnal (M8 = 4×M2).\n * Third overtide of M2; generated in extreme shallow-water environments.\n * Amplitude typically <0.5% of M2; very rarely significant.\n * Found only in highly distorted tidal regimes (extreme shallow water, enclosed basins).\n */\nexport default defineCompoundConstituent(\"M8\", [{ constituent: M2, factor: 4 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar variational semi-diurnal constituent (μ2, mu2).\n * Derived from Moon's orbital parameter variations.\n *\n * Note: Often included with M2 family in modern analysis. Minor constituent with\n * location-dependent amplitude.\n */\nexport default defineConstituent(\"MA2\", [2, 0, -1, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic constituent from parameter variations.\n *\n * From https://iho.int/mtg_docs/com_wg/IHOTC/IHOTC_Misc/TWCWG_Constituent_list.pdf:\n *\n * > MB2 was originally called Ma2 but this became ambiguous when spoken, or typed on\n * > computers without lower case, and so it was initially changed to MA2*. However, this\n * > in turn was thought to be clumsy and hence MB2 was finally adopted. Although\n * > theoretically they should have the same values of u and f as M2, they are so small\n * > that they are commonly treated as having values of u = 0 and f = 1.\n *\n * @see Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides\n */\nexport default defineConstituent(\"MB2\", [2, 0, 1, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar fortnightly (MF).\n * Long-period constituent from lunar inequality interactions.\n * Significant in long-term water level records and coastal resonances.\n */\nexport default defineConstituent(\"MF\", [0, 2, 0, 0, 0, 0, 0], nc.uMf, nc.fMf);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water terdiurnal (MK3).\n * Compound constituent: M2 + K1\n * Lunisolar interaction from M2 semi-diurnal and K1 diurnal components.\n * Generated in shallow-water environments; typical amplitude 0.5-2 cm.\n * Often paired with 2MK3 in terdiurnal tide analysis.\n */\nexport default defineCompoundConstituent(\"MK3\", [\n { constituent: M2, factor: 1 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Three-way shallow-water interaction of M2, K1, and S2.\n *\n * Warning: Not in standard IHO constituent bank. Shallow-water specific constituent\n * with definition varying by application and water depth. Use with caution and document\n * the specific convention used in your analysis.\n *\n * @see NOAA CO-OPS shallow-water constituents\n */\nexport default defineCompoundConstituent(\"MKS2\", [\n { constituent: M2, factor: 1 },\n { constituent: K1, factor: 1 },\n { constituent: S2, factor: -1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar monthly (MM).\n * Long-period constituent from lunar declination variations.\n * Important for long-term water level studies.\n */\nexport default defineConstituent(\"MM\", [0, 1, 0, -1, 0, 0, 0], nc.uZero, nc.fMm);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Shallow-water quarter-diurnal (MN4).\n * Compound constituent: M2 + N2\n * Lunar-lunar elliptic interaction from M2 and N2 semi-diurnal components.\n * Generated in shallow-water environments; typical amplitude 1-5 cm.\n * Often significant in shallow seas and estuaries.\n */\nexport default defineCompoundConstituent(\"MN4\", [\n { constituent: M2, factor: 1 },\n { constituent: N2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water quarter-diurnal (MS4).\n * Compound constituent: M2 + S2\n * Lunar-solar interaction from M2 and S2 semi-diurnal components.\n * Generated in shallow-water environments; typical amplitude 1-5 cm.\n * Often second-largest quarter-diurnal component after M4.\n */\nexport default defineCompoundConstituent(\"MS4\", [\n { constituent: M2, factor: 1 },\n { constituent: S2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Lunisolar synodic fortnightly (MSF = S2-M2).\n * Long-period constituent representing beat frequency between solar S2 and lunar M2.\n * Manifests as fortnightly modulation of tidal range (spring-neap cycle).\n * Amplitude typically 5-15% of M2; represents the primary spring-neap variation.\n * Important for tidal range predictions and coastal flooding assessments.\n */\nexport default defineCompoundConstituent(\"MSF\", [\n { constituent: S2, factor: 1 },\n { constituent: M2, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Lunar-solar interaction compound constituent.\n *\n * Warning: Non-standard constituent not in IHO or modern NOAA standard tables.\n * Definition varies significantly across sources. Rarely used in modern tide prediction.\n * Appears in Schureman's tables as variant shallow-water interaction.\n *\n * @see NOAA CO-OPS shallow-water constituents\n * @see Schureman shallow-water analysis tables\n */\nexport default defineCompoundConstituent(\"MSQM\", [\n { constituent: M2, factor: 1 },\n { constituent: S2, factor: 1 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar elliptic semi-diurnal (T2).\n * Larger solar elliptic semi-diurnal constituent from solar declination effects.\n * Amplitude typically <5% of S2; increases at higher latitudes.\n * Forms part of solar semi-diurnal analysis alongside S2 and R2.\n */\nexport default defineConstituent(\"T2\", [2, 2, -3, 0, 0, 1, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport T2 from \"./T2.js\";\n\n/**\n * Lunar-solar shallow-water interaction (M2 modulated by lunar orbit).\n *\n * Warning: Not in modern IHO standard constituents; mostly historical interest.\n * Often replaced by specific ν2, λ2, or other lunar elliptic terms in modern analysis.\n * Amplitude is location and depth-dependent.\n *\n * @see NOAA CO-OPS shallow-water variants\n * @see Schureman Manual\n */\nexport default defineCompoundConstituent(\"MTM\", [\n { constituent: M2, factor: 1 },\n { constituent: T2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water semi-diurnal (MU2 or μ2).\n * Compound constituent: 2×M2 - S2\n * Lunar variational constituent generated in shallow-water environments.\n * Amplitude typically <2% of M2; found in coastal shallow-water predictions.\n */\nexport default defineCompoundConstituent(\"MU2\", [\n { constituent: M2, factor: 2 },\n { constituent: S2, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Second overtide of N2; shallow-water quarter-diurnal harmonic.\n * Amplitude ranges 0.25 to 2.25 times mean due to 18.613-year lunar node cycle.\n *\n * Note: Shallow-water constituent, typically found in tide predictions for coastal areas.\n */\nexport default defineCompoundConstituent(\"N4\", [{ constituent: N2, factor: 2 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (NU2).\n * Secondary lunar elliptic semi-diurnal from Moon's orbital variations.\n * Amplitude typically 2-5% of M2; smaller than N2.\n * Important in detailed semi-diurnal constituent analysis.\n */\nexport default defineConstituent(\"NU2\", [2, -1, 2, -1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (OO1).\n * Second-order lunar diurnal constituent from Moon's orbital eccentricity.\n * Typically very small amplitude; <2% of O1 in most locations.\n * Important for detailed harmonic analysis in some regions.\n */\nexport default defineConstituent(\"OO1\", [1, 3, 0, 0, 0, 0, -1], nc.uOO1, nc.fOO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar diurnal (P1).\n * Principal solar diurnal constituent; one-per-solar-day oscillation.\n * Amplitude typically 1/3 of K1; varies with latitude.\n * Forms key component of diurnal tidal analysis alongside K1 and O1.\n */\nexport default defineConstituent(\"P1\", [1, 1, -2, 0, 0, 0, 1], nc.uZero, nc.fUnity);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Elliptic lunar diurnal (Q1).\n * One solar day and one lunar day modulation interaction.\n * Amplitude typically 2-5% of O1; important in diurnal constituent analysis.\n */\nexport default defineConstituent(\"Q1\", [1, -2, 0, 1, 0, 0, 1], nc.uO1, nc.fO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar elliptic semi-diurnal (R2).\n * Smaller solar elliptic semi-diurnal constituent from solar declination effects.\n * Amplitude typically <2% of S2; smallest of the solar semi-diurnal group.\n * Rarely significant except in very detailed analyses.\n */\nexport default defineConstituent(\"R2\", [2, 2, -1, 0, 0, -1, 2], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport R2 from \"./R2.js\";\n\n/**\n * Solar elliptic terdiurnal; 1.5 times R2 (smaller solar elliptic semi-diurnal).\n *\n * Note: Generated only in shallow water; very small amplitude (<0.05 cm typical).\n * Usually negligible except in extreme shallow-water environments.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"R3\", [{ constituent: R2, factor: 1.5 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport NU2 from \"./NU2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water diurnal (RHO1, ρ1).\n * Compound constituent: NU2-K1 (ν2-K1)\n * Derived from interaction of semi-diurnal NU2 and diurnal K1 constituents.\n * Amplitude typically very small; rarely significant.\n * Found only in shallow-water regions with strong tidal distortion.\n */\nexport default defineCompoundConstituent(\"RHO1\", [\n { constituent: NU2, factor: 1 },\n { constituent: K1, factor: -1 },\n]);\n","import RHO1 from \"./RHO1.js\";\n\n/**\n * Alias for compatibility between NOAA and IHO\n *\n * @see RHO1\n */\nexport default RHO1;\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar diurnal (S1).\n * Secondary solar diurnal constituent related to solar declination inequality.\n * Usually very small amplitude; typically dominated by K1 and P1 in diurnal analysis.\n * Rarely included in routine harmonic analyses.\n */\nexport default defineConstituent(\"S1\", [1, 1, -1, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Solar terdiurnal overtide; shallow-water only.\n *\n * Note: Generated only in shallow water; not found in deep ocean.\n * Typical amplitude <1 cm except in extreme shallow-water environments.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"S3\", [{ constituent: S2, factor: 1.5 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water quarter-diurnal (S4).\n * Compound constituent: 2×S2\n * First overtide of S2; generated in shallow-water environments.\n * Amplitude typically 1-3% of S2; smallest of the common quarter-diurnal constituents.\n * Purely solar, so has fixed amplitude and phase at any location.\n */\nexport default defineCompoundConstituent(\"S4\", [{ constituent: S2, factor: 2 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water sixth-diurnal (S6).\n * Compound constituent: 3×S2\n * Second overtide of S2; generated in shallow-water environments.\n * Amplitude typically 0.5-1% of S2; smallest of the common overtides.\n * Rarely significant except in extreme shallow water or resonant systems.\n */\nexport default defineCompoundConstituent(\"S6\", [{ constituent: S2, factor: 3 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar annual (Sa).\n * Long-term constituent driven by solar declination variations over the year.\n */\nexport default defineConstituent(\"Sa\", [0, 0, 1, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal variational constituent (σ1, sigma1).\n * Derived from Moon's declination variations.\n *\n * Note: Often has small amplitude; closely related to K1 and O1 variations.\n */\nexport default defineConstituent(\"SGM\", [1, -3, 2, 0, 0, 0, -1], nc.uO1, nc.fO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar semi-annual (Ssa).\n * Semi-annual constituent from solar declination with twice-yearly periodicity.\n */\nexport default defineConstituent(\"Ssa\", [0, 0, 2, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport T2 from \"./T2.js\";\n\n/**\n * Solar elliptic terdiurnal; 1.5 times T2 (larger solar elliptic semi-diurnal).\n *\n * Note: Generated only in shallow water; minimal amplitude (<0.1 cm typical).\n * Rarely significant except in extreme shallow-water or enclosed basins.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"T3\", [{ constituent: T2, factor: 1.5 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Mean sea level (Z0).\n * Not a tidal constituent in the strict sense, but represents the mean sea level offset\n * or the \"zero\" reference level used in tidal predictions.\n * No astronomical forcing; typically determined from harmonic analysis of observed data.\n */\nexport default defineConstituent(\"Z0\", [0, 0, 0, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { type Constituent } from \"./definition\";\n\n// Dynamically import all constituent files\nconst constituentModules = import.meta.glob<Constituent>(\"./*.ts\", {\n eager: true,\n import: \"default\",\n});\n\nconst constituents: Record<string, Constituent> = {};\n\n// Extract constituent name from file path and populate the constituents object\nfor (const [path, module] of Object.entries(constituentModules)) {\n // Skip the index file itself\n if (path.includes(\"index.ts\")) continue;\n\n // Extract filename without extension and .js suffix\n const name = path.split(\"/\").pop()?.replace(/\\..*$/, \"\") ?? \"\";\n\n // Skip module for definition.ts\n if (name === \"definition\") continue;\n\n constituents[name] = module;\n}\n\nexport default constituents;\n","import astro from \"../astronomy/index.js\";\nimport { d2r } from \"../astronomy/constants.js\";\nimport constituentModels from \"../constituents/index.js\";\n\nexport interface Timeline {\n items: Date[];\n hours: number[];\n}\n\nexport interface HarmonicConstituent {\n name: string;\n amplitude: number;\n phase: number;\n speed?: number;\n description?: string;\n}\n\nexport interface TimelinePoint {\n time: Date;\n hour: number;\n level: number;\n}\n\nexport interface Extreme {\n time: Date;\n level: number;\n high: boolean;\n low: boolean;\n label: string;\n}\n\nexport interface ExtremeOffsets {\n height?: {\n high?: number;\n low?: number;\n type?: \"fixed\" | \"ratio\";\n };\n time?: {\n high?: number;\n low?: number;\n };\n}\n\nexport interface ExtremeLabels {\n high?: string;\n low?: string;\n}\n\nexport interface ExtremesOptions {\n labels?: ExtremeLabels;\n offsets?: ExtremeOffsets;\n}\n\nexport interface Prediction {\n getExtremesPrediction: (options?: ExtremesOptions) => Extreme[];\n getTimelinePrediction: () => TimelinePoint[];\n}\n\nconst modulus = (a: number, b: number): number => {\n return ((a % b) + b) % b;\n};\n\nconst addExtremesOffsets = (extreme: Extreme, offsets?: ExtremeOffsets): Extreme => {\n if (typeof offsets === \"undefined\" || !offsets) {\n return extreme;\n }\n\n if (extreme.high && offsets.height?.high) {\n if (offsets.height.type === \"fixed\") {\n extreme.level += offsets.height.high;\n } else {\n extreme.level *= offsets.height.high;\n }\n }\n if (extreme.low && offsets.height?.low) {\n if (offsets.height.type === \"fixed\") {\n extreme.level += offsets.height.low;\n } else {\n extreme.level *= offsets.height.low;\n }\n }\n if (extreme.high && offsets.time?.high) {\n extreme.time = new Date(extreme.time.getTime() + offsets.time.high * 60 * 1000);\n }\n if (extreme.low && offsets.time?.low) {\n extreme.time = new Date(extreme.time.getTime() + offsets.time.low * 60 * 1000);\n }\n return extreme;\n};\n\nconst getExtremeLabel = (label: \"high\" | \"low\", highLowLabels?: ExtremeLabels): string => {\n if (typeof highLowLabels !== \"undefined\" && typeof highLowLabels[label] !== \"undefined\") {\n return highLowLabels[label]!;\n }\n const labels = {\n high: \"High\",\n low: \"Low\",\n };\n return labels[label];\n};\n\ninterface PredictionFactoryParams {\n timeline: Timeline;\n constituents: HarmonicConstituent[];\n start: Date;\n}\n\nconst predictionFactory = ({\n timeline,\n constituents,\n start,\n}: PredictionFactoryParams): Prediction => {\n const getLevel = (\n hour: number,\n modelBaseSpeed: Record<string, number>,\n modelU: Record<string, number>,\n modelF: Record<string, number>,\n modelBaseValue: Record<string, number>,\n ): number => {\n const amplitudes: number[] = [];\n let result = 0;\n\n constituents.forEach((constituent) => {\n const amplitude = constituent.amplitude;\n const phase = constituent.phase;\n const f = modelF[constituent.name];\n const speed = modelBaseSpeed[constituent.name];\n const u = modelU[constituent.name];\n const V0 = modelBaseValue[constituent.name];\n amplitudes.push(amplitude * f * Math.cos(speed * hour + (V0 + u) - phase));\n });\n // sum up each row\n amplitudes.forEach((item) => {\n result += item;\n });\n return result;\n };\n\n const prediction: Prediction = {} as Prediction;\n\n prediction.getExtremesPrediction = (options?: ExtremesOptions): Extreme[] => {\n const { labels, offsets } = typeof options !== \"undefined\" ? options : {};\n const results: Extreme[] = [];\n const { baseSpeed, u, f, baseValue } = prepare();\n let goingUp = false;\n let goingDown = false;\n let lastLevel = getLevel(0, baseSpeed, u[0], f[0], baseValue);\n timeline.items.forEach((time, index) => {\n const hour = timeline.hours[index];\n const level = getLevel(hour, baseSpeed, u[index], f[index], baseValue);\n // Compare this level to the last one, if we\n // are changing angle, then the last one was high or low\n if (level > lastLevel && goingDown) {\n results.push(\n addExtremesOffsets(\n {\n time: timeline.items[index - 1],\n level: lastLevel,\n high: false,\n low: true,\n label: getExtremeLabel(\"low\", labels),\n },\n offsets,\n ),\n );\n }\n if (level < lastLevel && goingUp) {\n results.push(\n addExtremesOffsets(\n {\n time: timeline.items[index - 1],\n level: lastLevel,\n high: true,\n low: false,\n label: getExtremeLabel(\"high\", labels),\n },\n offsets,\n ),\n );\n }\n if (level > lastLevel) {\n goingUp = true;\n goingDown = false;\n }\n if (level < lastLevel) {\n goingUp = false;\n goingDown = true;\n }\n lastLevel = level;\n });\n return results;\n };\n\n prediction.getTimelinePrediction = (): TimelinePoint[] => {\n const results: TimelinePoint[] = [];\n const { baseSpeed, u, f, baseValue } = prepare();\n timeline.items.forEach((time, index) => {\n const hour = timeline.hours[index];\n const prediction: TimelinePoint = {\n time,\n hour,\n level: getLevel(hour, baseSpeed, u[index], f[index], baseValue),\n };\n\n results.push(prediction);\n });\n return results;\n };\n\n const prepare = () => {\n const baseAstro = astro(start);\n\n const baseValue: Record<string, number> = {};\n const baseSpeed: Record<string, number> = {};\n const u: Record<string, number>[] = [];\n const f: Record<string, number>[] = [];\n constituents.forEach((constituent) => {\n const model = constituentModels[constituent.name];\n if (!model) return;\n\n const value = model.value(baseAstro);\n const speed = model.speed(baseAstro);\n baseValue[constituent.name] = d2r * value;\n baseSpeed[constituent.name] = d2r * speed;\n });\n timeline.items.forEach((time) => {\n const uItem: Record<string, number> = {};\n const fItem: Record<string, number> = {};\n const itemAstro = astro(time);\n constituents.forEach((constituent) => {\n const model = constituentModels[constituent.name];\n if (!model) return;\n\n const constituentU = modulus(model.u(itemAstro), 360);\n uItem[constituent.name] = d2r * constituentU;\n fItem[constituent.name] = modulus(model.f(itemAstro), 360);\n });\n\n u.push(uItem);\n f.push(fItem);\n });\n\n return {\n baseValue,\n baseSpeed,\n u,\n f,\n };\n };\n\n return Object.freeze(prediction);\n};\n\nexport default predictionFactory;\n","import prediction from \"./prediction.js\";\nimport constituentModels from \"../constituents/index.js\";\nimport { d2r } from \"../astronomy/constants.js\";\nimport type { HarmonicConstituent, Prediction } from \"./prediction.js\";\n\nexport type * from \"./prediction.js\";\n\nexport interface HarmonicsOptions {\n harmonicConstituents: HarmonicConstituent[];\n offset: number | false;\n}\n\nexport interface PredictionOptions {\n timeFidelity?: number;\n}\n\nexport interface Harmonics {\n setTimeSpan: (startTime: Date | number, endTime: Date | number) => Harmonics;\n prediction: (options?: PredictionOptions) => Prediction;\n}\n\nconst getDate = (time: Date | number): Date => {\n if (time instanceof Date) {\n return time;\n }\n if (typeof time === \"number\") {\n return new Date(time * 1000);\n }\n throw new Error(\"Invalid date format, should be a Date object, or timestamp\");\n};\n\nconst getTimeline = (start: Date, end: Date, seconds: number = 10 * 60) => {\n const items: Date[] = [];\n const endTime = end.getTime() / 1000;\n let lastTime = start.getTime() / 1000;\n const startTime = lastTime;\n const hours: number[] = [];\n while (lastTime <= endTime) {\n items.push(new Date(lastTime * 1000));\n hours.push((lastTime - startTime) / (60 * 60));\n lastTime += seconds;\n }\n\n return {\n items,\n hours,\n };\n};\n\nconst harmonicsFactory = ({ harmonicConstituents, offset }: HarmonicsOptions): Harmonics => {\n if (!Array.isArray(harmonicConstituents)) {\n throw new Error(\"Harmonic constituents are not an array\");\n }\n const constituents: HarmonicConstituent[] = [];\n harmonicConstituents.forEach((constituent) => {\n if (typeof constituent.name === \"undefined\") {\n throw new Error(\"Harmonic constituents must have a name property\");\n }\n if (constituentModels[constituent.name] !== undefined) {\n constituents.push({\n ...constituent,\n phase: d2r * constituent.phase,\n });\n }\n });\n\n if (offset !== false) {\n constituents.push({\n name: \"Z0\",\n phase: 0,\n amplitude: offset,\n });\n }\n\n let start = new Date();\n let end = new Date();\n\n const harmonics: Harmonics = {} as Harmonics;\n\n harmonics.setTimeSpan = (startTime: Date | number, endTime: Date | number): Harmonics => {\n start = getDate(startTime);\n end = getDate(endTime);\n if (start.getTime() >= end.getTime()) {\n throw new Error(\"Start time must be before end time\");\n }\n return harmonics;\n };\n\n harmonics.prediction = (options?: PredictionOptions): Prediction => {\n const opts = typeof options !== \"undefined\" ? options : { timeFidelity: 10 * 60 };\n return prediction({\n timeline: getTimeline(start, end, opts.timeFidelity),\n constituents,\n start,\n });\n };\n\n return Object.freeze(harmonics);\n};\n\nexport default harmonicsFactory;\nexport { getDate, getTimeline };\n","import harmonics from \"./harmonics/index.js\";\nimport { default as constituents } from \"./constituents/index.js\";\nimport type { HarmonicConstituent } from \"./harmonics/index.js\";\nimport type { TimelinePoint, Extreme, ExtremeOffsets } from \"./harmonics/prediction.js\";\n\nexport interface TidePredictionOptions {\n offset?: number | false;\n}\n\nexport interface TimeSpan {\n start: Date;\n end: Date;\n timeFidelity?: number;\n}\n\nexport interface ExtremesInput extends TimeSpan {\n labels?: {\n high?: string;\n low?: string;\n };\n offsets?: ExtremeOffsets;\n}\n\nexport interface TidePrediction {\n getTimelinePrediction: (params: TimeSpan) => TimelinePoint[];\n getExtremesPrediction: (params: ExtremesInput) => Extreme[];\n getWaterLevelAtTime: (params: { time: Date }) => TimelinePoint;\n}\n\nconst tidePredictionFactory = (\n constituents: HarmonicConstituent[],\n options: TidePredictionOptions = {},\n): TidePrediction => {\n const harmonicsOptions = {\n harmonicConstituents: constituents,\n offset: false as number | false,\n ...options,\n };\n\n const tidePrediction: TidePrediction = {\n getTimelinePrediction: ({ start, end, timeFidelity }: TimeSpan): TimelinePoint[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction({ timeFidelity })\n .getTimelinePrediction();\n },\n\n getExtremesPrediction: ({\n start,\n end,\n labels,\n offsets,\n timeFidelity,\n }: ExtremesInput): Extreme[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction({ timeFidelity })\n .getExtremesPrediction({ labels, offsets });\n },\n\n getWaterLevelAtTime: ({ time }: { time: Date }): TimelinePoint => {\n const endDate = new Date(time.getTime() + 10 * 60 * 1000);\n return harmonics(harmonicsOptions)\n .setTimeSpan(time, endDate)\n .prediction()\n .getTimelinePrediction()[0];\n },\n };\n\n return tidePrediction;\n};\n\n// Make constituents available on factory for reference\ntidePredictionFactory.constituents =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AI,SAAS,CAClC,OAAM,IAAI,MAAM,qCAAqC;AAEvD,SAAO;;AAGT,WAAU,cAAc,YAA4C;AAElE,SAAOC,mBAAW;GAChB,UAAU,YAAY,OAAO,MAFlB,OAAO,YAAY,cAAc,UAAU,EAAE,cAAc,KAAS,EAExC,aAAa;GACpD;GACA;GACD,CAAC;;AAGJ,QAAO,OAAO,OAAO,UAAU;;AAGjC,wBAAe;;;;ACvEf,MAAM,yBACJ,gBACA,UAAiC,EAAE,KAChB;CACnB,MAAM,mBAAmB;EACvB,sBAAsBC;EACtB,QAAQ;EACR,GAAG;EACJ;AAgCD,QA9BuC;EACrC,wBAAwB,EAAE,OAAO,KAAK,mBAA8C;AAClF,UAAOC,kBAAU,iBAAiB,CAC/B,YAAY,OAAO,IAAI,CACvB,WAAW,EAAE,cAAc,CAAC,CAC5B,uBAAuB;;EAG5B,wBAAwB,EACtB,OACA,KACA,QACA,SACA,mBAC8B;AAC9B,UAAOA,kBAAU,iBAAiB,CAC/B,YAAY,OAAO,IAAI,CACvB,WAAW,EAAE,cAAc,CAAC,CAC5B,sBAAsB;IAAE;IAAQ;IAAS,CAAC;;EAG/C,sBAAsB,EAAE,WAA0C;GAChE,MAAM,UAAU,IAAI,KAAK,KAAK,SAAS,GAAG,MAAU,IAAK;AACzD,UAAOA,kBAAU,iBAAiB,CAC/B,YAAY,MAAM,QAAQ,CAC1B,YAAY,CACZ,uBAAuB,CAAC;;EAE9B;;AAMH,sBAAsB,eAAeD;AAErC,kBAAe"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["coefficients: Coefficients","result: number[]","modulus","result: any","polynomials: Record<string, number[]>","coefficients","functions: Record<string, (N: number, i: number, omega: number) => number>","coefficients","astro","nodeCorrections","coefficients: number[]","f: number[]","results: number[]","nc","nc","M2","O1","nc","M2","K1","M2","O1","nc","M2","S2","nc","nc","nc","N2","J1","S2","M2","nc","L2","N2","nc","nc","nc","nc","nc","M2","M2","M2","nc","nc","nc","M2","K1","M2","K1","S2","nc","M2","N2","M2","S2","S2","M2","M2","S2","K1","nc","M2","T2","M2","S2","N2","nc","nc","nc","nc","nc","R2","NU2","K1","nc","S2","S2","S2","nc","nc","nc","T2","nc","constituents: Record<string, Constituent>","module","amplitudes: number[]","prediction: Prediction","results: Extreme[]","results: TimelinePoint[]","prediction: TimelinePoint","prediction","astro","baseValue: Record<string, number>","baseSpeed: Record<string, number>","u: Record<string, number>[]","f: Record<string, number>[]","constituentModels","uItem: Record<string, number>","fItem: Record<string, number>","items: Date[]","hours: number[]","constituents: HarmonicConstituent[]","constituentModels","harmonics: Harmonics","prediction","constituents","harmonics"],"sources":["../src/astronomy/constants.ts","../src/astronomy/coefficients.ts","../src/astronomy/index.ts","../src/node-corrections/index.ts","../src/constituents/definition.ts","../src/constituents/M2.ts","../src/constituents/O1.ts","../src/constituents/2MK3.ts","../src/constituents/K1.ts","../src/constituents/2MK5.ts","../src/constituents/2MO5.ts","../src/constituents/S2.ts","../src/constituents/2MS6.ts","../src/constituents/2N2.ts","../src/constituents/N2.ts","../src/constituents/J1.ts","../src/constituents/2Q1.ts","../src/constituents/2SM2.ts","../src/constituents/L2.ts","../src/constituents/3L2.ts","../src/constituents/3N2.ts","../src/constituents/EP2.ts","../src/constituents/K2.ts","../src/constituents/LAMBDA2.ts","../src/constituents/M1.ts","../src/constituents/M3.ts","../src/constituents/M4.ts","../src/constituents/M6.ts","../src/constituents/M8.ts","../src/constituents/MA2.ts","../src/constituents/MB2.ts","../src/constituents/MF.ts","../src/constituents/MK3.ts","../src/constituents/MKS2.ts","../src/constituents/MM.ts","../src/constituents/MN4.ts","../src/constituents/MS4.ts","../src/constituents/MSF.ts","../src/constituents/MSQM.ts","../src/constituents/T2.ts","../src/constituents/MTM.ts","../src/constituents/MU2.ts","../src/constituents/N4.ts","../src/constituents/NU2.ts","../src/constituents/OO1.ts","../src/constituents/P1.ts","../src/constituents/Q1.ts","../src/constituents/R2.ts","../src/constituents/R3.ts","../src/constituents/RHO1.ts","../src/constituents/S1.ts","../src/constituents/S3.ts","../src/constituents/S4.ts","../src/constituents/S6.ts","../src/constituents/SA.ts","../src/constituents/SGM.ts","../src/constituents/SSA.ts","../src/constituents/T3.ts","../src/constituents/Z0.ts","../src/constituents/index.ts","../src/harmonics/prediction.ts","../src/harmonics/index.ts","../src/index.ts"],"sourcesContent":["export const d2r = Math.PI / 180.0;\nexport const r2d = 180.0 / Math.PI;\n","// Convert a sexagesimal angle into decimal degrees\nconst sexagesimalToDecimal = (\n degrees: number,\n arcmins: number = 0,\n arcsecs: number = 0,\n mas: number = 0,\n muas: number = 0,\n): number => {\n return (\n degrees +\n arcmins / 60.0 +\n arcsecs / (60.0 * 60.0) +\n mas / (60.0 * 60.0 * 1e3) +\n muas / (60.0 * 60.0 * 1e6)\n );\n};\n\ninterface Coefficients {\n terrestrialObliquity: number[];\n solarPerigee: number[];\n solarLongitude: number[];\n lunarInclination: number[];\n lunarLongitude: number[];\n lunarNode: number[];\n lunarPerigee: number[];\n}\n\nconst coefficients: Coefficients = {\n // Meeus formula 21.3\n terrestrialObliquity: [\n sexagesimalToDecimal(23, 26, 21.448),\n -sexagesimalToDecimal(0, 0, 4680.93),\n -sexagesimalToDecimal(0, 0, 1.55),\n sexagesimalToDecimal(0, 0, 1999.25),\n -sexagesimalToDecimal(0, 0, 51.38),\n -sexagesimalToDecimal(0, 0, 249.67),\n -sexagesimalToDecimal(0, 0, 39.05),\n sexagesimalToDecimal(0, 0, 7.12),\n sexagesimalToDecimal(0, 0, 27.87),\n sexagesimalToDecimal(0, 0, 5.79),\n sexagesimalToDecimal(0, 0, 2.45),\n ].map((number, index) => {\n return number * Math.pow(1e-2, index);\n }),\n\n solarPerigee: [280.46645 - 357.5291, 36000.76932 - 35999.0503, 0.0003032 + 0.0001559, 0.00000048],\n\n solarLongitude: [280.46645, 36000.76983, 0.0003032],\n\n lunarInclination: [5.145],\n\n lunarLongitude: [218.3164591, 481267.88134236, -0.0013268, 1 / 538841.0 - 1 / 65194000.0],\n\n lunarNode: [125.044555, -1934.1361849, 0.0020762, 1 / 467410.0, -1 / 60616000.0],\n\n lunarPerigee: [83.353243, 4069.0137111, -0.0103238, -1 / 80053.0, 1 / 18999000.0],\n};\n\nexport default coefficients;\nexport { sexagesimalToDecimal };\nexport type { Coefficients };\n","import { d2r, r2d } from \"./constants.js\";\nimport coefficients from \"./coefficients.js\";\n\nexport interface AstroValue {\n value: number;\n speed: number;\n}\n\nexport interface AstroData {\n s: AstroValue;\n h: AstroValue;\n p: AstroValue;\n N: AstroValue;\n pp: AstroValue;\n \"90\": AstroValue;\n omega: AstroValue;\n i: AstroValue;\n I: AstroValue;\n xi: AstroValue;\n nu: AstroValue;\n nup: AstroValue;\n nupp: AstroValue;\n \"T+h-s\": AstroValue;\n P: AstroValue;\n}\n\n// Evaluates a polynomial at argument\nconst polynomial = (coefficients: number[], argument: number): number => {\n const result: number[] = [];\n coefficients.forEach((coefficient, index) => {\n result.push(coefficient * Math.pow(argument, index));\n });\n return result.reduce((a, b) => a + b);\n};\n\n// Evaluates a derivative polynomial at argument\nconst derivativePolynomial = (coefficients: number[], argument: number): number => {\n const result: number[] = [];\n coefficients.forEach((coefficient, index) => {\n result.push(coefficient * index * Math.pow(argument, index - 1));\n });\n return result.reduce((a, b) => a + b);\n};\n\n// Meeus formula 11.1\nconst T = (t: Date): number => {\n return (JD(t) - 2451545.0) / 36525;\n};\n\n// Meeus formula 7.1\nconst JD = (t: Date): number => {\n let Y = t.getUTCFullYear();\n let M = t.getUTCMonth() + 1;\n const D =\n t.getUTCDate() +\n t.getUTCHours() / 24.0 +\n t.getUTCMinutes() / (24.0 * 60.0) +\n t.getUTCSeconds() / (24.0 * 60.0 * 60.0) +\n t.getUTCMilliseconds() / (24.0 * 60.0 * 60.0 * 1e6);\n if (M <= 2) {\n Y = Y - 1;\n M = M + 12;\n }\n const A = Math.floor(Y / 100.0);\n const B = 2 - A + Math.floor(A / 4.0);\n return Math.floor(365.25 * (Y + 4716)) + Math.floor(30.6001 * (M + 1)) + D + B - 1524.5;\n};\n\nconst _I = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n const cosI = Math.cos(i) * Math.cos(omega) - Math.sin(i) * Math.sin(omega) * Math.cos(N);\n return r2d * Math.acos(cosI);\n};\n\nconst _xi = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n let e1 = (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) * Math.tan(0.5 * N);\n let e2 = (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) * Math.tan(0.5 * N);\n e1 = Math.atan(e1);\n e2 = Math.atan(e2);\n e1 = e1 - 0.5 * N;\n e2 = e2 - 0.5 * N;\n return -(e1 + e2) * r2d;\n};\n\nconst _nu = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n let e1 = (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) * Math.tan(0.5 * N);\n let e2 = (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) * Math.tan(0.5 * N);\n e1 = Math.atan(e1);\n e2 = Math.atan(e2);\n e1 = e1 - 0.5 * N;\n e2 = e2 - 0.5 * N;\n return (e1 - e2) * r2d;\n};\n\n// Schureman equation 224\nconst _nup = (N: number, i: number, omega: number): number => {\n const I = d2r * _I(N, i, omega);\n const nu = d2r * _nu(N, i, omega);\n return (\n r2d * Math.atan((Math.sin(2 * I) * Math.sin(nu)) / (Math.sin(2 * I) * Math.cos(nu) + 0.3347))\n );\n};\n\n// Schureman equation 232\nconst _nupp = (N: number, i: number, omega: number): number => {\n const I = d2r * _I(N, i, omega);\n const nu = d2r * _nu(N, i, omega);\n const tan2nupp =\n (Math.sin(I) ** 2 * Math.sin(2 * nu)) / (Math.sin(I) ** 2 * Math.cos(2 * nu) + 0.0727);\n return r2d * 0.5 * Math.atan(tan2nupp);\n};\n\nconst modulus = (a: number, b: number): number => {\n return ((a % b) + b) % b;\n};\n\nconst astro = (time: Date): AstroData => {\n // This gets cast to `AstroData` later, but we build it up step by step here\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: any = {};\n\n const polynomials: Record<string, number[]> = {\n s: coefficients.lunarLongitude,\n h: coefficients.solarLongitude,\n p: coefficients.lunarPerigee,\n N: coefficients.lunarNode,\n pp: coefficients.solarPerigee,\n \"90\": [90.0],\n omega: coefficients.terrestrialObliquity,\n i: coefficients.lunarInclination,\n };\n\n // Polynomials are in T, that is Julian Centuries; we want our speeds to be\n // in the more convenient unit of degrees per hour.\n const dTdHour = 1 / (24 * 365.25 * 100);\n for (const name in polynomials) {\n result[name] = {\n value: modulus(polynomial(polynomials[name], T(time)), 360.0),\n speed: derivativePolynomial(polynomials[name], T(time)) * dTdHour,\n };\n }\n\n // Some other parameters defined by Schureman which are dependent on the\n // parameters N, i, omega for use in node factor calculations. We don't need\n // their speeds.\n const functions: Record<string, (N: number, i: number, omega: number) => number> = {\n I: _I,\n xi: _xi,\n nu: _nu,\n nup: _nup,\n nupp: _nupp,\n };\n Object.keys(functions).forEach((name) => {\n const functionCall = functions[name];\n result[name] = {\n value: modulus(functionCall(result.N.value, result.i.value, result.omega.value), 360.0),\n speed: null,\n };\n });\n\n // We don't work directly with the T (hours) parameter, instead our spanning\n // set for equilibrium arguments #is given by T+h-s, s, h, p, N, pp, 90.\n // This is in line with convention.\n const hour = {\n value: (JD(time) - Math.floor(JD(time))) * 360.0,\n speed: 15.0,\n };\n\n result[\"T+h-s\"] = {\n value: hour.value + result.h.value - result.s.value,\n speed: hour.speed + result.h.speed - result.s.speed,\n };\n\n // It is convenient to calculate Schureman's P here since several node\n // factors need it, although it could be argued that these\n // (along with I, xi, nu etc) belong somewhere else.\n result.P = {\n value: result.p.value - (result.xi.value % 360.0),\n speed: null,\n };\n\n return result as AstroData;\n};\n\nexport default astro;\nexport { polynomial, derivativePolynomial, T, JD, _I, _xi, _nu, _nup, _nupp };\n","import { d2r, r2d } from \"../astronomy/constants.js\";\nimport type { AstroData } from \"../astronomy/index.js\";\n\nexport type NodeCorrectionFunction = (a: AstroData, ...args: unknown[]) => number;\n\nconst corrections = {\n fUnity(): number {\n return 1;\n },\n\n // Schureman equations 73, 65\n fMm(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n (2 / 3.0 - Math.pow(Math.sin(omega), 2)) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n return (2 / 3.0 - Math.pow(Math.sin(I), 2)) / mean;\n },\n\n // Schureman equations 74, 66\n fMf(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.pow(Math.sin(omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return Math.pow(Math.sin(I), 2) / mean;\n },\n\n // Schureman equations 75, 67\n fO1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n Math.sin(omega) * Math.pow(Math.cos(0.5 * omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return (Math.sin(I) * Math.pow(Math.cos(0.5 * I), 2)) / mean;\n },\n\n // Schureman equations 76, 68\n fJ1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.sin(2 * omega) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n return Math.sin(2 * I) / mean;\n },\n\n // Schureman equations 77, 69\n fOO1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n Math.sin(omega) * Math.pow(Math.sin(0.5 * omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return (Math.sin(I) * Math.pow(Math.sin(0.5 * I), 2)) / mean;\n },\n\n // Schureman equations 78, 70\n fM2(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.pow(Math.cos(0.5 * omega), 4) * Math.pow(Math.cos(0.5 * i), 4);\n return Math.pow(Math.cos(0.5 * I), 4) / mean;\n },\n\n // Schureman equations 227, 226, 68\n // Should probably eventually include the derivations of the magic numbers (0.5023 etc).\n fK1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const nu = d2r * a.nu.value;\n const sin2IcosnuMean = Math.sin(2 * omega) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n const mean = 0.5023 * sin2IcosnuMean + 0.1681;\n return (\n Math.pow(\n 0.2523 * Math.pow(Math.sin(2 * I), 2) + 0.1689 * Math.sin(2 * I) * Math.cos(nu) + 0.0283,\n 0.5,\n ) / mean\n );\n },\n\n // Schureman equations 215, 213, 204\n // It can be (and has been) confirmed that the exponent for R_a reads 1/2 via Schureman Table 7\n fL2(a: AstroData): number {\n const P = d2r * a.P.value;\n const I = d2r * a.I.value;\n const rAInv = Math.pow(\n 1 -\n 12 * Math.pow(Math.tan(0.5 * I), 2) * Math.cos(2 * P) +\n 36 * Math.pow(Math.tan(0.5 * I), 4),\n 0.5,\n );\n return corrections.fM2(a) * rAInv;\n },\n\n // Schureman equations 235, 234, 71\n // Again, magic numbers\n fK2(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const nu = d2r * a.nu.value;\n const sinsqIcos2nuMean = Math.sin(omega) ** 2 * (1 - (3 / 2.0) * Math.sin(i) ** 2);\n const mean = 0.5023 * sinsqIcos2nuMean + 0.0365;\n return (\n Math.pow(\n 0.2523 * Math.pow(Math.sin(I), 4) +\n 0.0367 * Math.pow(Math.sin(I), 2) * Math.cos(2 * nu) +\n 0.0013,\n 0.5,\n ) / mean\n );\n },\n\n // Schureman equations 206, 207, 195\n fM1(a: AstroData): number {\n const P = d2r * a.P.value;\n const I = d2r * a.I.value;\n const qAInv = Math.pow(\n 0.25 +\n 1.5 * Math.cos(I) * Math.cos(2 * P) * Math.pow(Math.cos(0.5 * I), -0.5) +\n 2.25 * Math.pow(Math.cos(I), 2) * Math.pow(Math.cos(0.5 * I), -4),\n 0.5,\n );\n return corrections.fO1(a) * qAInv;\n },\n\n // See e.g. Schureman equation 149\n fModd(a: AstroData, n: number): number {\n return Math.pow(corrections.fM2(a), n / 2.0);\n },\n\n // Node factors u, see Table 2 of Schureman.\n\n uZero(): number {\n return 0.0;\n },\n\n uMf(a: AstroData): number {\n return -2.0 * a.xi.value;\n },\n\n uO1(a: AstroData): number {\n return 2.0 * a.xi.value - a.nu.value;\n },\n\n uJ1(a: AstroData): number {\n return -a.nu.value;\n },\n\n uOO1(a: AstroData): number {\n return -2.0 * a.xi.value - a.nu.value;\n },\n\n uM2(a: AstroData): number {\n return 2.0 * a.xi.value - 2.0 * a.nu.value;\n },\n\n uK1(a: AstroData): number {\n return -a.nup.value;\n },\n\n // Schureman 214\n uL2(a: AstroData): number {\n const I = d2r * a.I.value;\n const P = d2r * a.P.value;\n const R =\n r2d *\n Math.atan(Math.sin(2 * P) / ((1 / 6.0) * Math.pow(Math.tan(0.5 * I), -2) - Math.cos(2 * P)));\n return 2.0 * a.xi.value - 2.0 * a.nu.value - R;\n },\n\n uK2(a: AstroData): number {\n return -2.0 * a.nupp.value;\n },\n\n // Schureman 202\n uM1(a: AstroData): number {\n const I = d2r * a.I.value;\n const P = d2r * a.P.value;\n const Q = r2d * Math.atan(((5 * Math.cos(I) - 1) / (7 * Math.cos(I) + 1)) * Math.tan(P));\n return a.xi.value - a.nu.value + Q;\n },\n\n uModd(a: AstroData, n: number): number {\n return (n / 2.0) * corrections.uM2(a);\n },\n};\n\nexport default corrections;\n","import type { AstroData } from \"../astronomy/index.js\";\nimport nodeCorrections, { type NodeCorrectionFunction } from \"../node-corrections/index.js\";\n\nexport interface Constituent {\n names: string[];\n coefficients: number[];\n value: (astro: AstroData) => number;\n speed: (astro: AstroData) => number;\n u: NodeCorrectionFunction;\n f: NodeCorrectionFunction;\n}\n\nexport function defineConstituent(\n names: string | string[],\n coefficients: number[],\n u?: NodeCorrectionFunction,\n f?: NodeCorrectionFunction,\n): Constituent {\n if (!coefficients) {\n throw new Error(\"Coefficient must be defined for a constituent\");\n }\n\n return Object.freeze({\n names: Array.isArray(names) ? names : [names],\n\n coefficients,\n\n value: (astro: AstroData): number => {\n return dotArray(coefficients, astronomicValues(astro));\n },\n\n speed(astro: AstroData): number {\n return dotArray(coefficients, astronomicSpeed(astro));\n },\n\n u: typeof u !== \"undefined\" ? u : nodeCorrections.uZero,\n\n f: typeof f !== \"undefined\" ? f : nodeCorrections.fUnity,\n });\n}\n\nexport interface ConstituentMember {\n constituent: Constituent;\n factor: number;\n}\n\nexport function defineCompoundConstituent(\n names: string | string[],\n members: ConstituentMember[],\n): Constituent {\n const coefficients: number[] = [];\n members.forEach(({ constituent, factor }) => {\n constituent.coefficients.forEach((coefficient, index) => {\n if (typeof coefficients[index] === \"undefined\") {\n coefficients[index] = 0;\n }\n coefficients[index] += coefficient * factor;\n });\n });\n\n return Object.freeze({\n names: Array.isArray(names) ? names : [names],\n coefficients,\n\n speed: (astro: AstroData): number => {\n let speed = 0;\n members.forEach(({ constituent, factor }) => {\n speed += constituent.speed(astro) * factor;\n });\n return speed;\n },\n\n value: (astro: AstroData): number => {\n let value = 0;\n members.forEach(({ constituent, factor }) => {\n value += constituent.value(astro) * factor;\n });\n return value;\n },\n\n u: (astro: AstroData): number => {\n let u = 0;\n members.forEach(({ constituent, factor }) => {\n u += constituent.u(astro) * factor;\n });\n return u;\n },\n\n f: (astro: AstroData): number => {\n const f: number[] = [];\n members.forEach(({ constituent, factor }) => {\n f.push(Math.pow(constituent.f(astro), Math.abs(factor)));\n });\n return f.reduce((previous, value) => previous * value);\n },\n });\n}\n\n/**\n * Computes the dot notation of two arrays\n */\nfunction dotArray(a: number[], b: number[]): number {\n const results: number[] = [];\n a.forEach((value, index) => {\n results.push(value * b[index]);\n });\n return results.reduce((total, value) => total + value);\n}\n\nexport function astronimicDoodsonNumber(astro: AstroData): AstroData[keyof AstroData][] {\n return [astro[\"T+h-s\"], astro.s, astro.h, astro.p, astro.N, astro.pp, astro[\"90\"]];\n}\n\nexport function astronomicSpeed(astro: AstroData): number[] {\n const results: number[] = [];\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.speed);\n });\n return results;\n}\n\nexport function astronomicValues(astro: AstroData): number[] {\n const results: number[] = [];\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.value);\n });\n return results;\n}\n\n// Silence TS warning for empty module\nexport default {};\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (M2).\n * Primary principal lunar constituent; largest semi-diurnal tidal component globally.\n * Amplitude varies 10-20% over lunar node cycle; typically 0.2-0.5m in coastal areas.\n * Base constituent for many compound shallow-water constituents.\n */\nexport default defineConstituent(\"M2\", [2, 0, 0, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (O1).\n * Primary lunar diurnal constituent; one-per-lunar-day oscillation.\n * Amplitude varies 10-20% due to lunar node effects.\n */\nexport default defineConstituent(\"O1\", [1, -1, 0, 0, 0, 0, 1], nc.uO1, nc.fO1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport O1 from \"./O1.js\";\n\n/**\n * Shallow-water terdiurnal (2MK3 = M2 + O1).\n * Lunar-lunar interaction from M2 semi-diurnal and O1 diurnal components.\n * Generated in shallow-water environments; typical amplitude <1 cm.\n */\nexport default defineCompoundConstituent(\"2MK3\", [\n { constituent: M2, factor: 1 },\n { constituent: O1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunisolar diurnal (K1).\n * Combined lunar and solar diurnal constituent; strongest diurnal tide in many regions.\n * Often comparable in amplitude to O1; amplitude ratio K1/O1 varies with latitude.\n */\nexport default defineConstituent(\"K1\", [1, 1, 0, 0, 0, 0, -1], nc.uK1, nc.fK1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water fifth-diurnal from M2-K1 interaction.\n *\n * Note: Found in coastal tide predictions, especially in enclosed bays and harbors.\n * Amplitude typically 0.1-0.5 cm depending on location and water depth.\n * Shallow-water constituent only; not present in deep ocean.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"2MK5\", [\n { constituent: M2, factor: 2 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport O1 from \"./O1.js\";\n\n/**\n * Shallow-water fifth-diurnal from M2-O1 interaction.\n *\n * Note: Primarily shallow-water coastal phenomenon, not present in deep ocean.\n * Amplitude typically <0.5 cm except in extreme shallow-water or enclosed basins.\n * Found in coastal tide predictions alongside other shallow-water constituents.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"2MO5\", [\n { constituent: M2, factor: 2 },\n { constituent: O1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar semi-diurnal (S2).\n * Principal solar semi-diurnal constituent; largest solar tide component.\n * Amplitude typically 20-50% of M2; varies with geographic location and latitude.\n * Ratio M2/S2 determines tidal form factor (diurnal vs semi-diurnal regimes).\n * Base constituent for many compound shallow-water constituents.\n */\nexport default defineConstituent(\"S2\", [2, 2, -2, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Sixth-diurnal shallow-water interaction: 2×M2 + S2.\n *\n * Generated only in shallow water; typical amplitude 0.01-0.2 meters depending on depth.\n * Included in IHO shallow-water constituent tables and NOAA analysis (order #37).\n */\nexport default defineCompoundConstituent(\"2MS6\", [\n { constituent: M2, factor: 2 },\n { constituent: S2, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (2N2).\n * Second-order lunar semi-diurnal from Moon's orbital ellipticity.\n * Amplitude typically 5-10% of M2; significant in semi-diurnal analysis.\n */\nexport default defineConstituent(\"2N2\", [2, -2, 0, 2, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (N2).\n * Primary lunar elliptic semi-diurnal constituent from Moon's orbital variations.\n * Amplitude typically 5-15% of M2; third-largest semi-diurnal constituent.\n */\nexport default defineConstituent(\"N2\", [2, -1, 0, 1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (J1).\n * Shallow-water lunar diurnal constituent; generally much smaller than O1 and K1.\n * Typically important only in shallow-water systems and enclosed basins.\n * Amplitude usually <5% of O1; rarely significant in routine predictions.\n */\nexport default defineConstituent(\"J1\", [1, 2, 0, -1, 0, 0, -1], nc.uJ1, nc.fJ1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\nimport J1 from \"./J1.js\";\n\n/**\n * Shallow-water diurnal (2Q1 = N2-J1).\n * Derived from interaction of semi-diurnal N2 and diurnal J1 constituents.\n * Amplitude typically very small; rarely significant.\n * Found only in shallow-water regions with strong tidal distortion.\n */\nexport default defineCompoundConstituent(\"2Q1\", [\n { constituent: N2, factor: 1 },\n { constituent: J1, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water semi-diurnal (2SM2).\n * Compound constituent: 2×S2 - M2\n * Solar-lunar interaction constituent generated in shallow-water environments.\n * Amplitude typically <2% of M2; complementary to MU2.\n */\nexport default defineCompoundConstituent(\"2SM2\", [\n { constituent: S2, factor: 2 },\n { constituent: M2, factor: -1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (L2).\n * Secondary lunar elliptic semi-diurnal from Moon's orbital variations and perigee effects.\n * Amplitude typically 1-3% of M2; often grouped with other lunar elliptic constituents.\n * Important in detailed harmonic analyses of semi-diurnal tides.\n */\nexport default defineConstituent(\"L2\", [2, 1, 0, -1, 0, 0, 2], nc.uL2, nc.fL2);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport L2 from \"./L2.js\";\n\n/**\n * Triple lunar elliptic; 3 times L2 interaction.\n *\n * Warning: Not in standard IHO constituent bank. Mainly historical/theoretical interest.\n * Very small amplitude (<0.1 cm); found only in extreme shallow water or enclosed basins.\n * Often ignored in routine tide predictions.\n *\n * @see Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides\n */\nexport default defineCompoundConstituent(\"3L2\", [{ constituent: L2, factor: 3 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Triple N2 shallow-water harmonic (3 × N2).\n *\n * Note: Shallow-water constituent with definition based on compound frequency estimates.\n * Typical amplitude <0.5 cm; often <0.1 cm except in extreme shallow-water or enclosed basins.\n * Rarely significant in routine tide predictions.\n *\n * @see NOAA CO-OPS shallow-water constituents\n */\nexport default defineCompoundConstituent(\"3N2\", [{ constituent: N2, factor: 3 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal constituent (ε2).\n */\nexport default defineConstituent(\"EP2\", [2, -3, 2, 1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunisolar semi-diurnal (K2).\n * Combined lunar and solar semi-diurnal constituent from declination effects.\n * Amplitude typically 10-30% of S2; second-largest solar-related semi-diurnal component.\n * Important in semi-diurnal tidal analysis, especially at mid-latitudes.\n */\nexport default defineConstituent(\"K2\", [2, 2, 0, 0, 0, 0, 0], nc.uK2, nc.fK2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (λ2, lambda2).\n * Lunar semi-diurnal constituent from Moon's perigee effects.\n * Amplitude typically <5% of M2; important in detailed constituent analysis.\n * IHO standard designation (previously abbreviated as LAM2).\n */\nexport default defineConstituent([\"LAM2\", \"LAMBDA2\"], [2, 1, -2, 1, 0, 0, 2], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal elliptic (M1).\n * Secondary lunar diurnal constituent from Moon's elliptical orbit.\n * Typically very small amplitude; usually <1% of O1.\n * Rarely significant except in detailed harmonic analyses.\n */\nexport default defineConstituent(\"M1\", [1, 0, 0, 0, 0, 0, 1], nc.uM1, nc.fM1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar terdiurnal (M3).\n * Third-diurnal lunar constituent from Moon's orbital motion.\n * Typically found in shallow water and resonant systems.\n * Amplitude usually <2% of M2; important in some shallow-water analyses.\n */\n// Third diurnal\nexport default defineConstituent(\n \"M3\",\n [3, 0, 0, 0, 0, 0, 0],\n (a) => {\n return nc.uModd(a, 3);\n },\n (a) => {\n return nc.fModd(a, 3);\n },\n);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water quarter-diurnal (M4 = 2×M2).\n * First overtide of M2; generated in shallow-water environments.\n * Amplitude typically 2-10% of M2; largest of the quarter-diurnal constituents.\n * Important indicator of shallow-water tidal distortion.\n */\nexport default defineCompoundConstituent(\"M4\", [{ constituent: M2, factor: 2 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water sixth-diurnal (M6 = 3×M2).\n * Second overtide of M2; generated in shallow-water environments.\n * Amplitude typically 0.5-3% of M2; important in extreme shallow water.\n * Indicator of significant tidal distortion and non-linear effects.\n */\nexport default defineCompoundConstituent(\"M6\", [{ constituent: M2, factor: 3 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water eighth-diurnal (M8 = 4×M2).\n * Third overtide of M2; generated in extreme shallow-water environments.\n * Amplitude typically <0.5% of M2; very rarely significant.\n * Found only in highly distorted tidal regimes (extreme shallow water, enclosed basins).\n */\nexport default defineCompoundConstituent(\"M8\", [{ constituent: M2, factor: 4 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar variational semi-diurnal constituent (μ2, mu2).\n * Derived from Moon's orbital parameter variations.\n *\n * Note: Often included with M2 family in modern analysis. Minor constituent with\n * location-dependent amplitude.\n */\nexport default defineConstituent(\"MA2\", [2, 0, -1, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic constituent from parameter variations.\n *\n * From https://iho.int/mtg_docs/com_wg/IHOTC/IHOTC_Misc/TWCWG_Constituent_list.pdf:\n *\n * > MB2 was originally called Ma2 but this became ambiguous when spoken, or typed on\n * > computers without lower case, and so it was initially changed to MA2*. However, this\n * > in turn was thought to be clumsy and hence MB2 was finally adopted. Although\n * > theoretically they should have the same values of u and f as M2, they are so small\n * > that they are commonly treated as having values of u = 0 and f = 1.\n *\n * @see Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides\n */\nexport default defineConstituent(\"MB2\", [2, 0, 1, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar fortnightly (MF).\n * Long-period constituent from lunar inequality interactions.\n * Significant in long-term water level records and coastal resonances.\n */\nexport default defineConstituent(\"MF\", [0, 2, 0, 0, 0, 0, 0], nc.uMf, nc.fMf);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water terdiurnal (MK3).\n * Compound constituent: M2 + K1\n * Lunisolar interaction from M2 semi-diurnal and K1 diurnal components.\n * Generated in shallow-water environments; typical amplitude 0.5-2 cm.\n * Often paired with 2MK3 in terdiurnal tide analysis.\n */\nexport default defineCompoundConstituent(\"MK3\", [\n { constituent: M2, factor: 1 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Three-way shallow-water interaction of M2, K1, and S2.\n *\n * Warning: Not in standard IHO constituent bank. Shallow-water specific constituent\n * with definition varying by application and water depth. Use with caution and document\n * the specific convention used in your analysis.\n *\n * @see NOAA CO-OPS shallow-water constituents\n */\nexport default defineCompoundConstituent(\"MKS2\", [\n { constituent: M2, factor: 1 },\n { constituent: K1, factor: 1 },\n { constituent: S2, factor: -1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar monthly (MM).\n * Long-period constituent from lunar declination variations.\n * Important for long-term water level studies.\n */\nexport default defineConstituent(\"MM\", [0, 1, 0, -1, 0, 0, 0], nc.uZero, nc.fMm);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Shallow-water quarter-diurnal (MN4).\n * Compound constituent: M2 + N2\n * Lunar-lunar elliptic interaction from M2 and N2 semi-diurnal components.\n * Generated in shallow-water environments; typical amplitude 1-5 cm.\n * Often significant in shallow seas and estuaries.\n */\nexport default defineCompoundConstituent(\"MN4\", [\n { constituent: M2, factor: 1 },\n { constituent: N2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water quarter-diurnal (MS4).\n * Compound constituent: M2 + S2\n * Lunar-solar interaction from M2 and S2 semi-diurnal components.\n * Generated in shallow-water environments; typical amplitude 1-5 cm.\n * Often second-largest quarter-diurnal component after M4.\n */\nexport default defineCompoundConstituent(\"MS4\", [\n { constituent: M2, factor: 1 },\n { constituent: S2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Lunisolar synodic fortnightly (MSF = S2-M2).\n * Long-period constituent representing beat frequency between solar S2 and lunar M2.\n * Manifests as fortnightly modulation of tidal range (spring-neap cycle).\n * Amplitude typically 5-15% of M2; represents the primary spring-neap variation.\n * Important for tidal range predictions and coastal flooding assessments.\n */\nexport default defineCompoundConstituent(\"MSF\", [\n { constituent: S2, factor: 1 },\n { constituent: M2, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Lunar-solar interaction compound constituent.\n *\n * Warning: Non-standard constituent not in IHO or modern NOAA standard tables.\n * Definition varies significantly across sources. Rarely used in modern tide prediction.\n * Appears in Schureman's tables as variant shallow-water interaction.\n *\n * @see NOAA CO-OPS shallow-water constituents\n * @see Schureman shallow-water analysis tables\n */\nexport default defineCompoundConstituent(\"MSQM\", [\n { constituent: M2, factor: 1 },\n { constituent: S2, factor: 1 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar elliptic semi-diurnal (T2).\n * Larger solar elliptic semi-diurnal constituent from solar declination effects.\n * Amplitude typically <5% of S2; increases at higher latitudes.\n * Forms part of solar semi-diurnal analysis alongside S2 and R2.\n */\nexport default defineConstituent(\"T2\", [2, 2, -3, 0, 0, 1, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport T2 from \"./T2.js\";\n\n/**\n * Lunar-solar shallow-water interaction (M2 modulated by lunar orbit).\n *\n * Warning: Not in modern IHO standard constituents; mostly historical interest.\n * Often replaced by specific ν2, λ2, or other lunar elliptic terms in modern analysis.\n * Amplitude is location and depth-dependent.\n *\n * @see NOAA CO-OPS shallow-water variants\n * @see Schureman Manual\n */\nexport default defineCompoundConstituent(\"MTM\", [\n { constituent: M2, factor: 1 },\n { constituent: T2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water semi-diurnal (MU2 or μ2).\n * Compound constituent: 2×M2 - S2\n * Lunar variational constituent generated in shallow-water environments.\n * Amplitude typically <2% of M2; found in coastal shallow-water predictions.\n */\nexport default defineCompoundConstituent(\"MU2\", [\n { constituent: M2, factor: 2 },\n { constituent: S2, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Second overtide of N2; shallow-water quarter-diurnal harmonic.\n * Amplitude ranges 0.25 to 2.25 times mean due to 18.613-year lunar node cycle.\n *\n * Note: Shallow-water constituent, typically found in tide predictions for coastal areas.\n */\nexport default defineCompoundConstituent(\"N4\", [{ constituent: N2, factor: 2 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (NU2).\n * Secondary lunar elliptic semi-diurnal from Moon's orbital variations.\n * Amplitude typically 2-5% of M2; smaller than N2.\n * Important in detailed semi-diurnal constituent analysis.\n */\nexport default defineConstituent(\"NU2\", [2, -1, 2, -1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (OO1).\n * Second-order lunar diurnal constituent from Moon's orbital eccentricity.\n * Typically very small amplitude; <2% of O1 in most locations.\n * Important for detailed harmonic analysis in some regions.\n */\nexport default defineConstituent(\"OO1\", [1, 3, 0, 0, 0, 0, -1], nc.uOO1, nc.fOO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar diurnal (P1).\n * Principal solar diurnal constituent; one-per-solar-day oscillation.\n * Amplitude typically 1/3 of K1; varies with latitude.\n * Forms key component of diurnal tidal analysis alongside K1 and O1.\n */\nexport default defineConstituent(\"P1\", [1, 1, -2, 0, 0, 0, 1], nc.uZero, nc.fUnity);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Elliptic lunar diurnal (Q1).\n * One solar day and one lunar day modulation interaction.\n * Amplitude typically 2-5% of O1; important in diurnal constituent analysis.\n */\nexport default defineConstituent(\"Q1\", [1, -2, 0, 1, 0, 0, 1], nc.uO1, nc.fO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar elliptic semi-diurnal (R2).\n * Smaller solar elliptic semi-diurnal constituent from solar declination effects.\n * Amplitude typically <2% of S2; smallest of the solar semi-diurnal group.\n * Rarely significant except in very detailed analyses.\n */\nexport default defineConstituent(\"R2\", [2, 2, -1, 0, 0, -1, 2], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport R2 from \"./R2.js\";\n\n/**\n * Solar elliptic terdiurnal; 1.5 times R2 (smaller solar elliptic semi-diurnal).\n *\n * Note: Generated only in shallow water; very small amplitude (<0.05 cm typical).\n * Usually negligible except in extreme shallow-water environments.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"R3\", [{ constituent: R2, factor: 1.5 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport NU2 from \"./NU2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water diurnal (RHO1, ρ1).\n * Compound constituent: NU2-K1 (ν2-K1)\n * Derived from interaction of semi-diurnal NU2 and diurnal K1 constituents.\n * Amplitude typically very small; rarely significant.\n * Found only in shallow-water regions with strong tidal distortion.\n */\nexport default defineCompoundConstituent(\n [\"RHO\", \"RHO1\"],\n [\n { constituent: NU2, factor: 1 },\n { constituent: K1, factor: -1 },\n ],\n);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar diurnal (S1).\n * Secondary solar diurnal constituent related to solar declination inequality.\n * Usually very small amplitude; typically dominated by K1 and P1 in diurnal analysis.\n * Rarely included in routine harmonic analyses.\n */\nexport default defineConstituent(\"S1\", [1, 1, -1, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Solar terdiurnal overtide; shallow-water only.\n *\n * Note: Generated only in shallow water; not found in deep ocean.\n * Typical amplitude <1 cm except in extreme shallow-water environments.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"S3\", [{ constituent: S2, factor: 1.5 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water quarter-diurnal (S4).\n * Compound constituent: 2×S2\n * First overtide of S2; generated in shallow-water environments.\n * Amplitude typically 1-3% of S2; smallest of the common quarter-diurnal constituents.\n * Purely solar, so has fixed amplitude and phase at any location.\n */\nexport default defineCompoundConstituent(\"S4\", [{ constituent: S2, factor: 2 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water sixth-diurnal (S6).\n * Compound constituent: 3×S2\n * Second overtide of S2; generated in shallow-water environments.\n * Amplitude typically 0.5-1% of S2; smallest of the common overtides.\n * Rarely significant except in extreme shallow water or resonant systems.\n */\nexport default defineCompoundConstituent(\"S6\", [{ constituent: S2, factor: 3 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar annual (Sa).\n * Long-term constituent driven by solar declination variations over the year.\n */\nexport default defineConstituent([\"SA\", \"Sa\"], [0, 0, 1, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal variational constituent (σ1, sigma1).\n * Derived from Moon's declination variations.\n *\n * Note: Often has small amplitude; closely related to K1 and O1 variations.\n */\nexport default defineConstituent([\"SGM\", \"SIGMA1\"], [1, -3, 2, 0, 0, 0, -1], nc.uO1, nc.fO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar semi-annual (Ssa).\n * Semi-annual constituent from solar declination with twice-yearly periodicity.\n */\nexport default defineConstituent([\"Ssa\", \"SSA\"], [0, 0, 2, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport T2 from \"./T2.js\";\n\n/**\n * Solar elliptic terdiurnal; 1.5 times T2 (larger solar elliptic semi-diurnal).\n *\n * Note: Generated only in shallow water; minimal amplitude (<0.1 cm typical).\n * Rarely significant except in extreme shallow-water or enclosed basins.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"T3\", [{ constituent: T2, factor: 1.5 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Mean sea level (Z0).\n * Not a tidal constituent in the strict sense, but represents the mean sea level offset\n * or the \"zero\" reference level used in tidal predictions.\n * No astronomical forcing; typically determined from harmonic analysis of observed data.\n */\nexport default defineConstituent(\"Z0\", [0, 0, 0, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { type Constituent } from \"./definition\";\n\n// Dynamically import all constituent files\nconst constituentModules = import.meta.glob<Constituent>(\"./*.ts\", {\n eager: true,\n import: \"default\",\n});\n\nconst constituents: Record<string, Constituent> = {};\n\n// Extract constituent name from file path and populate the constituents object\nfor (const [path, module] of Object.entries(constituentModules)) {\n // Skip the index and definition files\n if (path.match(/index|definition/)) continue;\n\n module.names.forEach((name) => {\n constituents[name] = module;\n });\n}\n\nexport default constituents;\n","import astro from \"../astronomy/index.js\";\nimport { d2r } from \"../astronomy/constants.js\";\nimport constituentModels from \"../constituents/index.js\";\n\nexport interface Timeline {\n items: Date[];\n hours: number[];\n}\n\nexport interface HarmonicConstituent {\n name: string;\n amplitude: number;\n phase: number;\n speed?: number;\n description?: string;\n}\n\nexport interface TimelinePoint {\n time: Date;\n hour: number;\n level: number;\n}\n\nexport interface Extreme {\n time: Date;\n level: number;\n high: boolean;\n low: boolean;\n label: string;\n}\n\nexport interface ExtremeOffsets {\n height?: {\n high?: number;\n low?: number;\n type?: \"fixed\" | \"ratio\";\n };\n time?: {\n high?: number;\n low?: number;\n };\n}\n\nexport interface ExtremeLabels {\n high?: string;\n low?: string;\n}\n\nexport interface ExtremesOptions {\n labels?: ExtremeLabels;\n offsets?: ExtremeOffsets;\n}\n\nexport interface Prediction {\n getExtremesPrediction: (options?: ExtremesOptions) => Extreme[];\n getTimelinePrediction: () => TimelinePoint[];\n}\n\nconst modulus = (a: number, b: number): number => {\n return ((a % b) + b) % b;\n};\n\nconst addExtremesOffsets = (extreme: Extreme, offsets?: ExtremeOffsets): Extreme => {\n if (typeof offsets === \"undefined\" || !offsets) {\n return extreme;\n }\n\n if (extreme.high && offsets.height?.high) {\n if (offsets.height.type === \"fixed\") {\n extreme.level += offsets.height.high;\n } else {\n extreme.level *= offsets.height.high;\n }\n }\n if (extreme.low && offsets.height?.low) {\n if (offsets.height.type === \"fixed\") {\n extreme.level += offsets.height.low;\n } else {\n extreme.level *= offsets.height.low;\n }\n }\n if (extreme.high && offsets.time?.high) {\n extreme.time = new Date(extreme.time.getTime() + offsets.time.high * 60 * 1000);\n }\n if (extreme.low && offsets.time?.low) {\n extreme.time = new Date(extreme.time.getTime() + offsets.time.low * 60 * 1000);\n }\n return extreme;\n};\n\nconst getExtremeLabel = (label: \"high\" | \"low\", highLowLabels?: ExtremeLabels): string => {\n if (typeof highLowLabels !== \"undefined\" && typeof highLowLabels[label] !== \"undefined\") {\n return highLowLabels[label]!;\n }\n const labels = {\n high: \"High\",\n low: \"Low\",\n };\n return labels[label];\n};\n\ninterface PredictionFactoryParams {\n timeline: Timeline;\n constituents: HarmonicConstituent[];\n start: Date;\n}\n\nconst predictionFactory = ({\n timeline,\n constituents,\n start,\n}: PredictionFactoryParams): Prediction => {\n const getLevel = (\n hour: number,\n modelBaseSpeed: Record<string, number>,\n modelU: Record<string, number>,\n modelF: Record<string, number>,\n modelBaseValue: Record<string, number>,\n ): number => {\n const amplitudes: number[] = [];\n let result = 0;\n\n constituents.forEach((constituent) => {\n const amplitude = constituent.amplitude;\n const phase = constituent.phase;\n const f = modelF[constituent.name];\n const speed = modelBaseSpeed[constituent.name];\n const u = modelU[constituent.name];\n const V0 = modelBaseValue[constituent.name];\n amplitudes.push(amplitude * f * Math.cos(speed * hour + (V0 + u) - phase));\n });\n // sum up each row\n amplitudes.forEach((item) => {\n result += item;\n });\n return result;\n };\n\n const prediction: Prediction = {} as Prediction;\n\n prediction.getExtremesPrediction = (options?: ExtremesOptions): Extreme[] => {\n const { labels, offsets } = typeof options !== \"undefined\" ? options : {};\n const results: Extreme[] = [];\n const { baseSpeed, u, f, baseValue } = prepare();\n let goingUp = false;\n let goingDown = false;\n let lastLevel = getLevel(0, baseSpeed, u[0], f[0], baseValue);\n timeline.items.forEach((time, index) => {\n const hour = timeline.hours[index];\n const level = getLevel(hour, baseSpeed, u[index], f[index], baseValue);\n // Compare this level to the last one, if we\n // are changing angle, then the last one was high or low\n if (level > lastLevel && goingDown) {\n results.push(\n addExtremesOffsets(\n {\n time: timeline.items[index - 1],\n level: lastLevel,\n high: false,\n low: true,\n label: getExtremeLabel(\"low\", labels),\n },\n offsets,\n ),\n );\n }\n if (level < lastLevel && goingUp) {\n results.push(\n addExtremesOffsets(\n {\n time: timeline.items[index - 1],\n level: lastLevel,\n high: true,\n low: false,\n label: getExtremeLabel(\"high\", labels),\n },\n offsets,\n ),\n );\n }\n if (level > lastLevel) {\n goingUp = true;\n goingDown = false;\n }\n if (level < lastLevel) {\n goingUp = false;\n goingDown = true;\n }\n lastLevel = level;\n });\n return results;\n };\n\n prediction.getTimelinePrediction = (): TimelinePoint[] => {\n const results: TimelinePoint[] = [];\n const { baseSpeed, u, f, baseValue } = prepare();\n timeline.items.forEach((time, index) => {\n const hour = timeline.hours[index];\n const prediction: TimelinePoint = {\n time,\n hour,\n level: getLevel(hour, baseSpeed, u[index], f[index], baseValue),\n };\n\n results.push(prediction);\n });\n return results;\n };\n\n const prepare = () => {\n const baseAstro = astro(start);\n\n const baseValue: Record<string, number> = {};\n const baseSpeed: Record<string, number> = {};\n const u: Record<string, number>[] = [];\n const f: Record<string, number>[] = [];\n constituents.forEach((constituent) => {\n const model = constituentModels[constituent.name];\n if (!model) return;\n\n const value = model.value(baseAstro);\n const speed = model.speed(baseAstro);\n baseValue[constituent.name] = d2r * value;\n baseSpeed[constituent.name] = d2r * speed;\n });\n timeline.items.forEach((time) => {\n const uItem: Record<string, number> = {};\n const fItem: Record<string, number> = {};\n const itemAstro = astro(time);\n constituents.forEach((constituent) => {\n const model = constituentModels[constituent.name];\n if (!model) return;\n\n const constituentU = modulus(model.u(itemAstro), 360);\n uItem[constituent.name] = d2r * constituentU;\n fItem[constituent.name] = modulus(model.f(itemAstro), 360);\n });\n\n u.push(uItem);\n f.push(fItem);\n });\n\n return {\n baseValue,\n baseSpeed,\n u,\n f,\n };\n };\n\n return Object.freeze(prediction);\n};\n\nexport default predictionFactory;\n","import prediction from \"./prediction.js\";\nimport constituentModels from \"../constituents/index.js\";\nimport { d2r } from \"../astronomy/constants.js\";\nimport type { HarmonicConstituent, Prediction } from \"./prediction.js\";\n\nexport type * from \"./prediction.js\";\n\nexport interface HarmonicsOptions {\n harmonicConstituents: HarmonicConstituent[];\n offset: number | false;\n}\n\nexport interface PredictionOptions {\n timeFidelity?: number;\n}\n\nexport interface Harmonics {\n setTimeSpan: (startTime: Date | number, endTime: Date | number) => Harmonics;\n prediction: (options?: PredictionOptions) => Prediction;\n}\n\nconst getDate = (time: Date | number): Date => {\n if (time instanceof Date) {\n return time;\n }\n if (typeof time === \"number\") {\n return new Date(time * 1000);\n }\n throw new Error(\"Invalid date format, should be a Date object, or timestamp\");\n};\n\nconst getTimeline = (start: Date, end: Date, seconds: number = 10 * 60) => {\n const items: Date[] = [];\n const endTime = end.getTime() / 1000;\n let lastTime = start.getTime() / 1000;\n const startTime = lastTime;\n const hours: number[] = [];\n while (lastTime <= endTime) {\n items.push(new Date(lastTime * 1000));\n hours.push((lastTime - startTime) / (60 * 60));\n lastTime += seconds;\n }\n\n return {\n items,\n hours,\n };\n};\n\nconst harmonicsFactory = ({ harmonicConstituents, offset }: HarmonicsOptions): Harmonics => {\n if (!Array.isArray(harmonicConstituents)) {\n throw new Error(\"Harmonic constituents are not an array\");\n }\n const constituents: HarmonicConstituent[] = [];\n harmonicConstituents.forEach((constituent) => {\n if (typeof constituent.name === \"undefined\") {\n throw new Error(\"Harmonic constituents must have a name property\");\n }\n if (constituentModels[constituent.name] !== undefined) {\n constituents.push({\n ...constituent,\n phase: d2r * constituent.phase,\n });\n }\n });\n\n if (offset !== false) {\n constituents.push({\n name: \"Z0\",\n phase: 0,\n amplitude: offset,\n });\n }\n\n let start = new Date();\n let end = new Date();\n\n const harmonics: Harmonics = {} as Harmonics;\n\n harmonics.setTimeSpan = (startTime: Date | number, endTime: Date | number): Harmonics => {\n start = getDate(startTime);\n end = getDate(endTime);\n if (start.getTime() >= end.getTime()) {\n throw new Error(\"Start time must be before end time\");\n }\n return harmonics;\n };\n\n harmonics.prediction = (options?: PredictionOptions): Prediction => {\n const opts = typeof options !== \"undefined\" ? options : { timeFidelity: 10 * 60 };\n return prediction({\n timeline: getTimeline(start, end, opts.timeFidelity),\n constituents,\n start,\n });\n };\n\n return Object.freeze(harmonics);\n};\n\nexport default harmonicsFactory;\nexport { getDate, getTimeline };\n","import harmonics from \"./harmonics/index.js\";\nimport { default as constituents } from \"./constituents/index.js\";\nimport type { HarmonicConstituent } from \"./harmonics/index.js\";\nimport type { TimelinePoint, Extreme, ExtremeOffsets } from \"./harmonics/prediction.js\";\n\nexport interface TidePredictionOptions {\n offset?: number | false;\n}\n\nexport interface TimeSpan {\n start: Date;\n end: Date;\n timeFidelity?: number;\n}\n\nexport interface ExtremesInput extends TimeSpan {\n labels?: {\n high?: string;\n low?: string;\n };\n offsets?: ExtremeOffsets;\n}\n\nexport interface TidePrediction {\n getTimelinePrediction: (params: TimeSpan) => TimelinePoint[];\n getExtremesPrediction: (params: ExtremesInput) => Extreme[];\n getWaterLevelAtTime: (params: { time: Date }) => TimelinePoint;\n}\n\nconst tidePredictionFactory = (\n constituents: HarmonicConstituent[],\n options: TidePredictionOptions = {},\n): TidePrediction => {\n const harmonicsOptions = {\n harmonicConstituents: constituents,\n offset: false as number | false,\n ...options,\n };\n\n const tidePrediction: TidePrediction = {\n getTimelinePrediction: ({ start, end, timeFidelity }: TimeSpan): TimelinePoint[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction({ timeFidelity })\n .getTimelinePrediction();\n },\n\n getExtremesPrediction: ({\n start,\n end,\n labels,\n offsets,\n timeFidelity,\n }: ExtremesInput): Extreme[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction({ timeFidelity })\n .getExtremesPrediction({ labels, offsets });\n },\n\n getWaterLevelAtTime: ({ time }: { time: Date }): TimelinePoint => {\n const endDate = new Date(time.getTime() + 10 * 60 * 1000);\n return harmonics(harmonicsOptions)\n .setTimeSpan(time, endDate)\n .prediction()\n .getTimelinePrediction()[0];\n },\n };\n\n return tidePrediction;\n};\n\n// Make constituents available on factory for reference\ntidePredictionFactory.constituents = constituents;\n\nexport default tidePredictionFactory;\nexport type { HarmonicConstituent, TimelinePoint, Extreme };\n"],"mappings":";;AAAA,MAAa,MAAM,KAAK,KAAK;AAC7B,MAAa,MAAM,MAAQ,KAAK;;;;ACAhC,MAAM,wBACJ,SACA,UAAkB,GAClB,UAAkB,GAClB,MAAc,GACd,OAAe,MACJ;AACX,QACE,UACA,UAAU,KACV,UAAW,OACX,OAAO,OAAc,OACrB,QAAQ,OAAc;;AAc1B,MAAMA,eAA6B;CAEjC,sBAAsB;EACpB,qBAAqB,IAAI,IAAI,OAAO;EACpC,CAAC,qBAAqB,GAAG,GAAG,QAAQ;EACpC,CAAC,qBAAqB,GAAG,GAAG,KAAK;EACjC,qBAAqB,GAAG,GAAG,QAAQ;EACnC,CAAC,qBAAqB,GAAG,GAAG,MAAM;EAClC,CAAC,qBAAqB,GAAG,GAAG,OAAO;EACnC,CAAC,qBAAqB,GAAG,GAAG,MAAM;EAClC,qBAAqB,GAAG,GAAG,KAAK;EAChC,qBAAqB,GAAG,GAAG,MAAM;EACjC,qBAAqB,GAAG,GAAG,KAAK;EAChC,qBAAqB,GAAG,GAAG,KAAK;EACjC,CAAC,KAAK,QAAQ,UAAU;AACvB,SAAO,SAAS,KAAK,IAAI,KAAM,MAAM;GACrC;CAEF,cAAc;EAAC;EAAsB;EAA0B;EAAuB;EAAW;CAEjG,gBAAgB;EAAC;EAAW;EAAa;EAAU;CAEnD,kBAAkB,CAAC,MAAM;CAEzB,gBAAgB;EAAC;EAAa;EAAiB;EAAY,IAAI,SAAW,IAAI;EAAW;CAEzF,WAAW;EAAC;EAAY;EAAe;EAAW,IAAI;EAAU,KAAK;EAAW;CAEhF,cAAc;EAAC;EAAW;EAAc;EAAY,KAAK;EAAS,IAAI;EAAW;CAClF;AAED,2BAAe;;;;AC/Bf,MAAM,cAAc,gBAAwB,aAA6B;CACvE,MAAMC,SAAmB,EAAE;AAC3B,gBAA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WAAU,eAAe,WAA0B,YAAsC;AACvF,UAAQ,QAAQ,UAAU;AAC1B,QAAM,QAAQ,QAAQ;AACtB,MAAI,MAAM,SAAS,IAAI,IAAI,SAAS,CAClC,OAAM,IAAI,MAAM,qCAAqC;AAEvD,SAAO;;AAGT,WAAU,cAAc,YAA4C;AAElE,SAAOC,mBAAW;GAChB,UAAU,YAAY,OAAO,MAFlB,OAAO,YAAY,cAAc,UAAU,EAAE,cAAc,KAAS,EAExC,aAAa;GACpD;GACA;GACD,CAAC;;AAGJ,QAAO,OAAO,OAAO,UAAU;;AAGjC,wBAAe;;;;ACvEf,MAAM,yBACJ,gBACA,UAAiC,EAAE,KAChB;CACnB,MAAM,mBAAmB;EACvB,sBAAsBC;EACtB,QAAQ;EACR,GAAG;EACJ;AAgCD,QA9BuC;EACrC,wBAAwB,EAAE,OAAO,KAAK,mBAA8C;AAClF,UAAOC,kBAAU,iBAAiB,CAC/B,YAAY,OAAO,IAAI,CACvB,WAAW,EAAE,cAAc,CAAC,CAC5B,uBAAuB;;EAG5B,wBAAwB,EACtB,OACA,KACA,QACA,SACA,mBAC8B;AAC9B,UAAOA,kBAAU,iBAAiB,CAC/B,YAAY,OAAO,IAAI,CACvB,WAAW,EAAE,cAAc,CAAC,CAC5B,sBAAsB;IAAE;IAAQ;IAAS,CAAC;;EAG/C,sBAAsB,EAAE,WAA0C;GAChE,MAAM,UAAU,IAAI,KAAK,KAAK,SAAS,GAAG,MAAU,IAAK;AACzD,UAAOA,kBAAU,iBAAiB,CAC/B,YAAY,MAAM,QAAQ,CAC1B,YAAY,CACZ,uBAAuB,CAAC;;EAE9B;;AAMH,sBAAsB,eAAeD;AAErC,kBAAe"}
|
package/dist/index.d.cts
CHANGED
|
@@ -26,7 +26,7 @@ type NodeCorrectionFunction = (a: AstroData, ...args: unknown[]) => number;
|
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/constituents/definition.d.ts
|
|
28
28
|
interface Constituent {
|
|
29
|
-
|
|
29
|
+
names: string[];
|
|
30
30
|
coefficients: number[];
|
|
31
31
|
value: (astro: AstroData) => number;
|
|
32
32
|
speed: (astro: AstroData) => number;
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ type NodeCorrectionFunction = (a: AstroData, ...args: unknown[]) => number;
|
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/constituents/definition.d.ts
|
|
28
28
|
interface Constituent {
|
|
29
|
-
|
|
29
|
+
names: string[];
|
|
30
30
|
coefficients: number[];
|
|
31
31
|
value: (astro: AstroData) => number;
|
|
32
32
|
speed: (astro: AstroData) => number;
|
package/dist/index.js
CHANGED
|
@@ -304,10 +304,10 @@ var node_corrections_default = corrections;
|
|
|
304
304
|
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region src/constituents/definition.ts
|
|
307
|
-
function defineConstituent(
|
|
307
|
+
function defineConstituent(names, coefficients$1, u, f) {
|
|
308
308
|
if (!coefficients$1) throw new Error("Coefficient must be defined for a constituent");
|
|
309
309
|
return Object.freeze({
|
|
310
|
-
|
|
310
|
+
names: Array.isArray(names) ? names : [names],
|
|
311
311
|
coefficients: coefficients$1,
|
|
312
312
|
value: (astro$1) => {
|
|
313
313
|
return dotArray(coefficients$1, astronomicValues(astro$1));
|
|
@@ -319,7 +319,7 @@ function defineConstituent(name, coefficients$1, u, f) {
|
|
|
319
319
|
f: typeof f !== "undefined" ? f : node_corrections_default.fUnity
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
|
-
function defineCompoundConstituent(
|
|
322
|
+
function defineCompoundConstituent(names, members) {
|
|
323
323
|
const coefficients$1 = [];
|
|
324
324
|
members.forEach(({ constituent, factor }) => {
|
|
325
325
|
constituent.coefficients.forEach((coefficient, index) => {
|
|
@@ -328,7 +328,7 @@ function defineCompoundConstituent(name, members) {
|
|
|
328
328
|
});
|
|
329
329
|
});
|
|
330
330
|
return Object.freeze({
|
|
331
|
-
|
|
331
|
+
names: Array.isArray(names) ? names : [names],
|
|
332
332
|
coefficients: coefficients$1,
|
|
333
333
|
speed: (astro$1) => {
|
|
334
334
|
let speed = 0;
|
|
@@ -712,7 +712,7 @@ var K2_default = defineConstituent("K2", [
|
|
|
712
712
|
* Amplitude typically <5% of M2; important in detailed constituent analysis.
|
|
713
713
|
* IHO standard designation (previously abbreviated as LAM2).
|
|
714
714
|
*/
|
|
715
|
-
var LAMBDA2_default = defineConstituent("LAMBDA2", [
|
|
715
|
+
var LAMBDA2_default = defineConstituent(["LAM2", "LAMBDA2"], [
|
|
716
716
|
2,
|
|
717
717
|
1,
|
|
718
718
|
-2,
|
|
@@ -722,15 +722,6 @@ var LAMBDA2_default = defineConstituent("LAMBDA2", [
|
|
|
722
722
|
2
|
|
723
723
|
], node_corrections_default.uM2, node_corrections_default.fM2);
|
|
724
724
|
|
|
725
|
-
//#endregion
|
|
726
|
-
//#region src/constituents/LAM2.ts
|
|
727
|
-
/**
|
|
728
|
-
* Alias for compatibility between NOAA and IHO
|
|
729
|
-
*
|
|
730
|
-
* @see LAMBDA2
|
|
731
|
-
*/
|
|
732
|
-
var LAM2_default = LAMBDA2_default;
|
|
733
|
-
|
|
734
725
|
//#endregion
|
|
735
726
|
//#region src/constituents/M1.ts
|
|
736
727
|
/**
|
|
@@ -1189,7 +1180,7 @@ var R3_default = defineCompoundConstituent("R3", [{
|
|
|
1189
1180
|
* Amplitude typically very small; rarely significant.
|
|
1190
1181
|
* Found only in shallow-water regions with strong tidal distortion.
|
|
1191
1182
|
*/
|
|
1192
|
-
var RHO1_default = defineCompoundConstituent("RHO1", [{
|
|
1183
|
+
var RHO1_default = defineCompoundConstituent(["RHO", "RHO1"], [{
|
|
1193
1184
|
constituent: NU2_default,
|
|
1194
1185
|
factor: 1
|
|
1195
1186
|
}, {
|
|
@@ -1197,15 +1188,6 @@ var RHO1_default = defineCompoundConstituent("RHO1", [{
|
|
|
1197
1188
|
factor: -1
|
|
1198
1189
|
}]);
|
|
1199
1190
|
|
|
1200
|
-
//#endregion
|
|
1201
|
-
//#region src/constituents/RHO.ts
|
|
1202
|
-
/**
|
|
1203
|
-
* Alias for compatibility between NOAA and IHO
|
|
1204
|
-
*
|
|
1205
|
-
* @see RHO1
|
|
1206
|
-
*/
|
|
1207
|
-
var RHO_default = RHO1_default;
|
|
1208
|
-
|
|
1209
1191
|
//#endregion
|
|
1210
1192
|
//#region src/constituents/S1.ts
|
|
1211
1193
|
/**
|
|
@@ -1273,7 +1255,7 @@ var S6_default = defineCompoundConstituent("S6", [{
|
|
|
1273
1255
|
* Solar annual (Sa).
|
|
1274
1256
|
* Long-term constituent driven by solar declination variations over the year.
|
|
1275
1257
|
*/
|
|
1276
|
-
var SA_default = defineConstituent("Sa", [
|
|
1258
|
+
var SA_default = defineConstituent(["SA", "Sa"], [
|
|
1277
1259
|
0,
|
|
1278
1260
|
0,
|
|
1279
1261
|
1,
|
|
@@ -1291,7 +1273,7 @@ var SA_default = defineConstituent("Sa", [
|
|
|
1291
1273
|
*
|
|
1292
1274
|
* Note: Often has small amplitude; closely related to K1 and O1 variations.
|
|
1293
1275
|
*/
|
|
1294
|
-
var SGM_default = defineConstituent("SGM", [
|
|
1276
|
+
var SGM_default = defineConstituent(["SGM", "SIGMA1"], [
|
|
1295
1277
|
1,
|
|
1296
1278
|
-3,
|
|
1297
1279
|
2,
|
|
@@ -1307,7 +1289,7 @@ var SGM_default = defineConstituent("SGM", [
|
|
|
1307
1289
|
* Solar semi-annual (Ssa).
|
|
1308
1290
|
* Semi-annual constituent from solar declination with twice-yearly periodicity.
|
|
1309
1291
|
*/
|
|
1310
|
-
var SSA_default = defineConstituent("Ssa", [
|
|
1292
|
+
var SSA_default = defineConstituent(["Ssa", "SSA"], [
|
|
1311
1293
|
0,
|
|
1312
1294
|
0,
|
|
1313
1295
|
2,
|
|
@@ -1367,7 +1349,6 @@ const constituentModules = {
|
|
|
1367
1349
|
"./K1.ts": K1_default,
|
|
1368
1350
|
"./K2.ts": K2_default,
|
|
1369
1351
|
"./L2.ts": L2_default,
|
|
1370
|
-
"./LAM2.ts": LAM2_default,
|
|
1371
1352
|
"./LAMBDA2.ts": LAMBDA2_default,
|
|
1372
1353
|
"./M1.ts": M1_default,
|
|
1373
1354
|
"./M2.ts": M2_default,
|
|
@@ -1396,7 +1377,6 @@ const constituentModules = {
|
|
|
1396
1377
|
"./Q1.ts": Q1_default,
|
|
1397
1378
|
"./R2.ts": R2_default,
|
|
1398
1379
|
"./R3.ts": R3_default,
|
|
1399
|
-
"./RHO.ts": RHO_default,
|
|
1400
1380
|
"./RHO1.ts": RHO1_default,
|
|
1401
1381
|
"./S1.ts": S1_default,
|
|
1402
1382
|
"./S2.ts": S2_default,
|
|
@@ -1413,10 +1393,10 @@ const constituentModules = {
|
|
|
1413
1393
|
};
|
|
1414
1394
|
const constituents = {};
|
|
1415
1395
|
for (const [path, module] of Object.entries(constituentModules)) {
|
|
1416
|
-
if (path.
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1396
|
+
if (path.match(/index|definition/)) continue;
|
|
1397
|
+
module.names.forEach((name) => {
|
|
1398
|
+
constituents[name] = module;
|
|
1399
|
+
});
|
|
1420
1400
|
}
|
|
1421
1401
|
var constituents_default = constituents;
|
|
1422
1402
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["coefficients: Coefficients","result: number[]","modulus","result: any","polynomials: Record<string, number[]>","coefficients","functions: Record<string, (N: number, i: number, omega: number) => number>","coefficients","astro","nodeCorrections","coefficients: number[]","f: number[]","results: number[]","nc","nc","M2","O1","nc","M2","K1","M2","O1","nc","M2","S2","nc","nc","nc","N2","J1","S2","M2","nc","L2","N2","nc","nc","nc","LAMBDA2","nc","nc","M2","M2","M2","nc","nc","nc","M2","K1","M2","K1","S2","nc","M2","N2","M2","S2","S2","M2","M2","S2","K1","nc","M2","T2","M2","S2","N2","nc","nc","nc","nc","nc","R2","NU2","K1","RHO1","nc","S2","S2","S2","nc","nc","nc","T2","nc","constituents: Record<string, Constituent>","amplitudes: number[]","prediction: Prediction","results: Extreme[]","results: TimelinePoint[]","prediction: TimelinePoint","prediction","astro","baseValue: Record<string, number>","baseSpeed: Record<string, number>","u: Record<string, number>[]","f: Record<string, number>[]","constituentModels","uItem: Record<string, number>","fItem: Record<string, number>","items: Date[]","hours: number[]","constituents: HarmonicConstituent[]","constituentModels","harmonics: Harmonics","prediction","constituents","harmonics"],"sources":["../src/astronomy/constants.ts","../src/astronomy/coefficients.ts","../src/astronomy/index.ts","../src/node-corrections/index.ts","../src/constituents/definition.ts","../src/constituents/M2.ts","../src/constituents/O1.ts","../src/constituents/2MK3.ts","../src/constituents/K1.ts","../src/constituents/2MK5.ts","../src/constituents/2MO5.ts","../src/constituents/S2.ts","../src/constituents/2MS6.ts","../src/constituents/2N2.ts","../src/constituents/N2.ts","../src/constituents/J1.ts","../src/constituents/2Q1.ts","../src/constituents/2SM2.ts","../src/constituents/L2.ts","../src/constituents/3L2.ts","../src/constituents/3N2.ts","../src/constituents/EP2.ts","../src/constituents/K2.ts","../src/constituents/LAMBDA2.ts","../src/constituents/LAM2.ts","../src/constituents/M1.ts","../src/constituents/M3.ts","../src/constituents/M4.ts","../src/constituents/M6.ts","../src/constituents/M8.ts","../src/constituents/MA2.ts","../src/constituents/MB2.ts","../src/constituents/MF.ts","../src/constituents/MK3.ts","../src/constituents/MKS2.ts","../src/constituents/MM.ts","../src/constituents/MN4.ts","../src/constituents/MS4.ts","../src/constituents/MSF.ts","../src/constituents/MSQM.ts","../src/constituents/T2.ts","../src/constituents/MTM.ts","../src/constituents/MU2.ts","../src/constituents/N4.ts","../src/constituents/NU2.ts","../src/constituents/OO1.ts","../src/constituents/P1.ts","../src/constituents/Q1.ts","../src/constituents/R2.ts","../src/constituents/R3.ts","../src/constituents/RHO1.ts","../src/constituents/RHO.ts","../src/constituents/S1.ts","../src/constituents/S3.ts","../src/constituents/S4.ts","../src/constituents/S6.ts","../src/constituents/SA.ts","../src/constituents/SGM.ts","../src/constituents/SSA.ts","../src/constituents/T3.ts","../src/constituents/Z0.ts","../src/constituents/index.ts","../src/harmonics/prediction.ts","../src/harmonics/index.ts","../src/index.ts"],"sourcesContent":["export const d2r = Math.PI / 180.0;\nexport const r2d = 180.0 / Math.PI;\n","// Convert a sexagesimal angle into decimal degrees\nconst sexagesimalToDecimal = (\n degrees: number,\n arcmins: number = 0,\n arcsecs: number = 0,\n mas: number = 0,\n muas: number = 0,\n): number => {\n return (\n degrees +\n arcmins / 60.0 +\n arcsecs / (60.0 * 60.0) +\n mas / (60.0 * 60.0 * 1e3) +\n muas / (60.0 * 60.0 * 1e6)\n );\n};\n\ninterface Coefficients {\n terrestrialObliquity: number[];\n solarPerigee: number[];\n solarLongitude: number[];\n lunarInclination: number[];\n lunarLongitude: number[];\n lunarNode: number[];\n lunarPerigee: number[];\n}\n\nconst coefficients: Coefficients = {\n // Meeus formula 21.3\n terrestrialObliquity: [\n sexagesimalToDecimal(23, 26, 21.448),\n -sexagesimalToDecimal(0, 0, 4680.93),\n -sexagesimalToDecimal(0, 0, 1.55),\n sexagesimalToDecimal(0, 0, 1999.25),\n -sexagesimalToDecimal(0, 0, 51.38),\n -sexagesimalToDecimal(0, 0, 249.67),\n -sexagesimalToDecimal(0, 0, 39.05),\n sexagesimalToDecimal(0, 0, 7.12),\n sexagesimalToDecimal(0, 0, 27.87),\n sexagesimalToDecimal(0, 0, 5.79),\n sexagesimalToDecimal(0, 0, 2.45),\n ].map((number, index) => {\n return number * Math.pow(1e-2, index);\n }),\n\n solarPerigee: [280.46645 - 357.5291, 36000.76932 - 35999.0503, 0.0003032 + 0.0001559, 0.00000048],\n\n solarLongitude: [280.46645, 36000.76983, 0.0003032],\n\n lunarInclination: [5.145],\n\n lunarLongitude: [218.3164591, 481267.88134236, -0.0013268, 1 / 538841.0 - 1 / 65194000.0],\n\n lunarNode: [125.044555, -1934.1361849, 0.0020762, 1 / 467410.0, -1 / 60616000.0],\n\n lunarPerigee: [83.353243, 4069.0137111, -0.0103238, -1 / 80053.0, 1 / 18999000.0],\n};\n\nexport default coefficients;\nexport { sexagesimalToDecimal };\nexport type { Coefficients };\n","import { d2r, r2d } from \"./constants.js\";\nimport coefficients from \"./coefficients.js\";\n\nexport interface AstroValue {\n value: number;\n speed: number;\n}\n\nexport interface AstroData {\n s: AstroValue;\n h: AstroValue;\n p: AstroValue;\n N: AstroValue;\n pp: AstroValue;\n \"90\": AstroValue;\n omega: AstroValue;\n i: AstroValue;\n I: AstroValue;\n xi: AstroValue;\n nu: AstroValue;\n nup: AstroValue;\n nupp: AstroValue;\n \"T+h-s\": AstroValue;\n P: AstroValue;\n}\n\n// Evaluates a polynomial at argument\nconst polynomial = (coefficients: number[], argument: number): number => {\n const result: number[] = [];\n coefficients.forEach((coefficient, index) => {\n result.push(coefficient * Math.pow(argument, index));\n });\n return result.reduce((a, b) => a + b);\n};\n\n// Evaluates a derivative polynomial at argument\nconst derivativePolynomial = (coefficients: number[], argument: number): number => {\n const result: number[] = [];\n coefficients.forEach((coefficient, index) => {\n result.push(coefficient * index * Math.pow(argument, index - 1));\n });\n return result.reduce((a, b) => a + b);\n};\n\n// Meeus formula 11.1\nconst T = (t: Date): number => {\n return (JD(t) - 2451545.0) / 36525;\n};\n\n// Meeus formula 7.1\nconst JD = (t: Date): number => {\n let Y = t.getUTCFullYear();\n let M = t.getUTCMonth() + 1;\n const D =\n t.getUTCDate() +\n t.getUTCHours() / 24.0 +\n t.getUTCMinutes() / (24.0 * 60.0) +\n t.getUTCSeconds() / (24.0 * 60.0 * 60.0) +\n t.getUTCMilliseconds() / (24.0 * 60.0 * 60.0 * 1e6);\n if (M <= 2) {\n Y = Y - 1;\n M = M + 12;\n }\n const A = Math.floor(Y / 100.0);\n const B = 2 - A + Math.floor(A / 4.0);\n return Math.floor(365.25 * (Y + 4716)) + Math.floor(30.6001 * (M + 1)) + D + B - 1524.5;\n};\n\nconst _I = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n const cosI = Math.cos(i) * Math.cos(omega) - Math.sin(i) * Math.sin(omega) * Math.cos(N);\n return r2d * Math.acos(cosI);\n};\n\nconst _xi = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n let e1 = (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) * Math.tan(0.5 * N);\n let e2 = (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) * Math.tan(0.5 * N);\n e1 = Math.atan(e1);\n e2 = Math.atan(e2);\n e1 = e1 - 0.5 * N;\n e2 = e2 - 0.5 * N;\n return -(e1 + e2) * r2d;\n};\n\nconst _nu = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n let e1 = (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) * Math.tan(0.5 * N);\n let e2 = (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) * Math.tan(0.5 * N);\n e1 = Math.atan(e1);\n e2 = Math.atan(e2);\n e1 = e1 - 0.5 * N;\n e2 = e2 - 0.5 * N;\n return (e1 - e2) * r2d;\n};\n\n// Schureman equation 224\nconst _nup = (N: number, i: number, omega: number): number => {\n const I = d2r * _I(N, i, omega);\n const nu = d2r * _nu(N, i, omega);\n return (\n r2d * Math.atan((Math.sin(2 * I) * Math.sin(nu)) / (Math.sin(2 * I) * Math.cos(nu) + 0.3347))\n );\n};\n\n// Schureman equation 232\nconst _nupp = (N: number, i: number, omega: number): number => {\n const I = d2r * _I(N, i, omega);\n const nu = d2r * _nu(N, i, omega);\n const tan2nupp =\n (Math.sin(I) ** 2 * Math.sin(2 * nu)) / (Math.sin(I) ** 2 * Math.cos(2 * nu) + 0.0727);\n return r2d * 0.5 * Math.atan(tan2nupp);\n};\n\nconst modulus = (a: number, b: number): number => {\n return ((a % b) + b) % b;\n};\n\nconst astro = (time: Date): AstroData => {\n // This gets cast to `AstroData` later, but we build it up step by step here\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: any = {};\n\n const polynomials: Record<string, number[]> = {\n s: coefficients.lunarLongitude,\n h: coefficients.solarLongitude,\n p: coefficients.lunarPerigee,\n N: coefficients.lunarNode,\n pp: coefficients.solarPerigee,\n \"90\": [90.0],\n omega: coefficients.terrestrialObliquity,\n i: coefficients.lunarInclination,\n };\n\n // Polynomials are in T, that is Julian Centuries; we want our speeds to be\n // in the more convenient unit of degrees per hour.\n const dTdHour = 1 / (24 * 365.25 * 100);\n for (const name in polynomials) {\n result[name] = {\n value: modulus(polynomial(polynomials[name], T(time)), 360.0),\n speed: derivativePolynomial(polynomials[name], T(time)) * dTdHour,\n };\n }\n\n // Some other parameters defined by Schureman which are dependent on the\n // parameters N, i, omega for use in node factor calculations. We don't need\n // their speeds.\n const functions: Record<string, (N: number, i: number, omega: number) => number> = {\n I: _I,\n xi: _xi,\n nu: _nu,\n nup: _nup,\n nupp: _nupp,\n };\n Object.keys(functions).forEach((name) => {\n const functionCall = functions[name];\n result[name] = {\n value: modulus(functionCall(result.N.value, result.i.value, result.omega.value), 360.0),\n speed: null,\n };\n });\n\n // We don't work directly with the T (hours) parameter, instead our spanning\n // set for equilibrium arguments #is given by T+h-s, s, h, p, N, pp, 90.\n // This is in line with convention.\n const hour = {\n value: (JD(time) - Math.floor(JD(time))) * 360.0,\n speed: 15.0,\n };\n\n result[\"T+h-s\"] = {\n value: hour.value + result.h.value - result.s.value,\n speed: hour.speed + result.h.speed - result.s.speed,\n };\n\n // It is convenient to calculate Schureman's P here since several node\n // factors need it, although it could be argued that these\n // (along with I, xi, nu etc) belong somewhere else.\n result.P = {\n value: result.p.value - (result.xi.value % 360.0),\n speed: null,\n };\n\n return result as AstroData;\n};\n\nexport default astro;\nexport { polynomial, derivativePolynomial, T, JD, _I, _xi, _nu, _nup, _nupp };\n","import { d2r, r2d } from \"../astronomy/constants.js\";\nimport type { AstroData } from \"../astronomy/index.js\";\n\nexport type NodeCorrectionFunction = (a: AstroData, ...args: unknown[]) => number;\n\nconst corrections = {\n fUnity(): number {\n return 1;\n },\n\n // Schureman equations 73, 65\n fMm(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n (2 / 3.0 - Math.pow(Math.sin(omega), 2)) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n return (2 / 3.0 - Math.pow(Math.sin(I), 2)) / mean;\n },\n\n // Schureman equations 74, 66\n fMf(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.pow(Math.sin(omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return Math.pow(Math.sin(I), 2) / mean;\n },\n\n // Schureman equations 75, 67\n fO1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n Math.sin(omega) * Math.pow(Math.cos(0.5 * omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return (Math.sin(I) * Math.pow(Math.cos(0.5 * I), 2)) / mean;\n },\n\n // Schureman equations 76, 68\n fJ1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.sin(2 * omega) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n return Math.sin(2 * I) / mean;\n },\n\n // Schureman equations 77, 69\n fOO1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n Math.sin(omega) * Math.pow(Math.sin(0.5 * omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return (Math.sin(I) * Math.pow(Math.sin(0.5 * I), 2)) / mean;\n },\n\n // Schureman equations 78, 70\n fM2(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.pow(Math.cos(0.5 * omega), 4) * Math.pow(Math.cos(0.5 * i), 4);\n return Math.pow(Math.cos(0.5 * I), 4) / mean;\n },\n\n // Schureman equations 227, 226, 68\n // Should probably eventually include the derivations of the magic numbers (0.5023 etc).\n fK1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const nu = d2r * a.nu.value;\n const sin2IcosnuMean = Math.sin(2 * omega) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n const mean = 0.5023 * sin2IcosnuMean + 0.1681;\n return (\n Math.pow(\n 0.2523 * Math.pow(Math.sin(2 * I), 2) + 0.1689 * Math.sin(2 * I) * Math.cos(nu) + 0.0283,\n 0.5,\n ) / mean\n );\n },\n\n // Schureman equations 215, 213, 204\n // It can be (and has been) confirmed that the exponent for R_a reads 1/2 via Schureman Table 7\n fL2(a: AstroData): number {\n const P = d2r * a.P.value;\n const I = d2r * a.I.value;\n const rAInv = Math.pow(\n 1 -\n 12 * Math.pow(Math.tan(0.5 * I), 2) * Math.cos(2 * P) +\n 36 * Math.pow(Math.tan(0.5 * I), 4),\n 0.5,\n );\n return corrections.fM2(a) * rAInv;\n },\n\n // Schureman equations 235, 234, 71\n // Again, magic numbers\n fK2(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const nu = d2r * a.nu.value;\n const sinsqIcos2nuMean = Math.sin(omega) ** 2 * (1 - (3 / 2.0) * Math.sin(i) ** 2);\n const mean = 0.5023 * sinsqIcos2nuMean + 0.0365;\n return (\n Math.pow(\n 0.2523 * Math.pow(Math.sin(I), 4) +\n 0.0367 * Math.pow(Math.sin(I), 2) * Math.cos(2 * nu) +\n 0.0013,\n 0.5,\n ) / mean\n );\n },\n\n // Schureman equations 206, 207, 195\n fM1(a: AstroData): number {\n const P = d2r * a.P.value;\n const I = d2r * a.I.value;\n const qAInv = Math.pow(\n 0.25 +\n 1.5 * Math.cos(I) * Math.cos(2 * P) * Math.pow(Math.cos(0.5 * I), -0.5) +\n 2.25 * Math.pow(Math.cos(I), 2) * Math.pow(Math.cos(0.5 * I), -4),\n 0.5,\n );\n return corrections.fO1(a) * qAInv;\n },\n\n // See e.g. Schureman equation 149\n fModd(a: AstroData, n: number): number {\n return Math.pow(corrections.fM2(a), n / 2.0);\n },\n\n // Node factors u, see Table 2 of Schureman.\n\n uZero(): number {\n return 0.0;\n },\n\n uMf(a: AstroData): number {\n return -2.0 * a.xi.value;\n },\n\n uO1(a: AstroData): number {\n return 2.0 * a.xi.value - a.nu.value;\n },\n\n uJ1(a: AstroData): number {\n return -a.nu.value;\n },\n\n uOO1(a: AstroData): number {\n return -2.0 * a.xi.value - a.nu.value;\n },\n\n uM2(a: AstroData): number {\n return 2.0 * a.xi.value - 2.0 * a.nu.value;\n },\n\n uK1(a: AstroData): number {\n return -a.nup.value;\n },\n\n // Schureman 214\n uL2(a: AstroData): number {\n const I = d2r * a.I.value;\n const P = d2r * a.P.value;\n const R =\n r2d *\n Math.atan(Math.sin(2 * P) / ((1 / 6.0) * Math.pow(Math.tan(0.5 * I), -2) - Math.cos(2 * P)));\n return 2.0 * a.xi.value - 2.0 * a.nu.value - R;\n },\n\n uK2(a: AstroData): number {\n return -2.0 * a.nupp.value;\n },\n\n // Schureman 202\n uM1(a: AstroData): number {\n const I = d2r * a.I.value;\n const P = d2r * a.P.value;\n const Q = r2d * Math.atan(((5 * Math.cos(I) - 1) / (7 * Math.cos(I) + 1)) * Math.tan(P));\n return a.xi.value - a.nu.value + Q;\n },\n\n uModd(a: AstroData, n: number): number {\n return (n / 2.0) * corrections.uM2(a);\n },\n};\n\nexport default corrections;\n","import type { AstroData } from \"../astronomy/index.js\";\nimport nodeCorrections, { type NodeCorrectionFunction } from \"../node-corrections/index.js\";\n\nexport interface Constituent {\n name: string;\n coefficients: number[];\n value: (astro: AstroData) => number;\n speed: (astro: AstroData) => number;\n u: NodeCorrectionFunction;\n f: NodeCorrectionFunction;\n}\n\nexport function defineConstituent(\n name: string,\n coefficients: number[],\n u?: NodeCorrectionFunction,\n f?: NodeCorrectionFunction,\n): Constituent {\n if (!coefficients) {\n throw new Error(\"Coefficient must be defined for a constituent\");\n }\n\n return Object.freeze({\n name,\n coefficients,\n\n value: (astro: AstroData): number => {\n return dotArray(coefficients, astronomicValues(astro));\n },\n\n speed(astro: AstroData): number {\n return dotArray(coefficients, astronomicSpeed(astro));\n },\n\n u: typeof u !== \"undefined\" ? u : nodeCorrections.uZero,\n\n f: typeof f !== \"undefined\" ? f : nodeCorrections.fUnity,\n });\n}\n\nexport interface ConstituentMember {\n constituent: Constituent;\n factor: number;\n}\n\nexport function defineCompoundConstituent(name: string, members: ConstituentMember[]): Constituent {\n const coefficients: number[] = [];\n members.forEach(({ constituent, factor }) => {\n constituent.coefficients.forEach((coefficient, index) => {\n if (typeof coefficients[index] === \"undefined\") {\n coefficients[index] = 0;\n }\n coefficients[index] += coefficient * factor;\n });\n });\n\n return Object.freeze({\n name,\n coefficients,\n\n speed: (astro: AstroData): number => {\n let speed = 0;\n members.forEach(({ constituent, factor }) => {\n speed += constituent.speed(astro) * factor;\n });\n return speed;\n },\n\n value: (astro: AstroData): number => {\n let value = 0;\n members.forEach(({ constituent, factor }) => {\n value += constituent.value(astro) * factor;\n });\n return value;\n },\n\n u: (astro: AstroData): number => {\n let u = 0;\n members.forEach(({ constituent, factor }) => {\n u += constituent.u(astro) * factor;\n });\n return u;\n },\n\n f: (astro: AstroData): number => {\n const f: number[] = [];\n members.forEach(({ constituent, factor }) => {\n f.push(Math.pow(constituent.f(astro), Math.abs(factor)));\n });\n return f.reduce((previous, value) => previous * value);\n },\n });\n}\n\n/**\n * Computes the dot notation of two arrays\n */\nfunction dotArray(a: number[], b: number[]): number {\n const results: number[] = [];\n a.forEach((value, index) => {\n results.push(value * b[index]);\n });\n return results.reduce((total, value) => total + value);\n}\n\nexport function astronimicDoodsonNumber(astro: AstroData): AstroData[keyof AstroData][] {\n return [astro[\"T+h-s\"], astro.s, astro.h, astro.p, astro.N, astro.pp, astro[\"90\"]];\n}\n\nexport function astronomicSpeed(astro: AstroData): number[] {\n const results: number[] = [];\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.speed);\n });\n return results;\n}\n\nexport function astronomicValues(astro: AstroData): number[] {\n const results: number[] = [];\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.value);\n });\n return results;\n}\n\n// Silence TS warning for empty module\nexport default {};\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (M2).\n * Primary principal lunar constituent; largest semi-diurnal tidal component globally.\n * Amplitude varies 10-20% over lunar node cycle; typically 0.2-0.5m in coastal areas.\n * Base constituent for many compound shallow-water constituents.\n */\nexport default defineConstituent(\"M2\", [2, 0, 0, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (O1).\n * Primary lunar diurnal constituent; one-per-lunar-day oscillation.\n * Amplitude varies 10-20% due to lunar node effects.\n */\nexport default defineConstituent(\"O1\", [1, -1, 0, 0, 0, 0, 1], nc.uO1, nc.fO1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport O1 from \"./O1.js\";\n\n/**\n * Shallow-water terdiurnal (2MK3 = M2 + O1).\n * Lunar-lunar interaction from M2 semi-diurnal and O1 diurnal components.\n * Generated in shallow-water environments; typical amplitude <1 cm.\n */\nexport default defineCompoundConstituent(\"2MK3\", [\n { constituent: M2, factor: 1 },\n { constituent: O1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunisolar diurnal (K1).\n * Combined lunar and solar diurnal constituent; strongest diurnal tide in many regions.\n * Often comparable in amplitude to O1; amplitude ratio K1/O1 varies with latitude.\n */\nexport default defineConstituent(\"K1\", [1, 1, 0, 0, 0, 0, -1], nc.uK1, nc.fK1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water fifth-diurnal from M2-K1 interaction.\n *\n * Note: Found in coastal tide predictions, especially in enclosed bays and harbors.\n * Amplitude typically 0.1-0.5 cm depending on location and water depth.\n * Shallow-water constituent only; not present in deep ocean.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"2MK5\", [\n { constituent: M2, factor: 2 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport O1 from \"./O1.js\";\n\n/**\n * Shallow-water fifth-diurnal from M2-O1 interaction.\n *\n * Note: Primarily shallow-water coastal phenomenon, not present in deep ocean.\n * Amplitude typically <0.5 cm except in extreme shallow-water or enclosed basins.\n * Found in coastal tide predictions alongside other shallow-water constituents.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"2MO5\", [\n { constituent: M2, factor: 2 },\n { constituent: O1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar semi-diurnal (S2).\n * Principal solar semi-diurnal constituent; largest solar tide component.\n * Amplitude typically 20-50% of M2; varies with geographic location and latitude.\n * Ratio M2/S2 determines tidal form factor (diurnal vs semi-diurnal regimes).\n * Base constituent for many compound shallow-water constituents.\n */\nexport default defineConstituent(\"S2\", [2, 2, -2, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Sixth-diurnal shallow-water interaction: 2×M2 + S2.\n *\n * Generated only in shallow water; typical amplitude 0.01-0.2 meters depending on depth.\n * Included in IHO shallow-water constituent tables and NOAA analysis (order #37).\n */\nexport default defineCompoundConstituent(\"2MS6\", [\n { constituent: M2, factor: 2 },\n { constituent: S2, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (2N2).\n * Second-order lunar semi-diurnal from Moon's orbital ellipticity.\n * Amplitude typically 5-10% of M2; significant in semi-diurnal analysis.\n */\nexport default defineConstituent(\"2N2\", [2, -2, 0, 2, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (N2).\n * Primary lunar elliptic semi-diurnal constituent from Moon's orbital variations.\n * Amplitude typically 5-15% of M2; third-largest semi-diurnal constituent.\n */\nexport default defineConstituent(\"N2\", [2, -1, 0, 1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (J1).\n * Shallow-water lunar diurnal constituent; generally much smaller than O1 and K1.\n * Typically important only in shallow-water systems and enclosed basins.\n * Amplitude usually <5% of O1; rarely significant in routine predictions.\n */\nexport default defineConstituent(\"J1\", [1, 2, 0, -1, 0, 0, -1], nc.uJ1, nc.fJ1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\nimport J1 from \"./J1.js\";\n\n/**\n * Shallow-water diurnal (2Q1 = N2-J1).\n * Derived from interaction of semi-diurnal N2 and diurnal J1 constituents.\n * Amplitude typically very small; rarely significant.\n * Found only in shallow-water regions with strong tidal distortion.\n */\nexport default defineCompoundConstituent(\"2Q1\", [\n { constituent: N2, factor: 1 },\n { constituent: J1, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water semi-diurnal (2SM2).\n * Compound constituent: 2×S2 - M2\n * Solar-lunar interaction constituent generated in shallow-water environments.\n * Amplitude typically <2% of M2; complementary to MU2.\n */\nexport default defineCompoundConstituent(\"2SM2\", [\n { constituent: S2, factor: 2 },\n { constituent: M2, factor: -1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (L2).\n * Secondary lunar elliptic semi-diurnal from Moon's orbital variations and perigee effects.\n * Amplitude typically 1-3% of M2; often grouped with other lunar elliptic constituents.\n * Important in detailed harmonic analyses of semi-diurnal tides.\n */\nexport default defineConstituent(\"L2\", [2, 1, 0, -1, 0, 0, 2], nc.uL2, nc.fL2);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport L2 from \"./L2.js\";\n\n/**\n * Triple lunar elliptic; 3 times L2 interaction.\n *\n * Warning: Not in standard IHO constituent bank. Mainly historical/theoretical interest.\n * Very small amplitude (<0.1 cm); found only in extreme shallow water or enclosed basins.\n * Often ignored in routine tide predictions.\n *\n * @see Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides\n */\nexport default defineCompoundConstituent(\"3L2\", [{ constituent: L2, factor: 3 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Triple N2 shallow-water harmonic (3 × N2).\n *\n * Note: Shallow-water constituent with definition based on compound frequency estimates.\n * Typical amplitude <0.5 cm; often <0.1 cm except in extreme shallow-water or enclosed basins.\n * Rarely significant in routine tide predictions.\n *\n * @see NOAA CO-OPS shallow-water constituents\n */\nexport default defineCompoundConstituent(\"3N2\", [{ constituent: N2, factor: 3 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal constituent (ε2).\n */\nexport default defineConstituent(\"EP2\", [2, -3, 2, 1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunisolar semi-diurnal (K2).\n * Combined lunar and solar semi-diurnal constituent from declination effects.\n * Amplitude typically 10-30% of S2; second-largest solar-related semi-diurnal component.\n * Important in semi-diurnal tidal analysis, especially at mid-latitudes.\n */\nexport default defineConstituent(\"K2\", [2, 2, 0, 0, 0, 0, 0], nc.uK2, nc.fK2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (λ2, lambda2).\n * Lunar semi-diurnal constituent from Moon's perigee effects.\n * Amplitude typically <5% of M2; important in detailed constituent analysis.\n * IHO standard designation (previously abbreviated as LAM2).\n */\nexport default defineConstituent(\"LAMBDA2\", [2, 1, -2, 1, 0, 0, 2], nc.uM2, nc.fM2);\n","import LAMBDA2 from \"./LAMBDA2.js\";\n\n/**\n * Alias for compatibility between NOAA and IHO\n *\n * @see LAMBDA2\n */\nexport default LAMBDA2;\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal elliptic (M1).\n * Secondary lunar diurnal constituent from Moon's elliptical orbit.\n * Typically very small amplitude; usually <1% of O1.\n * Rarely significant except in detailed harmonic analyses.\n */\nexport default defineConstituent(\"M1\", [1, 0, 0, 0, 0, 0, 1], nc.uM1, nc.fM1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar terdiurnal (M3).\n * Third-diurnal lunar constituent from Moon's orbital motion.\n * Typically found in shallow water and resonant systems.\n * Amplitude usually <2% of M2; important in some shallow-water analyses.\n */\n// Third diurnal\nexport default defineConstituent(\n \"M3\",\n [3, 0, 0, 0, 0, 0, 0],\n (a) => {\n return nc.uModd(a, 3);\n },\n (a) => {\n return nc.fModd(a, 3);\n },\n);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water quarter-diurnal (M4 = 2×M2).\n * First overtide of M2; generated in shallow-water environments.\n * Amplitude typically 2-10% of M2; largest of the quarter-diurnal constituents.\n * Important indicator of shallow-water tidal distortion.\n */\nexport default defineCompoundConstituent(\"M4\", [{ constituent: M2, factor: 2 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water sixth-diurnal (M6 = 3×M2).\n * Second overtide of M2; generated in shallow-water environments.\n * Amplitude typically 0.5-3% of M2; important in extreme shallow water.\n * Indicator of significant tidal distortion and non-linear effects.\n */\nexport default defineCompoundConstituent(\"M6\", [{ constituent: M2, factor: 3 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water eighth-diurnal (M8 = 4×M2).\n * Third overtide of M2; generated in extreme shallow-water environments.\n * Amplitude typically <0.5% of M2; very rarely significant.\n * Found only in highly distorted tidal regimes (extreme shallow water, enclosed basins).\n */\nexport default defineCompoundConstituent(\"M8\", [{ constituent: M2, factor: 4 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar variational semi-diurnal constituent (μ2, mu2).\n * Derived from Moon's orbital parameter variations.\n *\n * Note: Often included with M2 family in modern analysis. Minor constituent with\n * location-dependent amplitude.\n */\nexport default defineConstituent(\"MA2\", [2, 0, -1, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic constituent from parameter variations.\n *\n * From https://iho.int/mtg_docs/com_wg/IHOTC/IHOTC_Misc/TWCWG_Constituent_list.pdf:\n *\n * > MB2 was originally called Ma2 but this became ambiguous when spoken, or typed on\n * > computers without lower case, and so it was initially changed to MA2*. However, this\n * > in turn was thought to be clumsy and hence MB2 was finally adopted. Although\n * > theoretically they should have the same values of u and f as M2, they are so small\n * > that they are commonly treated as having values of u = 0 and f = 1.\n *\n * @see Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides\n */\nexport default defineConstituent(\"MB2\", [2, 0, 1, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar fortnightly (MF).\n * Long-period constituent from lunar inequality interactions.\n * Significant in long-term water level records and coastal resonances.\n */\nexport default defineConstituent(\"MF\", [0, 2, 0, 0, 0, 0, 0], nc.uMf, nc.fMf);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water terdiurnal (MK3).\n * Compound constituent: M2 + K1\n * Lunisolar interaction from M2 semi-diurnal and K1 diurnal components.\n * Generated in shallow-water environments; typical amplitude 0.5-2 cm.\n * Often paired with 2MK3 in terdiurnal tide analysis.\n */\nexport default defineCompoundConstituent(\"MK3\", [\n { constituent: M2, factor: 1 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Three-way shallow-water interaction of M2, K1, and S2.\n *\n * Warning: Not in standard IHO constituent bank. Shallow-water specific constituent\n * with definition varying by application and water depth. Use with caution and document\n * the specific convention used in your analysis.\n *\n * @see NOAA CO-OPS shallow-water constituents\n */\nexport default defineCompoundConstituent(\"MKS2\", [\n { constituent: M2, factor: 1 },\n { constituent: K1, factor: 1 },\n { constituent: S2, factor: -1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar monthly (MM).\n * Long-period constituent from lunar declination variations.\n * Important for long-term water level studies.\n */\nexport default defineConstituent(\"MM\", [0, 1, 0, -1, 0, 0, 0], nc.uZero, nc.fMm);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Shallow-water quarter-diurnal (MN4).\n * Compound constituent: M2 + N2\n * Lunar-lunar elliptic interaction from M2 and N2 semi-diurnal components.\n * Generated in shallow-water environments; typical amplitude 1-5 cm.\n * Often significant in shallow seas and estuaries.\n */\nexport default defineCompoundConstituent(\"MN4\", [\n { constituent: M2, factor: 1 },\n { constituent: N2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water quarter-diurnal (MS4).\n * Compound constituent: M2 + S2\n * Lunar-solar interaction from M2 and S2 semi-diurnal components.\n * Generated in shallow-water environments; typical amplitude 1-5 cm.\n * Often second-largest quarter-diurnal component after M4.\n */\nexport default defineCompoundConstituent(\"MS4\", [\n { constituent: M2, factor: 1 },\n { constituent: S2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Lunisolar synodic fortnightly (MSF = S2-M2).\n * Long-period constituent representing beat frequency between solar S2 and lunar M2.\n * Manifests as fortnightly modulation of tidal range (spring-neap cycle).\n * Amplitude typically 5-15% of M2; represents the primary spring-neap variation.\n * Important for tidal range predictions and coastal flooding assessments.\n */\nexport default defineCompoundConstituent(\"MSF\", [\n { constituent: S2, factor: 1 },\n { constituent: M2, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Lunar-solar interaction compound constituent.\n *\n * Warning: Non-standard constituent not in IHO or modern NOAA standard tables.\n * Definition varies significantly across sources. Rarely used in modern tide prediction.\n * Appears in Schureman's tables as variant shallow-water interaction.\n *\n * @see NOAA CO-OPS shallow-water constituents\n * @see Schureman shallow-water analysis tables\n */\nexport default defineCompoundConstituent(\"MSQM\", [\n { constituent: M2, factor: 1 },\n { constituent: S2, factor: 1 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar elliptic semi-diurnal (T2).\n * Larger solar elliptic semi-diurnal constituent from solar declination effects.\n * Amplitude typically <5% of S2; increases at higher latitudes.\n * Forms part of solar semi-diurnal analysis alongside S2 and R2.\n */\nexport default defineConstituent(\"T2\", [2, 2, -3, 0, 0, 1, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport T2 from \"./T2.js\";\n\n/**\n * Lunar-solar shallow-water interaction (M2 modulated by lunar orbit).\n *\n * Warning: Not in modern IHO standard constituents; mostly historical interest.\n * Often replaced by specific ν2, λ2, or other lunar elliptic terms in modern analysis.\n * Amplitude is location and depth-dependent.\n *\n * @see NOAA CO-OPS shallow-water variants\n * @see Schureman Manual\n */\nexport default defineCompoundConstituent(\"MTM\", [\n { constituent: M2, factor: 1 },\n { constituent: T2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water semi-diurnal (MU2 or μ2).\n * Compound constituent: 2×M2 - S2\n * Lunar variational constituent generated in shallow-water environments.\n * Amplitude typically <2% of M2; found in coastal shallow-water predictions.\n */\nexport default defineCompoundConstituent(\"MU2\", [\n { constituent: M2, factor: 2 },\n { constituent: S2, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Second overtide of N2; shallow-water quarter-diurnal harmonic.\n * Amplitude ranges 0.25 to 2.25 times mean due to 18.613-year lunar node cycle.\n *\n * Note: Shallow-water constituent, typically found in tide predictions for coastal areas.\n */\nexport default defineCompoundConstituent(\"N4\", [{ constituent: N2, factor: 2 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (NU2).\n * Secondary lunar elliptic semi-diurnal from Moon's orbital variations.\n * Amplitude typically 2-5% of M2; smaller than N2.\n * Important in detailed semi-diurnal constituent analysis.\n */\nexport default defineConstituent(\"NU2\", [2, -1, 2, -1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (OO1).\n * Second-order lunar diurnal constituent from Moon's orbital eccentricity.\n * Typically very small amplitude; <2% of O1 in most locations.\n * Important for detailed harmonic analysis in some regions.\n */\nexport default defineConstituent(\"OO1\", [1, 3, 0, 0, 0, 0, -1], nc.uOO1, nc.fOO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar diurnal (P1).\n * Principal solar diurnal constituent; one-per-solar-day oscillation.\n * Amplitude typically 1/3 of K1; varies with latitude.\n * Forms key component of diurnal tidal analysis alongside K1 and O1.\n */\nexport default defineConstituent(\"P1\", [1, 1, -2, 0, 0, 0, 1], nc.uZero, nc.fUnity);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Elliptic lunar diurnal (Q1).\n * One solar day and one lunar day modulation interaction.\n * Amplitude typically 2-5% of O1; important in diurnal constituent analysis.\n */\nexport default defineConstituent(\"Q1\", [1, -2, 0, 1, 0, 0, 1], nc.uO1, nc.fO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar elliptic semi-diurnal (R2).\n * Smaller solar elliptic semi-diurnal constituent from solar declination effects.\n * Amplitude typically <2% of S2; smallest of the solar semi-diurnal group.\n * Rarely significant except in very detailed analyses.\n */\nexport default defineConstituent(\"R2\", [2, 2, -1, 0, 0, -1, 2], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport R2 from \"./R2.js\";\n\n/**\n * Solar elliptic terdiurnal; 1.5 times R2 (smaller solar elliptic semi-diurnal).\n *\n * Note: Generated only in shallow water; very small amplitude (<0.05 cm typical).\n * Usually negligible except in extreme shallow-water environments.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"R3\", [{ constituent: R2, factor: 1.5 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport NU2 from \"./NU2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water diurnal (RHO1, ρ1).\n * Compound constituent: NU2-K1 (ν2-K1)\n * Derived from interaction of semi-diurnal NU2 and diurnal K1 constituents.\n * Amplitude typically very small; rarely significant.\n * Found only in shallow-water regions with strong tidal distortion.\n */\nexport default defineCompoundConstituent(\"RHO1\", [\n { constituent: NU2, factor: 1 },\n { constituent: K1, factor: -1 },\n]);\n","import RHO1 from \"./RHO1.js\";\n\n/**\n * Alias for compatibility between NOAA and IHO\n *\n * @see RHO1\n */\nexport default RHO1;\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar diurnal (S1).\n * Secondary solar diurnal constituent related to solar declination inequality.\n * Usually very small amplitude; typically dominated by K1 and P1 in diurnal analysis.\n * Rarely included in routine harmonic analyses.\n */\nexport default defineConstituent(\"S1\", [1, 1, -1, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Solar terdiurnal overtide; shallow-water only.\n *\n * Note: Generated only in shallow water; not found in deep ocean.\n * Typical amplitude <1 cm except in extreme shallow-water environments.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"S3\", [{ constituent: S2, factor: 1.5 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water quarter-diurnal (S4).\n * Compound constituent: 2×S2\n * First overtide of S2; generated in shallow-water environments.\n * Amplitude typically 1-3% of S2; smallest of the common quarter-diurnal constituents.\n * Purely solar, so has fixed amplitude and phase at any location.\n */\nexport default defineCompoundConstituent(\"S4\", [{ constituent: S2, factor: 2 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water sixth-diurnal (S6).\n * Compound constituent: 3×S2\n * Second overtide of S2; generated in shallow-water environments.\n * Amplitude typically 0.5-1% of S2; smallest of the common overtides.\n * Rarely significant except in extreme shallow water or resonant systems.\n */\nexport default defineCompoundConstituent(\"S6\", [{ constituent: S2, factor: 3 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar annual (Sa).\n * Long-term constituent driven by solar declination variations over the year.\n */\nexport default defineConstituent(\"Sa\", [0, 0, 1, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal variational constituent (σ1, sigma1).\n * Derived from Moon's declination variations.\n *\n * Note: Often has small amplitude; closely related to K1 and O1 variations.\n */\nexport default defineConstituent(\"SGM\", [1, -3, 2, 0, 0, 0, -1], nc.uO1, nc.fO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar semi-annual (Ssa).\n * Semi-annual constituent from solar declination with twice-yearly periodicity.\n */\nexport default defineConstituent(\"Ssa\", [0, 0, 2, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport T2 from \"./T2.js\";\n\n/**\n * Solar elliptic terdiurnal; 1.5 times T2 (larger solar elliptic semi-diurnal).\n *\n * Note: Generated only in shallow water; minimal amplitude (<0.1 cm typical).\n * Rarely significant except in extreme shallow-water or enclosed basins.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"T3\", [{ constituent: T2, factor: 1.5 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Mean sea level (Z0).\n * Not a tidal constituent in the strict sense, but represents the mean sea level offset\n * or the \"zero\" reference level used in tidal predictions.\n * No astronomical forcing; typically determined from harmonic analysis of observed data.\n */\nexport default defineConstituent(\"Z0\", [0, 0, 0, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { type Constituent } from \"./definition\";\n\n// Dynamically import all constituent files\nconst constituentModules = import.meta.glob<Constituent>(\"./*.ts\", {\n eager: true,\n import: \"default\",\n});\n\nconst constituents: Record<string, Constituent> = {};\n\n// Extract constituent name from file path and populate the constituents object\nfor (const [path, module] of Object.entries(constituentModules)) {\n // Skip the index file itself\n if (path.includes(\"index.ts\")) continue;\n\n // Extract filename without extension and .js suffix\n const name = path.split(\"/\").pop()?.replace(/\\..*$/, \"\") ?? \"\";\n\n // Skip module for definition.ts\n if (name === \"definition\") continue;\n\n constituents[name] = module;\n}\n\nexport default constituents;\n","import astro from \"../astronomy/index.js\";\nimport { d2r } from \"../astronomy/constants.js\";\nimport constituentModels from \"../constituents/index.js\";\n\nexport interface Timeline {\n items: Date[];\n hours: number[];\n}\n\nexport interface HarmonicConstituent {\n name: string;\n amplitude: number;\n phase: number;\n speed?: number;\n description?: string;\n}\n\nexport interface TimelinePoint {\n time: Date;\n hour: number;\n level: number;\n}\n\nexport interface Extreme {\n time: Date;\n level: number;\n high: boolean;\n low: boolean;\n label: string;\n}\n\nexport interface ExtremeOffsets {\n height?: {\n high?: number;\n low?: number;\n type?: \"fixed\" | \"ratio\";\n };\n time?: {\n high?: number;\n low?: number;\n };\n}\n\nexport interface ExtremeLabels {\n high?: string;\n low?: string;\n}\n\nexport interface ExtremesOptions {\n labels?: ExtremeLabels;\n offsets?: ExtremeOffsets;\n}\n\nexport interface Prediction {\n getExtremesPrediction: (options?: ExtremesOptions) => Extreme[];\n getTimelinePrediction: () => TimelinePoint[];\n}\n\nconst modulus = (a: number, b: number): number => {\n return ((a % b) + b) % b;\n};\n\nconst addExtremesOffsets = (extreme: Extreme, offsets?: ExtremeOffsets): Extreme => {\n if (typeof offsets === \"undefined\" || !offsets) {\n return extreme;\n }\n\n if (extreme.high && offsets.height?.high) {\n if (offsets.height.type === \"fixed\") {\n extreme.level += offsets.height.high;\n } else {\n extreme.level *= offsets.height.high;\n }\n }\n if (extreme.low && offsets.height?.low) {\n if (offsets.height.type === \"fixed\") {\n extreme.level += offsets.height.low;\n } else {\n extreme.level *= offsets.height.low;\n }\n }\n if (extreme.high && offsets.time?.high) {\n extreme.time = new Date(extreme.time.getTime() + offsets.time.high * 60 * 1000);\n }\n if (extreme.low && offsets.time?.low) {\n extreme.time = new Date(extreme.time.getTime() + offsets.time.low * 60 * 1000);\n }\n return extreme;\n};\n\nconst getExtremeLabel = (label: \"high\" | \"low\", highLowLabels?: ExtremeLabels): string => {\n if (typeof highLowLabels !== \"undefined\" && typeof highLowLabels[label] !== \"undefined\") {\n return highLowLabels[label]!;\n }\n const labels = {\n high: \"High\",\n low: \"Low\",\n };\n return labels[label];\n};\n\ninterface PredictionFactoryParams {\n timeline: Timeline;\n constituents: HarmonicConstituent[];\n start: Date;\n}\n\nconst predictionFactory = ({\n timeline,\n constituents,\n start,\n}: PredictionFactoryParams): Prediction => {\n const getLevel = (\n hour: number,\n modelBaseSpeed: Record<string, number>,\n modelU: Record<string, number>,\n modelF: Record<string, number>,\n modelBaseValue: Record<string, number>,\n ): number => {\n const amplitudes: number[] = [];\n let result = 0;\n\n constituents.forEach((constituent) => {\n const amplitude = constituent.amplitude;\n const phase = constituent.phase;\n const f = modelF[constituent.name];\n const speed = modelBaseSpeed[constituent.name];\n const u = modelU[constituent.name];\n const V0 = modelBaseValue[constituent.name];\n amplitudes.push(amplitude * f * Math.cos(speed * hour + (V0 + u) - phase));\n });\n // sum up each row\n amplitudes.forEach((item) => {\n result += item;\n });\n return result;\n };\n\n const prediction: Prediction = {} as Prediction;\n\n prediction.getExtremesPrediction = (options?: ExtremesOptions): Extreme[] => {\n const { labels, offsets } = typeof options !== \"undefined\" ? options : {};\n const results: Extreme[] = [];\n const { baseSpeed, u, f, baseValue } = prepare();\n let goingUp = false;\n let goingDown = false;\n let lastLevel = getLevel(0, baseSpeed, u[0], f[0], baseValue);\n timeline.items.forEach((time, index) => {\n const hour = timeline.hours[index];\n const level = getLevel(hour, baseSpeed, u[index], f[index], baseValue);\n // Compare this level to the last one, if we\n // are changing angle, then the last one was high or low\n if (level > lastLevel && goingDown) {\n results.push(\n addExtremesOffsets(\n {\n time: timeline.items[index - 1],\n level: lastLevel,\n high: false,\n low: true,\n label: getExtremeLabel(\"low\", labels),\n },\n offsets,\n ),\n );\n }\n if (level < lastLevel && goingUp) {\n results.push(\n addExtremesOffsets(\n {\n time: timeline.items[index - 1],\n level: lastLevel,\n high: true,\n low: false,\n label: getExtremeLabel(\"high\", labels),\n },\n offsets,\n ),\n );\n }\n if (level > lastLevel) {\n goingUp = true;\n goingDown = false;\n }\n if (level < lastLevel) {\n goingUp = false;\n goingDown = true;\n }\n lastLevel = level;\n });\n return results;\n };\n\n prediction.getTimelinePrediction = (): TimelinePoint[] => {\n const results: TimelinePoint[] = [];\n const { baseSpeed, u, f, baseValue } = prepare();\n timeline.items.forEach((time, index) => {\n const hour = timeline.hours[index];\n const prediction: TimelinePoint = {\n time,\n hour,\n level: getLevel(hour, baseSpeed, u[index], f[index], baseValue),\n };\n\n results.push(prediction);\n });\n return results;\n };\n\n const prepare = () => {\n const baseAstro = astro(start);\n\n const baseValue: Record<string, number> = {};\n const baseSpeed: Record<string, number> = {};\n const u: Record<string, number>[] = [];\n const f: Record<string, number>[] = [];\n constituents.forEach((constituent) => {\n const model = constituentModels[constituent.name];\n if (!model) return;\n\n const value = model.value(baseAstro);\n const speed = model.speed(baseAstro);\n baseValue[constituent.name] = d2r * value;\n baseSpeed[constituent.name] = d2r * speed;\n });\n timeline.items.forEach((time) => {\n const uItem: Record<string, number> = {};\n const fItem: Record<string, number> = {};\n const itemAstro = astro(time);\n constituents.forEach((constituent) => {\n const model = constituentModels[constituent.name];\n if (!model) return;\n\n const constituentU = modulus(model.u(itemAstro), 360);\n uItem[constituent.name] = d2r * constituentU;\n fItem[constituent.name] = modulus(model.f(itemAstro), 360);\n });\n\n u.push(uItem);\n f.push(fItem);\n });\n\n return {\n baseValue,\n baseSpeed,\n u,\n f,\n };\n };\n\n return Object.freeze(prediction);\n};\n\nexport default predictionFactory;\n","import prediction from \"./prediction.js\";\nimport constituentModels from \"../constituents/index.js\";\nimport { d2r } from \"../astronomy/constants.js\";\nimport type { HarmonicConstituent, Prediction } from \"./prediction.js\";\n\nexport type * from \"./prediction.js\";\n\nexport interface HarmonicsOptions {\n harmonicConstituents: HarmonicConstituent[];\n offset: number | false;\n}\n\nexport interface PredictionOptions {\n timeFidelity?: number;\n}\n\nexport interface Harmonics {\n setTimeSpan: (startTime: Date | number, endTime: Date | number) => Harmonics;\n prediction: (options?: PredictionOptions) => Prediction;\n}\n\nconst getDate = (time: Date | number): Date => {\n if (time instanceof Date) {\n return time;\n }\n if (typeof time === \"number\") {\n return new Date(time * 1000);\n }\n throw new Error(\"Invalid date format, should be a Date object, or timestamp\");\n};\n\nconst getTimeline = (start: Date, end: Date, seconds: number = 10 * 60) => {\n const items: Date[] = [];\n const endTime = end.getTime() / 1000;\n let lastTime = start.getTime() / 1000;\n const startTime = lastTime;\n const hours: number[] = [];\n while (lastTime <= endTime) {\n items.push(new Date(lastTime * 1000));\n hours.push((lastTime - startTime) / (60 * 60));\n lastTime += seconds;\n }\n\n return {\n items,\n hours,\n };\n};\n\nconst harmonicsFactory = ({ harmonicConstituents, offset }: HarmonicsOptions): Harmonics => {\n if (!Array.isArray(harmonicConstituents)) {\n throw new Error(\"Harmonic constituents are not an array\");\n }\n const constituents: HarmonicConstituent[] = [];\n harmonicConstituents.forEach((constituent) => {\n if (typeof constituent.name === \"undefined\") {\n throw new Error(\"Harmonic constituents must have a name property\");\n }\n if (constituentModels[constituent.name] !== undefined) {\n constituents.push({\n ...constituent,\n phase: d2r * constituent.phase,\n });\n }\n });\n\n if (offset !== false) {\n constituents.push({\n name: \"Z0\",\n phase: 0,\n amplitude: offset,\n });\n }\n\n let start = new Date();\n let end = new Date();\n\n const harmonics: Harmonics = {} as Harmonics;\n\n harmonics.setTimeSpan = (startTime: Date | number, endTime: Date | number): Harmonics => {\n start = getDate(startTime);\n end = getDate(endTime);\n if (start.getTime() >= end.getTime()) {\n throw new Error(\"Start time must be before end time\");\n }\n return harmonics;\n };\n\n harmonics.prediction = (options?: PredictionOptions): Prediction => {\n const opts = typeof options !== \"undefined\" ? options : { timeFidelity: 10 * 60 };\n return prediction({\n timeline: getTimeline(start, end, opts.timeFidelity),\n constituents,\n start,\n });\n };\n\n return Object.freeze(harmonics);\n};\n\nexport default harmonicsFactory;\nexport { getDate, getTimeline };\n","import harmonics from \"./harmonics/index.js\";\nimport { default as constituents } from \"./constituents/index.js\";\nimport type { HarmonicConstituent } from \"./harmonics/index.js\";\nimport type { TimelinePoint, Extreme, ExtremeOffsets } from \"./harmonics/prediction.js\";\n\nexport interface TidePredictionOptions {\n offset?: number | false;\n}\n\nexport interface TimeSpan {\n start: Date;\n end: Date;\n timeFidelity?: number;\n}\n\nexport interface ExtremesInput extends TimeSpan {\n labels?: {\n high?: string;\n low?: string;\n };\n offsets?: ExtremeOffsets;\n}\n\nexport interface TidePrediction {\n getTimelinePrediction: (params: TimeSpan) => TimelinePoint[];\n getExtremesPrediction: (params: ExtremesInput) => Extreme[];\n getWaterLevelAtTime: (params: { time: Date }) => TimelinePoint;\n}\n\nconst tidePredictionFactory = (\n constituents: HarmonicConstituent[],\n options: TidePredictionOptions = {},\n): TidePrediction => {\n const harmonicsOptions = {\n harmonicConstituents: constituents,\n offset: false as number | false,\n ...options,\n };\n\n const tidePrediction: TidePrediction = {\n getTimelinePrediction: ({ start, end, timeFidelity }: TimeSpan): TimelinePoint[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction({ timeFidelity })\n .getTimelinePrediction();\n },\n\n getExtremesPrediction: ({\n start,\n end,\n labels,\n offsets,\n timeFidelity,\n }: ExtremesInput): Extreme[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction({ timeFidelity })\n .getExtremesPrediction({ labels, offsets });\n },\n\n getWaterLevelAtTime: ({ time }: { time: Date }): TimelinePoint => {\n const endDate = new Date(time.getTime() + 10 * 60 * 1000);\n return harmonics(harmonicsOptions)\n .setTimeSpan(time, endDate)\n .prediction()\n .getTimelinePrediction()[0];\n },\n };\n\n return tidePrediction;\n};\n\n// Make constituents available on factory for reference\ntidePredictionFactory.constituents = constituents;\n\nexport default tidePredictionFactory;\nexport type { HarmonicConstituent, TimelinePoint, Extreme };\n"],"mappings":";AAAA,MAAa,MAAM,KAAK,KAAK;AAC7B,MAAa,MAAM,MAAQ,KAAK;;;;ACAhC,MAAM,wBACJ,SACA,UAAkB,GAClB,UAAkB,GAClB,MAAc,GACd,OAAe,MACJ;AACX,QACE,UACA,UAAU,KACV,UAAW,OACX,OAAO,OAAc,OACrB,QAAQ,OAAc;;AAc1B,MAAMA,eAA6B;CAEjC,sBAAsB;EACpB,qBAAqB,IAAI,IAAI,OAAO;EACpC,CAAC,qBAAqB,GAAG,GAAG,QAAQ;EACpC,CAAC,qBAAqB,GAAG,GAAG,KAAK;EACjC,qBAAqB,GAAG,GAAG,QAAQ;EACnC,CAAC,qBAAqB,GAAG,GAAG,MAAM;EAClC,CAAC,qBAAqB,GAAG,GAAG,OAAO;EACnC,CAAC,qBAAqB,GAAG,GAAG,MAAM;EAClC,qBAAqB,GAAG,GAAG,KAAK;EAChC,qBAAqB,GAAG,GAAG,MAAM;EACjC,qBAAqB,GAAG,GAAG,KAAK;EAChC,qBAAqB,GAAG,GAAG,KAAK;EACjC,CAAC,KAAK,QAAQ,UAAU;AACvB,SAAO,SAAS,KAAK,IAAI,KAAM,MAAM;GACrC;CAEF,cAAc;EAAC;EAAsB;EAA0B;EAAuB;EAAW;CAEjG,gBAAgB;EAAC;EAAW;EAAa;EAAU;CAEnD,kBAAkB,CAAC,MAAM;CAEzB,gBAAgB;EAAC;EAAa;EAAiB;EAAY,IAAI,SAAW,IAAI;EAAW;CAEzF,WAAW;EAAC;EAAY;EAAe;EAAW,IAAI;EAAU,KAAK;EAAW;CAEhF,cAAc;EAAC;EAAW;EAAc;EAAY,KAAK;EAAS,IAAI;EAAW;CAClF;AAED,2BAAe;;;;AC/Bf,MAAM,cAA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WAA0B,YAAsC;AACvF,UAAQ,QAAQ,UAAU;AAC1B,QAAM,QAAQ,QAAQ;AACtB,MAAI,MAAM,SAAS,IAAI,IAAI,SAAS,CAClC,OAAM,IAAI,MAAM,qCAAqC;AAEvD,SAAO;;AAGT,WAAU,cAAc,YAA4C;AAElE,SAAOC,mBAAW;GAChB,UAAU,YAAY,OAAO,MAFlB,OAAO,YAAY,cAAc,UAAU,EAAE,cAAc,KAAS,EAExC,aAAa;GACpD;GACA;GACD,CAAC;;AAGJ,QAAO,OAAO,OAAO,UAAU;;AAGjC,wBAAe;;;;ACvEf,MAAM,yBACJ,gBACA,UAAiC,EAAE,KAChB;CACnB,MAAM,mBAAmB;EACvB,sBAAsBC;EACtB,QAAQ;EACR,GAAG;EACJ;AAgCD,QA9BuC;EACrC,wBAAwB,EAAE,OAAO,KAAK,mBAA8C;AAClF,UAAOC,kBAAU,iBAAiB,CAC/B,YAAY,OAAO,IAAI,CACvB,WAAW,EAAE,cAAc,CAAC,CAC5B,uBAAuB;;EAG5B,wBAAwB,EACtB,OACA,KACA,QACA,SACA,mBAC8B;AAC9B,UAAOA,kBAAU,iBAAiB,CAC/B,YAAY,OAAO,IAAI,CACvB,WAAW,EAAE,cAAc,CAAC,CAC5B,sBAAsB;IAAE;IAAQ;IAAS,CAAC;;EAG/C,sBAAsB,EAAE,WAA0C;GAChE,MAAM,UAAU,IAAI,KAAK,KAAK,SAAS,GAAG,MAAU,IAAK;AACzD,UAAOA,kBAAU,iBAAiB,CAC/B,YAAY,MAAM,QAAQ,CAC1B,YAAY,CACZ,uBAAuB,CAAC;;EAE9B;;AAMH,sBAAsB,eAAeD;AAErC,kBAAe"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["coefficients: Coefficients","result: number[]","modulus","result: any","polynomials: Record<string, number[]>","coefficients","functions: Record<string, (N: number, i: number, omega: number) => number>","coefficients","astro","nodeCorrections","coefficients: number[]","f: number[]","results: number[]","nc","nc","M2","O1","nc","M2","K1","M2","O1","nc","M2","S2","nc","nc","nc","N2","J1","S2","M2","nc","L2","N2","nc","nc","nc","nc","nc","M2","M2","M2","nc","nc","nc","M2","K1","M2","K1","S2","nc","M2","N2","M2","S2","S2","M2","M2","S2","K1","nc","M2","T2","M2","S2","N2","nc","nc","nc","nc","nc","R2","NU2","K1","nc","S2","S2","S2","nc","nc","nc","T2","nc","constituents: Record<string, Constituent>","amplitudes: number[]","prediction: Prediction","results: Extreme[]","results: TimelinePoint[]","prediction: TimelinePoint","prediction","astro","baseValue: Record<string, number>","baseSpeed: Record<string, number>","u: Record<string, number>[]","f: Record<string, number>[]","constituentModels","uItem: Record<string, number>","fItem: Record<string, number>","items: Date[]","hours: number[]","constituents: HarmonicConstituent[]","constituentModels","harmonics: Harmonics","prediction","constituents","harmonics"],"sources":["../src/astronomy/constants.ts","../src/astronomy/coefficients.ts","../src/astronomy/index.ts","../src/node-corrections/index.ts","../src/constituents/definition.ts","../src/constituents/M2.ts","../src/constituents/O1.ts","../src/constituents/2MK3.ts","../src/constituents/K1.ts","../src/constituents/2MK5.ts","../src/constituents/2MO5.ts","../src/constituents/S2.ts","../src/constituents/2MS6.ts","../src/constituents/2N2.ts","../src/constituents/N2.ts","../src/constituents/J1.ts","../src/constituents/2Q1.ts","../src/constituents/2SM2.ts","../src/constituents/L2.ts","../src/constituents/3L2.ts","../src/constituents/3N2.ts","../src/constituents/EP2.ts","../src/constituents/K2.ts","../src/constituents/LAMBDA2.ts","../src/constituents/M1.ts","../src/constituents/M3.ts","../src/constituents/M4.ts","../src/constituents/M6.ts","../src/constituents/M8.ts","../src/constituents/MA2.ts","../src/constituents/MB2.ts","../src/constituents/MF.ts","../src/constituents/MK3.ts","../src/constituents/MKS2.ts","../src/constituents/MM.ts","../src/constituents/MN4.ts","../src/constituents/MS4.ts","../src/constituents/MSF.ts","../src/constituents/MSQM.ts","../src/constituents/T2.ts","../src/constituents/MTM.ts","../src/constituents/MU2.ts","../src/constituents/N4.ts","../src/constituents/NU2.ts","../src/constituents/OO1.ts","../src/constituents/P1.ts","../src/constituents/Q1.ts","../src/constituents/R2.ts","../src/constituents/R3.ts","../src/constituents/RHO1.ts","../src/constituents/S1.ts","../src/constituents/S3.ts","../src/constituents/S4.ts","../src/constituents/S6.ts","../src/constituents/SA.ts","../src/constituents/SGM.ts","../src/constituents/SSA.ts","../src/constituents/T3.ts","../src/constituents/Z0.ts","../src/constituents/index.ts","../src/harmonics/prediction.ts","../src/harmonics/index.ts","../src/index.ts"],"sourcesContent":["export const d2r = Math.PI / 180.0;\nexport const r2d = 180.0 / Math.PI;\n","// Convert a sexagesimal angle into decimal degrees\nconst sexagesimalToDecimal = (\n degrees: number,\n arcmins: number = 0,\n arcsecs: number = 0,\n mas: number = 0,\n muas: number = 0,\n): number => {\n return (\n degrees +\n arcmins / 60.0 +\n arcsecs / (60.0 * 60.0) +\n mas / (60.0 * 60.0 * 1e3) +\n muas / (60.0 * 60.0 * 1e6)\n );\n};\n\ninterface Coefficients {\n terrestrialObliquity: number[];\n solarPerigee: number[];\n solarLongitude: number[];\n lunarInclination: number[];\n lunarLongitude: number[];\n lunarNode: number[];\n lunarPerigee: number[];\n}\n\nconst coefficients: Coefficients = {\n // Meeus formula 21.3\n terrestrialObliquity: [\n sexagesimalToDecimal(23, 26, 21.448),\n -sexagesimalToDecimal(0, 0, 4680.93),\n -sexagesimalToDecimal(0, 0, 1.55),\n sexagesimalToDecimal(0, 0, 1999.25),\n -sexagesimalToDecimal(0, 0, 51.38),\n -sexagesimalToDecimal(0, 0, 249.67),\n -sexagesimalToDecimal(0, 0, 39.05),\n sexagesimalToDecimal(0, 0, 7.12),\n sexagesimalToDecimal(0, 0, 27.87),\n sexagesimalToDecimal(0, 0, 5.79),\n sexagesimalToDecimal(0, 0, 2.45),\n ].map((number, index) => {\n return number * Math.pow(1e-2, index);\n }),\n\n solarPerigee: [280.46645 - 357.5291, 36000.76932 - 35999.0503, 0.0003032 + 0.0001559, 0.00000048],\n\n solarLongitude: [280.46645, 36000.76983, 0.0003032],\n\n lunarInclination: [5.145],\n\n lunarLongitude: [218.3164591, 481267.88134236, -0.0013268, 1 / 538841.0 - 1 / 65194000.0],\n\n lunarNode: [125.044555, -1934.1361849, 0.0020762, 1 / 467410.0, -1 / 60616000.0],\n\n lunarPerigee: [83.353243, 4069.0137111, -0.0103238, -1 / 80053.0, 1 / 18999000.0],\n};\n\nexport default coefficients;\nexport { sexagesimalToDecimal };\nexport type { Coefficients };\n","import { d2r, r2d } from \"./constants.js\";\nimport coefficients from \"./coefficients.js\";\n\nexport interface AstroValue {\n value: number;\n speed: number;\n}\n\nexport interface AstroData {\n s: AstroValue;\n h: AstroValue;\n p: AstroValue;\n N: AstroValue;\n pp: AstroValue;\n \"90\": AstroValue;\n omega: AstroValue;\n i: AstroValue;\n I: AstroValue;\n xi: AstroValue;\n nu: AstroValue;\n nup: AstroValue;\n nupp: AstroValue;\n \"T+h-s\": AstroValue;\n P: AstroValue;\n}\n\n// Evaluates a polynomial at argument\nconst polynomial = (coefficients: number[], argument: number): number => {\n const result: number[] = [];\n coefficients.forEach((coefficient, index) => {\n result.push(coefficient * Math.pow(argument, index));\n });\n return result.reduce((a, b) => a + b);\n};\n\n// Evaluates a derivative polynomial at argument\nconst derivativePolynomial = (coefficients: number[], argument: number): number => {\n const result: number[] = [];\n coefficients.forEach((coefficient, index) => {\n result.push(coefficient * index * Math.pow(argument, index - 1));\n });\n return result.reduce((a, b) => a + b);\n};\n\n// Meeus formula 11.1\nconst T = (t: Date): number => {\n return (JD(t) - 2451545.0) / 36525;\n};\n\n// Meeus formula 7.1\nconst JD = (t: Date): number => {\n let Y = t.getUTCFullYear();\n let M = t.getUTCMonth() + 1;\n const D =\n t.getUTCDate() +\n t.getUTCHours() / 24.0 +\n t.getUTCMinutes() / (24.0 * 60.0) +\n t.getUTCSeconds() / (24.0 * 60.0 * 60.0) +\n t.getUTCMilliseconds() / (24.0 * 60.0 * 60.0 * 1e6);\n if (M <= 2) {\n Y = Y - 1;\n M = M + 12;\n }\n const A = Math.floor(Y / 100.0);\n const B = 2 - A + Math.floor(A / 4.0);\n return Math.floor(365.25 * (Y + 4716)) + Math.floor(30.6001 * (M + 1)) + D + B - 1524.5;\n};\n\nconst _I = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n const cosI = Math.cos(i) * Math.cos(omega) - Math.sin(i) * Math.sin(omega) * Math.cos(N);\n return r2d * Math.acos(cosI);\n};\n\nconst _xi = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n let e1 = (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) * Math.tan(0.5 * N);\n let e2 = (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) * Math.tan(0.5 * N);\n e1 = Math.atan(e1);\n e2 = Math.atan(e2);\n e1 = e1 - 0.5 * N;\n e2 = e2 - 0.5 * N;\n return -(e1 + e2) * r2d;\n};\n\nconst _nu = (N: number, i: number, omega: number): number => {\n N = d2r * N;\n i = d2r * i;\n omega = d2r * omega;\n let e1 = (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) * Math.tan(0.5 * N);\n let e2 = (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) * Math.tan(0.5 * N);\n e1 = Math.atan(e1);\n e2 = Math.atan(e2);\n e1 = e1 - 0.5 * N;\n e2 = e2 - 0.5 * N;\n return (e1 - e2) * r2d;\n};\n\n// Schureman equation 224\nconst _nup = (N: number, i: number, omega: number): number => {\n const I = d2r * _I(N, i, omega);\n const nu = d2r * _nu(N, i, omega);\n return (\n r2d * Math.atan((Math.sin(2 * I) * Math.sin(nu)) / (Math.sin(2 * I) * Math.cos(nu) + 0.3347))\n );\n};\n\n// Schureman equation 232\nconst _nupp = (N: number, i: number, omega: number): number => {\n const I = d2r * _I(N, i, omega);\n const nu = d2r * _nu(N, i, omega);\n const tan2nupp =\n (Math.sin(I) ** 2 * Math.sin(2 * nu)) / (Math.sin(I) ** 2 * Math.cos(2 * nu) + 0.0727);\n return r2d * 0.5 * Math.atan(tan2nupp);\n};\n\nconst modulus = (a: number, b: number): number => {\n return ((a % b) + b) % b;\n};\n\nconst astro = (time: Date): AstroData => {\n // This gets cast to `AstroData` later, but we build it up step by step here\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: any = {};\n\n const polynomials: Record<string, number[]> = {\n s: coefficients.lunarLongitude,\n h: coefficients.solarLongitude,\n p: coefficients.lunarPerigee,\n N: coefficients.lunarNode,\n pp: coefficients.solarPerigee,\n \"90\": [90.0],\n omega: coefficients.terrestrialObliquity,\n i: coefficients.lunarInclination,\n };\n\n // Polynomials are in T, that is Julian Centuries; we want our speeds to be\n // in the more convenient unit of degrees per hour.\n const dTdHour = 1 / (24 * 365.25 * 100);\n for (const name in polynomials) {\n result[name] = {\n value: modulus(polynomial(polynomials[name], T(time)), 360.0),\n speed: derivativePolynomial(polynomials[name], T(time)) * dTdHour,\n };\n }\n\n // Some other parameters defined by Schureman which are dependent on the\n // parameters N, i, omega for use in node factor calculations. We don't need\n // their speeds.\n const functions: Record<string, (N: number, i: number, omega: number) => number> = {\n I: _I,\n xi: _xi,\n nu: _nu,\n nup: _nup,\n nupp: _nupp,\n };\n Object.keys(functions).forEach((name) => {\n const functionCall = functions[name];\n result[name] = {\n value: modulus(functionCall(result.N.value, result.i.value, result.omega.value), 360.0),\n speed: null,\n };\n });\n\n // We don't work directly with the T (hours) parameter, instead our spanning\n // set for equilibrium arguments #is given by T+h-s, s, h, p, N, pp, 90.\n // This is in line with convention.\n const hour = {\n value: (JD(time) - Math.floor(JD(time))) * 360.0,\n speed: 15.0,\n };\n\n result[\"T+h-s\"] = {\n value: hour.value + result.h.value - result.s.value,\n speed: hour.speed + result.h.speed - result.s.speed,\n };\n\n // It is convenient to calculate Schureman's P here since several node\n // factors need it, although it could be argued that these\n // (along with I, xi, nu etc) belong somewhere else.\n result.P = {\n value: result.p.value - (result.xi.value % 360.0),\n speed: null,\n };\n\n return result as AstroData;\n};\n\nexport default astro;\nexport { polynomial, derivativePolynomial, T, JD, _I, _xi, _nu, _nup, _nupp };\n","import { d2r, r2d } from \"../astronomy/constants.js\";\nimport type { AstroData } from \"../astronomy/index.js\";\n\nexport type NodeCorrectionFunction = (a: AstroData, ...args: unknown[]) => number;\n\nconst corrections = {\n fUnity(): number {\n return 1;\n },\n\n // Schureman equations 73, 65\n fMm(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n (2 / 3.0 - Math.pow(Math.sin(omega), 2)) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n return (2 / 3.0 - Math.pow(Math.sin(I), 2)) / mean;\n },\n\n // Schureman equations 74, 66\n fMf(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.pow(Math.sin(omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return Math.pow(Math.sin(I), 2) / mean;\n },\n\n // Schureman equations 75, 67\n fO1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n Math.sin(omega) * Math.pow(Math.cos(0.5 * omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return (Math.sin(I) * Math.pow(Math.cos(0.5 * I), 2)) / mean;\n },\n\n // Schureman equations 76, 68\n fJ1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.sin(2 * omega) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n return Math.sin(2 * I) / mean;\n },\n\n // Schureman equations 77, 69\n fOO1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean =\n Math.sin(omega) * Math.pow(Math.sin(0.5 * omega), 2) * Math.pow(Math.cos(0.5 * i), 4);\n return (Math.sin(I) * Math.pow(Math.sin(0.5 * I), 2)) / mean;\n },\n\n // Schureman equations 78, 70\n fM2(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const mean = Math.pow(Math.cos(0.5 * omega), 4) * Math.pow(Math.cos(0.5 * i), 4);\n return Math.pow(Math.cos(0.5 * I), 4) / mean;\n },\n\n // Schureman equations 227, 226, 68\n // Should probably eventually include the derivations of the magic numbers (0.5023 etc).\n fK1(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const nu = d2r * a.nu.value;\n const sin2IcosnuMean = Math.sin(2 * omega) * (1 - (3 / 2.0) * Math.pow(Math.sin(i), 2));\n const mean = 0.5023 * sin2IcosnuMean + 0.1681;\n return (\n Math.pow(\n 0.2523 * Math.pow(Math.sin(2 * I), 2) + 0.1689 * Math.sin(2 * I) * Math.cos(nu) + 0.0283,\n 0.5,\n ) / mean\n );\n },\n\n // Schureman equations 215, 213, 204\n // It can be (and has been) confirmed that the exponent for R_a reads 1/2 via Schureman Table 7\n fL2(a: AstroData): number {\n const P = d2r * a.P.value;\n const I = d2r * a.I.value;\n const rAInv = Math.pow(\n 1 -\n 12 * Math.pow(Math.tan(0.5 * I), 2) * Math.cos(2 * P) +\n 36 * Math.pow(Math.tan(0.5 * I), 4),\n 0.5,\n );\n return corrections.fM2(a) * rAInv;\n },\n\n // Schureman equations 235, 234, 71\n // Again, magic numbers\n fK2(a: AstroData): number {\n const omega = d2r * a.omega.value;\n const i = d2r * a.i.value;\n const I = d2r * a.I.value;\n const nu = d2r * a.nu.value;\n const sinsqIcos2nuMean = Math.sin(omega) ** 2 * (1 - (3 / 2.0) * Math.sin(i) ** 2);\n const mean = 0.5023 * sinsqIcos2nuMean + 0.0365;\n return (\n Math.pow(\n 0.2523 * Math.pow(Math.sin(I), 4) +\n 0.0367 * Math.pow(Math.sin(I), 2) * Math.cos(2 * nu) +\n 0.0013,\n 0.5,\n ) / mean\n );\n },\n\n // Schureman equations 206, 207, 195\n fM1(a: AstroData): number {\n const P = d2r * a.P.value;\n const I = d2r * a.I.value;\n const qAInv = Math.pow(\n 0.25 +\n 1.5 * Math.cos(I) * Math.cos(2 * P) * Math.pow(Math.cos(0.5 * I), -0.5) +\n 2.25 * Math.pow(Math.cos(I), 2) * Math.pow(Math.cos(0.5 * I), -4),\n 0.5,\n );\n return corrections.fO1(a) * qAInv;\n },\n\n // See e.g. Schureman equation 149\n fModd(a: AstroData, n: number): number {\n return Math.pow(corrections.fM2(a), n / 2.0);\n },\n\n // Node factors u, see Table 2 of Schureman.\n\n uZero(): number {\n return 0.0;\n },\n\n uMf(a: AstroData): number {\n return -2.0 * a.xi.value;\n },\n\n uO1(a: AstroData): number {\n return 2.0 * a.xi.value - a.nu.value;\n },\n\n uJ1(a: AstroData): number {\n return -a.nu.value;\n },\n\n uOO1(a: AstroData): number {\n return -2.0 * a.xi.value - a.nu.value;\n },\n\n uM2(a: AstroData): number {\n return 2.0 * a.xi.value - 2.0 * a.nu.value;\n },\n\n uK1(a: AstroData): number {\n return -a.nup.value;\n },\n\n // Schureman 214\n uL2(a: AstroData): number {\n const I = d2r * a.I.value;\n const P = d2r * a.P.value;\n const R =\n r2d *\n Math.atan(Math.sin(2 * P) / ((1 / 6.0) * Math.pow(Math.tan(0.5 * I), -2) - Math.cos(2 * P)));\n return 2.0 * a.xi.value - 2.0 * a.nu.value - R;\n },\n\n uK2(a: AstroData): number {\n return -2.0 * a.nupp.value;\n },\n\n // Schureman 202\n uM1(a: AstroData): number {\n const I = d2r * a.I.value;\n const P = d2r * a.P.value;\n const Q = r2d * Math.atan(((5 * Math.cos(I) - 1) / (7 * Math.cos(I) + 1)) * Math.tan(P));\n return a.xi.value - a.nu.value + Q;\n },\n\n uModd(a: AstroData, n: number): number {\n return (n / 2.0) * corrections.uM2(a);\n },\n};\n\nexport default corrections;\n","import type { AstroData } from \"../astronomy/index.js\";\nimport nodeCorrections, { type NodeCorrectionFunction } from \"../node-corrections/index.js\";\n\nexport interface Constituent {\n names: string[];\n coefficients: number[];\n value: (astro: AstroData) => number;\n speed: (astro: AstroData) => number;\n u: NodeCorrectionFunction;\n f: NodeCorrectionFunction;\n}\n\nexport function defineConstituent(\n names: string | string[],\n coefficients: number[],\n u?: NodeCorrectionFunction,\n f?: NodeCorrectionFunction,\n): Constituent {\n if (!coefficients) {\n throw new Error(\"Coefficient must be defined for a constituent\");\n }\n\n return Object.freeze({\n names: Array.isArray(names) ? names : [names],\n\n coefficients,\n\n value: (astro: AstroData): number => {\n return dotArray(coefficients, astronomicValues(astro));\n },\n\n speed(astro: AstroData): number {\n return dotArray(coefficients, astronomicSpeed(astro));\n },\n\n u: typeof u !== \"undefined\" ? u : nodeCorrections.uZero,\n\n f: typeof f !== \"undefined\" ? f : nodeCorrections.fUnity,\n });\n}\n\nexport interface ConstituentMember {\n constituent: Constituent;\n factor: number;\n}\n\nexport function defineCompoundConstituent(\n names: string | string[],\n members: ConstituentMember[],\n): Constituent {\n const coefficients: number[] = [];\n members.forEach(({ constituent, factor }) => {\n constituent.coefficients.forEach((coefficient, index) => {\n if (typeof coefficients[index] === \"undefined\") {\n coefficients[index] = 0;\n }\n coefficients[index] += coefficient * factor;\n });\n });\n\n return Object.freeze({\n names: Array.isArray(names) ? names : [names],\n coefficients,\n\n speed: (astro: AstroData): number => {\n let speed = 0;\n members.forEach(({ constituent, factor }) => {\n speed += constituent.speed(astro) * factor;\n });\n return speed;\n },\n\n value: (astro: AstroData): number => {\n let value = 0;\n members.forEach(({ constituent, factor }) => {\n value += constituent.value(astro) * factor;\n });\n return value;\n },\n\n u: (astro: AstroData): number => {\n let u = 0;\n members.forEach(({ constituent, factor }) => {\n u += constituent.u(astro) * factor;\n });\n return u;\n },\n\n f: (astro: AstroData): number => {\n const f: number[] = [];\n members.forEach(({ constituent, factor }) => {\n f.push(Math.pow(constituent.f(astro), Math.abs(factor)));\n });\n return f.reduce((previous, value) => previous * value);\n },\n });\n}\n\n/**\n * Computes the dot notation of two arrays\n */\nfunction dotArray(a: number[], b: number[]): number {\n const results: number[] = [];\n a.forEach((value, index) => {\n results.push(value * b[index]);\n });\n return results.reduce((total, value) => total + value);\n}\n\nexport function astronimicDoodsonNumber(astro: AstroData): AstroData[keyof AstroData][] {\n return [astro[\"T+h-s\"], astro.s, astro.h, astro.p, astro.N, astro.pp, astro[\"90\"]];\n}\n\nexport function astronomicSpeed(astro: AstroData): number[] {\n const results: number[] = [];\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.speed);\n });\n return results;\n}\n\nexport function astronomicValues(astro: AstroData): number[] {\n const results: number[] = [];\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.value);\n });\n return results;\n}\n\n// Silence TS warning for empty module\nexport default {};\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (M2).\n * Primary principal lunar constituent; largest semi-diurnal tidal component globally.\n * Amplitude varies 10-20% over lunar node cycle; typically 0.2-0.5m in coastal areas.\n * Base constituent for many compound shallow-water constituents.\n */\nexport default defineConstituent(\"M2\", [2, 0, 0, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (O1).\n * Primary lunar diurnal constituent; one-per-lunar-day oscillation.\n * Amplitude varies 10-20% due to lunar node effects.\n */\nexport default defineConstituent(\"O1\", [1, -1, 0, 0, 0, 0, 1], nc.uO1, nc.fO1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport O1 from \"./O1.js\";\n\n/**\n * Shallow-water terdiurnal (2MK3 = M2 + O1).\n * Lunar-lunar interaction from M2 semi-diurnal and O1 diurnal components.\n * Generated in shallow-water environments; typical amplitude <1 cm.\n */\nexport default defineCompoundConstituent(\"2MK3\", [\n { constituent: M2, factor: 1 },\n { constituent: O1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunisolar diurnal (K1).\n * Combined lunar and solar diurnal constituent; strongest diurnal tide in many regions.\n * Often comparable in amplitude to O1; amplitude ratio K1/O1 varies with latitude.\n */\nexport default defineConstituent(\"K1\", [1, 1, 0, 0, 0, 0, -1], nc.uK1, nc.fK1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water fifth-diurnal from M2-K1 interaction.\n *\n * Note: Found in coastal tide predictions, especially in enclosed bays and harbors.\n * Amplitude typically 0.1-0.5 cm depending on location and water depth.\n * Shallow-water constituent only; not present in deep ocean.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"2MK5\", [\n { constituent: M2, factor: 2 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport O1 from \"./O1.js\";\n\n/**\n * Shallow-water fifth-diurnal from M2-O1 interaction.\n *\n * Note: Primarily shallow-water coastal phenomenon, not present in deep ocean.\n * Amplitude typically <0.5 cm except in extreme shallow-water or enclosed basins.\n * Found in coastal tide predictions alongside other shallow-water constituents.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"2MO5\", [\n { constituent: M2, factor: 2 },\n { constituent: O1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar semi-diurnal (S2).\n * Principal solar semi-diurnal constituent; largest solar tide component.\n * Amplitude typically 20-50% of M2; varies with geographic location and latitude.\n * Ratio M2/S2 determines tidal form factor (diurnal vs semi-diurnal regimes).\n * Base constituent for many compound shallow-water constituents.\n */\nexport default defineConstituent(\"S2\", [2, 2, -2, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Sixth-diurnal shallow-water interaction: 2×M2 + S2.\n *\n * Generated only in shallow water; typical amplitude 0.01-0.2 meters depending on depth.\n * Included in IHO shallow-water constituent tables and NOAA analysis (order #37).\n */\nexport default defineCompoundConstituent(\"2MS6\", [\n { constituent: M2, factor: 2 },\n { constituent: S2, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (2N2).\n * Second-order lunar semi-diurnal from Moon's orbital ellipticity.\n * Amplitude typically 5-10% of M2; significant in semi-diurnal analysis.\n */\nexport default defineConstituent(\"2N2\", [2, -2, 0, 2, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (N2).\n * Primary lunar elliptic semi-diurnal constituent from Moon's orbital variations.\n * Amplitude typically 5-15% of M2; third-largest semi-diurnal constituent.\n */\nexport default defineConstituent(\"N2\", [2, -1, 0, 1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (J1).\n * Shallow-water lunar diurnal constituent; generally much smaller than O1 and K1.\n * Typically important only in shallow-water systems and enclosed basins.\n * Amplitude usually <5% of O1; rarely significant in routine predictions.\n */\nexport default defineConstituent(\"J1\", [1, 2, 0, -1, 0, 0, -1], nc.uJ1, nc.fJ1);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\nimport J1 from \"./J1.js\";\n\n/**\n * Shallow-water diurnal (2Q1 = N2-J1).\n * Derived from interaction of semi-diurnal N2 and diurnal J1 constituents.\n * Amplitude typically very small; rarely significant.\n * Found only in shallow-water regions with strong tidal distortion.\n */\nexport default defineCompoundConstituent(\"2Q1\", [\n { constituent: N2, factor: 1 },\n { constituent: J1, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water semi-diurnal (2SM2).\n * Compound constituent: 2×S2 - M2\n * Solar-lunar interaction constituent generated in shallow-water environments.\n * Amplitude typically <2% of M2; complementary to MU2.\n */\nexport default defineCompoundConstituent(\"2SM2\", [\n { constituent: S2, factor: 2 },\n { constituent: M2, factor: -1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (L2).\n * Secondary lunar elliptic semi-diurnal from Moon's orbital variations and perigee effects.\n * Amplitude typically 1-3% of M2; often grouped with other lunar elliptic constituents.\n * Important in detailed harmonic analyses of semi-diurnal tides.\n */\nexport default defineConstituent(\"L2\", [2, 1, 0, -1, 0, 0, 2], nc.uL2, nc.fL2);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport L2 from \"./L2.js\";\n\n/**\n * Triple lunar elliptic; 3 times L2 interaction.\n *\n * Warning: Not in standard IHO constituent bank. Mainly historical/theoretical interest.\n * Very small amplitude (<0.1 cm); found only in extreme shallow water or enclosed basins.\n * Often ignored in routine tide predictions.\n *\n * @see Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides\n */\nexport default defineCompoundConstituent(\"3L2\", [{ constituent: L2, factor: 3 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Triple N2 shallow-water harmonic (3 × N2).\n *\n * Note: Shallow-water constituent with definition based on compound frequency estimates.\n * Typical amplitude <0.5 cm; often <0.1 cm except in extreme shallow-water or enclosed basins.\n * Rarely significant in routine tide predictions.\n *\n * @see NOAA CO-OPS shallow-water constituents\n */\nexport default defineCompoundConstituent(\"3N2\", [{ constituent: N2, factor: 3 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal constituent (ε2).\n */\nexport default defineConstituent(\"EP2\", [2, -3, 2, 1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunisolar semi-diurnal (K2).\n * Combined lunar and solar semi-diurnal constituent from declination effects.\n * Amplitude typically 10-30% of S2; second-largest solar-related semi-diurnal component.\n * Important in semi-diurnal tidal analysis, especially at mid-latitudes.\n */\nexport default defineConstituent(\"K2\", [2, 2, 0, 0, 0, 0, 0], nc.uK2, nc.fK2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar semi-diurnal (λ2, lambda2).\n * Lunar semi-diurnal constituent from Moon's perigee effects.\n * Amplitude typically <5% of M2; important in detailed constituent analysis.\n * IHO standard designation (previously abbreviated as LAM2).\n */\nexport default defineConstituent([\"LAM2\", \"LAMBDA2\"], [2, 1, -2, 1, 0, 0, 2], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal elliptic (M1).\n * Secondary lunar diurnal constituent from Moon's elliptical orbit.\n * Typically very small amplitude; usually <1% of O1.\n * Rarely significant except in detailed harmonic analyses.\n */\nexport default defineConstituent(\"M1\", [1, 0, 0, 0, 0, 0, 1], nc.uM1, nc.fM1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar terdiurnal (M3).\n * Third-diurnal lunar constituent from Moon's orbital motion.\n * Typically found in shallow water and resonant systems.\n * Amplitude usually <2% of M2; important in some shallow-water analyses.\n */\n// Third diurnal\nexport default defineConstituent(\n \"M3\",\n [3, 0, 0, 0, 0, 0, 0],\n (a) => {\n return nc.uModd(a, 3);\n },\n (a) => {\n return nc.fModd(a, 3);\n },\n);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water quarter-diurnal (M4 = 2×M2).\n * First overtide of M2; generated in shallow-water environments.\n * Amplitude typically 2-10% of M2; largest of the quarter-diurnal constituents.\n * Important indicator of shallow-water tidal distortion.\n */\nexport default defineCompoundConstituent(\"M4\", [{ constituent: M2, factor: 2 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water sixth-diurnal (M6 = 3×M2).\n * Second overtide of M2; generated in shallow-water environments.\n * Amplitude typically 0.5-3% of M2; important in extreme shallow water.\n * Indicator of significant tidal distortion and non-linear effects.\n */\nexport default defineCompoundConstituent(\"M6\", [{ constituent: M2, factor: 3 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Shallow-water eighth-diurnal (M8 = 4×M2).\n * Third overtide of M2; generated in extreme shallow-water environments.\n * Amplitude typically <0.5% of M2; very rarely significant.\n * Found only in highly distorted tidal regimes (extreme shallow water, enclosed basins).\n */\nexport default defineCompoundConstituent(\"M8\", [{ constituent: M2, factor: 4 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar variational semi-diurnal constituent (μ2, mu2).\n * Derived from Moon's orbital parameter variations.\n *\n * Note: Often included with M2 family in modern analysis. Minor constituent with\n * location-dependent amplitude.\n */\nexport default defineConstituent(\"MA2\", [2, 0, -1, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic constituent from parameter variations.\n *\n * From https://iho.int/mtg_docs/com_wg/IHOTC/IHOTC_Misc/TWCWG_Constituent_list.pdf:\n *\n * > MB2 was originally called Ma2 but this became ambiguous when spoken, or typed on\n * > computers without lower case, and so it was initially changed to MA2*. However, this\n * > in turn was thought to be clumsy and hence MB2 was finally adopted. Although\n * > theoretically they should have the same values of u and f as M2, they are so small\n * > that they are commonly treated as having values of u = 0 and f = 1.\n *\n * @see Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides\n */\nexport default defineConstituent(\"MB2\", [2, 0, 1, 0, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar fortnightly (MF).\n * Long-period constituent from lunar inequality interactions.\n * Significant in long-term water level records and coastal resonances.\n */\nexport default defineConstituent(\"MF\", [0, 2, 0, 0, 0, 0, 0], nc.uMf, nc.fMf);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water terdiurnal (MK3).\n * Compound constituent: M2 + K1\n * Lunisolar interaction from M2 semi-diurnal and K1 diurnal components.\n * Generated in shallow-water environments; typical amplitude 0.5-2 cm.\n * Often paired with 2MK3 in terdiurnal tide analysis.\n */\nexport default defineCompoundConstituent(\"MK3\", [\n { constituent: M2, factor: 1 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport K1 from \"./K1.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Three-way shallow-water interaction of M2, K1, and S2.\n *\n * Warning: Not in standard IHO constituent bank. Shallow-water specific constituent\n * with definition varying by application and water depth. Use with caution and document\n * the specific convention used in your analysis.\n *\n * @see NOAA CO-OPS shallow-water constituents\n */\nexport default defineCompoundConstituent(\"MKS2\", [\n { constituent: M2, factor: 1 },\n { constituent: K1, factor: 1 },\n { constituent: S2, factor: -1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar monthly (MM).\n * Long-period constituent from lunar declination variations.\n * Important for long-term water level studies.\n */\nexport default defineConstituent(\"MM\", [0, 1, 0, -1, 0, 0, 0], nc.uZero, nc.fMm);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Shallow-water quarter-diurnal (MN4).\n * Compound constituent: M2 + N2\n * Lunar-lunar elliptic interaction from M2 and N2 semi-diurnal components.\n * Generated in shallow-water environments; typical amplitude 1-5 cm.\n * Often significant in shallow seas and estuaries.\n */\nexport default defineCompoundConstituent(\"MN4\", [\n { constituent: M2, factor: 1 },\n { constituent: N2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water quarter-diurnal (MS4).\n * Compound constituent: M2 + S2\n * Lunar-solar interaction from M2 and S2 semi-diurnal components.\n * Generated in shallow-water environments; typical amplitude 1-5 cm.\n * Often second-largest quarter-diurnal component after M4.\n */\nexport default defineCompoundConstituent(\"MS4\", [\n { constituent: M2, factor: 1 },\n { constituent: S2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\nimport M2 from \"./M2.js\";\n\n/**\n * Lunisolar synodic fortnightly (MSF = S2-M2).\n * Long-period constituent representing beat frequency between solar S2 and lunar M2.\n * Manifests as fortnightly modulation of tidal range (spring-neap cycle).\n * Amplitude typically 5-15% of M2; represents the primary spring-neap variation.\n * Important for tidal range predictions and coastal flooding assessments.\n */\nexport default defineCompoundConstituent(\"MSF\", [\n { constituent: S2, factor: 1 },\n { constituent: M2, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Lunar-solar interaction compound constituent.\n *\n * Warning: Non-standard constituent not in IHO or modern NOAA standard tables.\n * Definition varies significantly across sources. Rarely used in modern tide prediction.\n * Appears in Schureman's tables as variant shallow-water interaction.\n *\n * @see NOAA CO-OPS shallow-water constituents\n * @see Schureman shallow-water analysis tables\n */\nexport default defineCompoundConstituent(\"MSQM\", [\n { constituent: M2, factor: 1 },\n { constituent: S2, factor: 1 },\n { constituent: K1, factor: 1 },\n]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar elliptic semi-diurnal (T2).\n * Larger solar elliptic semi-diurnal constituent from solar declination effects.\n * Amplitude typically <5% of S2; increases at higher latitudes.\n * Forms part of solar semi-diurnal analysis alongside S2 and R2.\n */\nexport default defineConstituent(\"T2\", [2, 2, -3, 0, 0, 1, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport T2 from \"./T2.js\";\n\n/**\n * Lunar-solar shallow-water interaction (M2 modulated by lunar orbit).\n *\n * Warning: Not in modern IHO standard constituents; mostly historical interest.\n * Often replaced by specific ν2, λ2, or other lunar elliptic terms in modern analysis.\n * Amplitude is location and depth-dependent.\n *\n * @see NOAA CO-OPS shallow-water variants\n * @see Schureman Manual\n */\nexport default defineCompoundConstituent(\"MTM\", [\n { constituent: M2, factor: 1 },\n { constituent: T2, factor: 1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport M2 from \"./M2.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water semi-diurnal (MU2 or μ2).\n * Compound constituent: 2×M2 - S2\n * Lunar variational constituent generated in shallow-water environments.\n * Amplitude typically <2% of M2; found in coastal shallow-water predictions.\n */\nexport default defineCompoundConstituent(\"MU2\", [\n { constituent: M2, factor: 2 },\n { constituent: S2, factor: -1 },\n]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport N2 from \"./N2.js\";\n\n/**\n * Second overtide of N2; shallow-water quarter-diurnal harmonic.\n * Amplitude ranges 0.25 to 2.25 times mean due to 18.613-year lunar node cycle.\n *\n * Note: Shallow-water constituent, typically found in tide predictions for coastal areas.\n */\nexport default defineCompoundConstituent(\"N4\", [{ constituent: N2, factor: 2 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar elliptic semi-diurnal (NU2).\n * Secondary lunar elliptic semi-diurnal from Moon's orbital variations.\n * Amplitude typically 2-5% of M2; smaller than N2.\n * Important in detailed semi-diurnal constituent analysis.\n */\nexport default defineConstituent(\"NU2\", [2, -1, 2, -1, 0, 0, 0], nc.uM2, nc.fM2);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal (OO1).\n * Second-order lunar diurnal constituent from Moon's orbital eccentricity.\n * Typically very small amplitude; <2% of O1 in most locations.\n * Important for detailed harmonic analysis in some regions.\n */\nexport default defineConstituent(\"OO1\", [1, 3, 0, 0, 0, 0, -1], nc.uOO1, nc.fOO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar diurnal (P1).\n * Principal solar diurnal constituent; one-per-solar-day oscillation.\n * Amplitude typically 1/3 of K1; varies with latitude.\n * Forms key component of diurnal tidal analysis alongside K1 and O1.\n */\nexport default defineConstituent(\"P1\", [1, 1, -2, 0, 0, 0, 1], nc.uZero, nc.fUnity);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Elliptic lunar diurnal (Q1).\n * One solar day and one lunar day modulation interaction.\n * Amplitude typically 2-5% of O1; important in diurnal constituent analysis.\n */\nexport default defineConstituent(\"Q1\", [1, -2, 0, 1, 0, 0, 1], nc.uO1, nc.fO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar elliptic semi-diurnal (R2).\n * Smaller solar elliptic semi-diurnal constituent from solar declination effects.\n * Amplitude typically <2% of S2; smallest of the solar semi-diurnal group.\n * Rarely significant except in very detailed analyses.\n */\nexport default defineConstituent(\"R2\", [2, 2, -1, 0, 0, -1, 2], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport R2 from \"./R2.js\";\n\n/**\n * Solar elliptic terdiurnal; 1.5 times R2 (smaller solar elliptic semi-diurnal).\n *\n * Note: Generated only in shallow water; very small amplitude (<0.05 cm typical).\n * Usually negligible except in extreme shallow-water environments.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"R3\", [{ constituent: R2, factor: 1.5 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport NU2 from \"./NU2.js\";\nimport K1 from \"./K1.js\";\n\n/**\n * Shallow-water diurnal (RHO1, ρ1).\n * Compound constituent: NU2-K1 (ν2-K1)\n * Derived from interaction of semi-diurnal NU2 and diurnal K1 constituents.\n * Amplitude typically very small; rarely significant.\n * Found only in shallow-water regions with strong tidal distortion.\n */\nexport default defineCompoundConstituent(\n [\"RHO\", \"RHO1\"],\n [\n { constituent: NU2, factor: 1 },\n { constituent: K1, factor: -1 },\n ],\n);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar diurnal (S1).\n * Secondary solar diurnal constituent related to solar declination inequality.\n * Usually very small amplitude; typically dominated by K1 and P1 in diurnal analysis.\n * Rarely included in routine harmonic analyses.\n */\nexport default defineConstituent(\"S1\", [1, 1, -1, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Solar terdiurnal overtide; shallow-water only.\n *\n * Note: Generated only in shallow water; not found in deep ocean.\n * Typical amplitude <1 cm except in extreme shallow-water environments.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"S3\", [{ constituent: S2, factor: 1.5 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water quarter-diurnal (S4).\n * Compound constituent: 2×S2\n * First overtide of S2; generated in shallow-water environments.\n * Amplitude typically 1-3% of S2; smallest of the common quarter-diurnal constituents.\n * Purely solar, so has fixed amplitude and phase at any location.\n */\nexport default defineCompoundConstituent(\"S4\", [{ constituent: S2, factor: 2 }]);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport S2 from \"./S2.js\";\n\n/**\n * Shallow-water sixth-diurnal (S6).\n * Compound constituent: 3×S2\n * Second overtide of S2; generated in shallow-water environments.\n * Amplitude typically 0.5-1% of S2; smallest of the common overtides.\n * Rarely significant except in extreme shallow water or resonant systems.\n */\nexport default defineCompoundConstituent(\"S6\", [{ constituent: S2, factor: 3 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar annual (Sa).\n * Long-term constituent driven by solar declination variations over the year.\n */\nexport default defineConstituent([\"SA\", \"Sa\"], [0, 0, 1, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Lunar diurnal variational constituent (σ1, sigma1).\n * Derived from Moon's declination variations.\n *\n * Note: Often has small amplitude; closely related to K1 and O1 variations.\n */\nexport default defineConstituent([\"SGM\", \"SIGMA1\"], [1, -3, 2, 0, 0, 0, -1], nc.uO1, nc.fO1);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Solar semi-annual (Ssa).\n * Semi-annual constituent from solar declination with twice-yearly periodicity.\n */\nexport default defineConstituent([\"Ssa\", \"SSA\"], [0, 0, 2, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { defineCompoundConstituent } from \"./definition.js\";\nimport T2 from \"./T2.js\";\n\n/**\n * Solar elliptic terdiurnal; 1.5 times T2 (larger solar elliptic semi-diurnal).\n *\n * Note: Generated only in shallow water; minimal amplitude (<0.1 cm typical).\n * Rarely significant except in extreme shallow-water or enclosed basins.\n *\n * @see NOAA CO-OPS\n */\nexport default defineCompoundConstituent(\"T3\", [{ constituent: T2, factor: 1.5 }]);\n","import { defineConstituent } from \"./definition.js\";\nimport nc from \"../node-corrections/index.js\";\n\n/**\n * Mean sea level (Z0).\n * Not a tidal constituent in the strict sense, but represents the mean sea level offset\n * or the \"zero\" reference level used in tidal predictions.\n * No astronomical forcing; typically determined from harmonic analysis of observed data.\n */\nexport default defineConstituent(\"Z0\", [0, 0, 0, 0, 0, 0, 0], nc.uZero, nc.fUnity);\n","import { type Constituent } from \"./definition\";\n\n// Dynamically import all constituent files\nconst constituentModules = import.meta.glob<Constituent>(\"./*.ts\", {\n eager: true,\n import: \"default\",\n});\n\nconst constituents: Record<string, Constituent> = {};\n\n// Extract constituent name from file path and populate the constituents object\nfor (const [path, module] of Object.entries(constituentModules)) {\n // Skip the index and definition files\n if (path.match(/index|definition/)) continue;\n\n module.names.forEach((name) => {\n constituents[name] = module;\n });\n}\n\nexport default constituents;\n","import astro from \"../astronomy/index.js\";\nimport { d2r } from \"../astronomy/constants.js\";\nimport constituentModels from \"../constituents/index.js\";\n\nexport interface Timeline {\n items: Date[];\n hours: number[];\n}\n\nexport interface HarmonicConstituent {\n name: string;\n amplitude: number;\n phase: number;\n speed?: number;\n description?: string;\n}\n\nexport interface TimelinePoint {\n time: Date;\n hour: number;\n level: number;\n}\n\nexport interface Extreme {\n time: Date;\n level: number;\n high: boolean;\n low: boolean;\n label: string;\n}\n\nexport interface ExtremeOffsets {\n height?: {\n high?: number;\n low?: number;\n type?: \"fixed\" | \"ratio\";\n };\n time?: {\n high?: number;\n low?: number;\n };\n}\n\nexport interface ExtremeLabels {\n high?: string;\n low?: string;\n}\n\nexport interface ExtremesOptions {\n labels?: ExtremeLabels;\n offsets?: ExtremeOffsets;\n}\n\nexport interface Prediction {\n getExtremesPrediction: (options?: ExtremesOptions) => Extreme[];\n getTimelinePrediction: () => TimelinePoint[];\n}\n\nconst modulus = (a: number, b: number): number => {\n return ((a % b) + b) % b;\n};\n\nconst addExtremesOffsets = (extreme: Extreme, offsets?: ExtremeOffsets): Extreme => {\n if (typeof offsets === \"undefined\" || !offsets) {\n return extreme;\n }\n\n if (extreme.high && offsets.height?.high) {\n if (offsets.height.type === \"fixed\") {\n extreme.level += offsets.height.high;\n } else {\n extreme.level *= offsets.height.high;\n }\n }\n if (extreme.low && offsets.height?.low) {\n if (offsets.height.type === \"fixed\") {\n extreme.level += offsets.height.low;\n } else {\n extreme.level *= offsets.height.low;\n }\n }\n if (extreme.high && offsets.time?.high) {\n extreme.time = new Date(extreme.time.getTime() + offsets.time.high * 60 * 1000);\n }\n if (extreme.low && offsets.time?.low) {\n extreme.time = new Date(extreme.time.getTime() + offsets.time.low * 60 * 1000);\n }\n return extreme;\n};\n\nconst getExtremeLabel = (label: \"high\" | \"low\", highLowLabels?: ExtremeLabels): string => {\n if (typeof highLowLabels !== \"undefined\" && typeof highLowLabels[label] !== \"undefined\") {\n return highLowLabels[label]!;\n }\n const labels = {\n high: \"High\",\n low: \"Low\",\n };\n return labels[label];\n};\n\ninterface PredictionFactoryParams {\n timeline: Timeline;\n constituents: HarmonicConstituent[];\n start: Date;\n}\n\nconst predictionFactory = ({\n timeline,\n constituents,\n start,\n}: PredictionFactoryParams): Prediction => {\n const getLevel = (\n hour: number,\n modelBaseSpeed: Record<string, number>,\n modelU: Record<string, number>,\n modelF: Record<string, number>,\n modelBaseValue: Record<string, number>,\n ): number => {\n const amplitudes: number[] = [];\n let result = 0;\n\n constituents.forEach((constituent) => {\n const amplitude = constituent.amplitude;\n const phase = constituent.phase;\n const f = modelF[constituent.name];\n const speed = modelBaseSpeed[constituent.name];\n const u = modelU[constituent.name];\n const V0 = modelBaseValue[constituent.name];\n amplitudes.push(amplitude * f * Math.cos(speed * hour + (V0 + u) - phase));\n });\n // sum up each row\n amplitudes.forEach((item) => {\n result += item;\n });\n return result;\n };\n\n const prediction: Prediction = {} as Prediction;\n\n prediction.getExtremesPrediction = (options?: ExtremesOptions): Extreme[] => {\n const { labels, offsets } = typeof options !== \"undefined\" ? options : {};\n const results: Extreme[] = [];\n const { baseSpeed, u, f, baseValue } = prepare();\n let goingUp = false;\n let goingDown = false;\n let lastLevel = getLevel(0, baseSpeed, u[0], f[0], baseValue);\n timeline.items.forEach((time, index) => {\n const hour = timeline.hours[index];\n const level = getLevel(hour, baseSpeed, u[index], f[index], baseValue);\n // Compare this level to the last one, if we\n // are changing angle, then the last one was high or low\n if (level > lastLevel && goingDown) {\n results.push(\n addExtremesOffsets(\n {\n time: timeline.items[index - 1],\n level: lastLevel,\n high: false,\n low: true,\n label: getExtremeLabel(\"low\", labels),\n },\n offsets,\n ),\n );\n }\n if (level < lastLevel && goingUp) {\n results.push(\n addExtremesOffsets(\n {\n time: timeline.items[index - 1],\n level: lastLevel,\n high: true,\n low: false,\n label: getExtremeLabel(\"high\", labels),\n },\n offsets,\n ),\n );\n }\n if (level > lastLevel) {\n goingUp = true;\n goingDown = false;\n }\n if (level < lastLevel) {\n goingUp = false;\n goingDown = true;\n }\n lastLevel = level;\n });\n return results;\n };\n\n prediction.getTimelinePrediction = (): TimelinePoint[] => {\n const results: TimelinePoint[] = [];\n const { baseSpeed, u, f, baseValue } = prepare();\n timeline.items.forEach((time, index) => {\n const hour = timeline.hours[index];\n const prediction: TimelinePoint = {\n time,\n hour,\n level: getLevel(hour, baseSpeed, u[index], f[index], baseValue),\n };\n\n results.push(prediction);\n });\n return results;\n };\n\n const prepare = () => {\n const baseAstro = astro(start);\n\n const baseValue: Record<string, number> = {};\n const baseSpeed: Record<string, number> = {};\n const u: Record<string, number>[] = [];\n const f: Record<string, number>[] = [];\n constituents.forEach((constituent) => {\n const model = constituentModels[constituent.name];\n if (!model) return;\n\n const value = model.value(baseAstro);\n const speed = model.speed(baseAstro);\n baseValue[constituent.name] = d2r * value;\n baseSpeed[constituent.name] = d2r * speed;\n });\n timeline.items.forEach((time) => {\n const uItem: Record<string, number> = {};\n const fItem: Record<string, number> = {};\n const itemAstro = astro(time);\n constituents.forEach((constituent) => {\n const model = constituentModels[constituent.name];\n if (!model) return;\n\n const constituentU = modulus(model.u(itemAstro), 360);\n uItem[constituent.name] = d2r * constituentU;\n fItem[constituent.name] = modulus(model.f(itemAstro), 360);\n });\n\n u.push(uItem);\n f.push(fItem);\n });\n\n return {\n baseValue,\n baseSpeed,\n u,\n f,\n };\n };\n\n return Object.freeze(prediction);\n};\n\nexport default predictionFactory;\n","import prediction from \"./prediction.js\";\nimport constituentModels from \"../constituents/index.js\";\nimport { d2r } from \"../astronomy/constants.js\";\nimport type { HarmonicConstituent, Prediction } from \"./prediction.js\";\n\nexport type * from \"./prediction.js\";\n\nexport interface HarmonicsOptions {\n harmonicConstituents: HarmonicConstituent[];\n offset: number | false;\n}\n\nexport interface PredictionOptions {\n timeFidelity?: number;\n}\n\nexport interface Harmonics {\n setTimeSpan: (startTime: Date | number, endTime: Date | number) => Harmonics;\n prediction: (options?: PredictionOptions) => Prediction;\n}\n\nconst getDate = (time: Date | number): Date => {\n if (time instanceof Date) {\n return time;\n }\n if (typeof time === \"number\") {\n return new Date(time * 1000);\n }\n throw new Error(\"Invalid date format, should be a Date object, or timestamp\");\n};\n\nconst getTimeline = (start: Date, end: Date, seconds: number = 10 * 60) => {\n const items: Date[] = [];\n const endTime = end.getTime() / 1000;\n let lastTime = start.getTime() / 1000;\n const startTime = lastTime;\n const hours: number[] = [];\n while (lastTime <= endTime) {\n items.push(new Date(lastTime * 1000));\n hours.push((lastTime - startTime) / (60 * 60));\n lastTime += seconds;\n }\n\n return {\n items,\n hours,\n };\n};\n\nconst harmonicsFactory = ({ harmonicConstituents, offset }: HarmonicsOptions): Harmonics => {\n if (!Array.isArray(harmonicConstituents)) {\n throw new Error(\"Harmonic constituents are not an array\");\n }\n const constituents: HarmonicConstituent[] = [];\n harmonicConstituents.forEach((constituent) => {\n if (typeof constituent.name === \"undefined\") {\n throw new Error(\"Harmonic constituents must have a name property\");\n }\n if (constituentModels[constituent.name] !== undefined) {\n constituents.push({\n ...constituent,\n phase: d2r * constituent.phase,\n });\n }\n });\n\n if (offset !== false) {\n constituents.push({\n name: \"Z0\",\n phase: 0,\n amplitude: offset,\n });\n }\n\n let start = new Date();\n let end = new Date();\n\n const harmonics: Harmonics = {} as Harmonics;\n\n harmonics.setTimeSpan = (startTime: Date | number, endTime: Date | number): Harmonics => {\n start = getDate(startTime);\n end = getDate(endTime);\n if (start.getTime() >= end.getTime()) {\n throw new Error(\"Start time must be before end time\");\n }\n return harmonics;\n };\n\n harmonics.prediction = (options?: PredictionOptions): Prediction => {\n const opts = typeof options !== \"undefined\" ? options : { timeFidelity: 10 * 60 };\n return prediction({\n timeline: getTimeline(start, end, opts.timeFidelity),\n constituents,\n start,\n });\n };\n\n return Object.freeze(harmonics);\n};\n\nexport default harmonicsFactory;\nexport { getDate, getTimeline };\n","import harmonics from \"./harmonics/index.js\";\nimport { default as constituents } from \"./constituents/index.js\";\nimport type { HarmonicConstituent } from \"./harmonics/index.js\";\nimport type { TimelinePoint, Extreme, ExtremeOffsets } from \"./harmonics/prediction.js\";\n\nexport interface TidePredictionOptions {\n offset?: number | false;\n}\n\nexport interface TimeSpan {\n start: Date;\n end: Date;\n timeFidelity?: number;\n}\n\nexport interface ExtremesInput extends TimeSpan {\n labels?: {\n high?: string;\n low?: string;\n };\n offsets?: ExtremeOffsets;\n}\n\nexport interface TidePrediction {\n getTimelinePrediction: (params: TimeSpan) => TimelinePoint[];\n getExtremesPrediction: (params: ExtremesInput) => Extreme[];\n getWaterLevelAtTime: (params: { time: Date }) => TimelinePoint;\n}\n\nconst tidePredictionFactory = (\n constituents: HarmonicConstituent[],\n options: TidePredictionOptions = {},\n): TidePrediction => {\n const harmonicsOptions = {\n harmonicConstituents: constituents,\n offset: false as number | false,\n ...options,\n };\n\n const tidePrediction: TidePrediction = {\n getTimelinePrediction: ({ start, end, timeFidelity }: TimeSpan): TimelinePoint[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction({ timeFidelity })\n .getTimelinePrediction();\n },\n\n getExtremesPrediction: ({\n start,\n end,\n labels,\n offsets,\n timeFidelity,\n }: ExtremesInput): Extreme[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction({ timeFidelity })\n .getExtremesPrediction({ labels, offsets });\n },\n\n getWaterLevelAtTime: ({ time }: { time: Date }): TimelinePoint => {\n const endDate = new Date(time.getTime() + 10 * 60 * 1000);\n return harmonics(harmonicsOptions)\n .setTimeSpan(time, endDate)\n .prediction()\n .getTimelinePrediction()[0];\n },\n };\n\n return tidePrediction;\n};\n\n// Make constituents available on factory for reference\ntidePredictionFactory.constituents = constituents;\n\nexport default tidePredictionFactory;\nexport type { HarmonicConstituent, TimelinePoint, Extreme };\n"],"mappings":";AAAA,MAAa,MAAM,KAAK,KAAK;AAC7B,MAAa,MAAM,MAAQ,KAAK;;;;ACAhC,MAAM,wBACJ,SACA,UAAkB,GAClB,UAAkB,GAClB,MAAc,GACd,OAAe,MACJ;AACX,QACE,UACA,UAAU,KACV,UAAW,OACX,OAAO,OAAc,OACrB,QAAQ,OAAc;;AAc1B,MAAMA,eAA6B;CAEjC,sBAAsB;EACpB,qBAAqB,IAAI,IAAI,OAAO;EACpC,CAAC,qBAAqB,GAAG,GAAG,QAAQ;EACpC,CAAC,qBAAqB,GAAG,GAAG,KAAK;EACjC,qBAAqB,GAAG,GAAG,QAAQ;EACnC,CAAC,qBAAqB,GAAG,GAAG,MAAM;EAClC,CAAC,qBAAqB,GAAG,GAAG,OAAO;EACnC,CAAC,qBAAqB,GAAG,GAAG,MAAM;EAClC,qBAAqB,GAAG,GAAG,KAAK;EAChC,qBAAqB,GAAG,GAAG,MAAM;EACjC,qBAAqB,GAAG,GAAG,KAAK;EAChC,qBAAqB,GAAG,GAAG,KAAK;EACjC,CAAC,KAAK,QAAQ,UAAU;AACvB,SAAO,SAAS,KAAK,IAAI,KAAM,MAAM;GACrC;CAEF,cAAc;EAAC;EAAsB;EAA0B;EAAuB;EAAW;CAEjG,gBAAgB;EAAC;EAAW;EAAa;EAAU;CAEnD,kBAAkB,CAAC,MAAM;CAEzB,gBAAgB;EAAC;EAAa;EAAiB;EAAY,IAAI,SAAW,IAAI;EAAW;CAEzF,WAAW;EAAC;EAAY;EAAe;EAAW,IAAI;EAAU,KAAK;EAAW;CAEhF,cAAc;EAAC;EAAW;EAAc;EAAY,KAAK;EAAS,IAAI;EAAW;C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