@neaps/tide-predictor 0.0.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -48
- package/dist/index.cjs +931 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +150 -0
- package/dist/index.d.ts +150 -0
- package/dist/index.js +930 -0
- package/dist/index.js.map +1 -0
- package/package.json +20 -36
- package/.eslintrc.js +0 -22
- package/.github/workflows/test.yml +0 -15
- package/.prettierrc +0 -4
- package/Gruntfile.js +0 -87
- package/LICENSE +0 -21
- package/babel.config.js +0 -9
- package/dist/tide-predictor.js +0 -1013
- package/examples/browser/index.html +0 -51
- package/jest.config.js +0 -14
- package/lib/astronomy/coefficients.js +0 -31
- package/lib/astronomy/constants.js +0 -10
- package/lib/astronomy/index.js +0 -199
- package/lib/constituents/compound-constituent.js +0 -67
- package/lib/constituents/constituent.js +0 -74
- package/lib/constituents/index.js +0 -140
- package/lib/harmonics/index.js +0 -113
- package/lib/harmonics/prediction.js +0 -195
- package/lib/index.es6.js +0 -1005
- package/lib/index.js +0 -53
- package/lib/node-corrections/index.js +0 -147
- package/rollup.config.js +0 -21
- package/src/__mocks__/constituents.js +0 -335
- package/src/__mocks__/secondary-station.js +0 -11
- package/src/__tests__/index.js +0 -81
- package/src/__tests__/noaa.js +0 -92
- package/src/astronomy/__tests__/coefficients.js +0 -12
- package/src/astronomy/__tests__/index.js +0 -96
- package/src/astronomy/coefficients.js +0 -72
- package/src/astronomy/constants.js +0 -4
- package/src/astronomy/index.js +0 -201
- package/src/constituents/__tests__/compound-constituent.js +0 -44
- package/src/constituents/__tests__/constituent.js +0 -65
- package/src/constituents/__tests__/index.js +0 -34
- package/src/constituents/compound-constituent.js +0 -55
- package/src/constituents/constituent.js +0 -74
- package/src/constituents/index.js +0 -119
- package/src/harmonics/__mocks__/water-levels.js +0 -0
- package/src/harmonics/__tests__/index.js +0 -123
- package/src/harmonics/__tests__/prediction.js +0 -148
- package/src/harmonics/index.js +0 -87
- package/src/harmonics/prediction.js +0 -175
- package/src/index.js +0 -45
- package/src/node-corrections/__tests__/index.js +0 -114
- package/src/node-corrections/index.js +0 -208
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["coefficients: Coefficients","result: number[]","modulus","result: any","polynomials: Record<string, number[]>","coefficients","functions: Record<\n string,\n (N: number, i: number, omega: number) => number\n >","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>[]","uItem: Record<string, number>","fItem: Record<string, number>","corrections: NodeCorrections","results: number[]","astro","coefficients","constituent: Constituent","nodeCorrections","coefficients: number[]","coefficients","compoundConstituent: CompoundConstituent","astro","f: number[]","constituents: Partial<Constituents>","constituent","nc","compoundConstituent","items: Date[]","hours: number[]","constituents: InternalHarmonicConstituent[]","constituentModels","harmonics: Harmonics","prediction","constituents","harmonics"],"sources":["../src/astronomy/constants.ts","../src/astronomy/coefficients.ts","../src/astronomy/index.ts","../src/harmonics/prediction.ts","../src/node-corrections/index.ts","../src/constituents/constituent.ts","../src/constituents/compound-constituent.ts","../src/constituents/index.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: [\n 280.46645 - 357.5291,\n 36000.76932 - 35999.0503,\n 0.0003032 + 0.0001559,\n 0.00000048\n ],\n\n solarLongitude: [280.46645, 36000.76983, 0.0003032],\n\n lunarInclination: [5.145],\n\n lunarLongitude: [\n 218.3164591,\n 481267.88134236,\n -0.0013268,\n 1 / 538841.0 - 1 / 65194000.0\n ],\n\n lunarNode: [\n 125.044555,\n -1934.1361849,\n 0.0020762,\n 1 / 467410.0,\n -1 / 60616000.0\n ],\n\n lunarPerigee: [\n 83.353243,\n 4069.0137111,\n -0.0103238,\n -1 / 80053.0,\n 1 / 18999000.0\n ]\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 = (\n coefficients: number[],\n argument: number\n): 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.getFullYear()\n let M = t.getMonth() + 1\n const D =\n t.getDate() +\n t.getHours() / 24.0 +\n t.getMinutes() / (24.0 * 60.0) +\n t.getSeconds() / (24.0 * 60.0 * 60.0) +\n t.getMilliseconds() / (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 (\n Math.floor(365.25 * (Y + 4716)) +\n Math.floor(30.6001 * (M + 1)) +\n D +\n B -\n 1524.5\n )\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 =\n 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 =\n (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) *\n Math.tan(0.5 * N)\n let e2 =\n (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) *\n 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 =\n (Math.cos(0.5 * (omega - i)) / Math.cos(0.5 * (omega + i))) *\n Math.tan(0.5 * N)\n let e2 =\n (Math.sin(0.5 * (omega - i)) / Math.sin(0.5 * (omega + i))) *\n 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 *\n Math.atan(\n (Math.sin(2 * I) * Math.sin(nu)) /\n (Math.sin(2 * I) * Math.cos(nu) + 0.3347)\n )\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)) /\n (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<\n string,\n (N: number, i: number, omega: number) => number\n > = {\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(\n functionCall(result.N.value, result.i.value, result.omega.value),\n 360.0\n ),\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 astro from '../astronomy/index.js'\nimport { d2r } from '../astronomy/constants.js'\nimport type { Constituent } from '../constituents/constituent.js'\nimport type { CompoundConstituent } from '../constituents/compound-constituent.js'\n\nexport interface Timeline {\n items: Date[]\n hours: number[]\n}\n\nexport interface HarmonicConstituent {\n name: string\n amplitude: number\n // This needs refactored to support generics with the `phaseKey` option\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any\n}\n\nexport interface InternalHarmonicConstituent extends HarmonicConstituent {\n _phase: number\n _model: Constituent | CompoundConstituent\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 = (\n extreme: Extreme,\n offsets?: ExtremeOffsets\n): 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(\n extreme.time.getTime() + offsets.time.high * 60 * 1000\n )\n }\n if (extreme.low && offsets.time?.low) {\n extreme.time = new Date(\n extreme.time.getTime() + offsets.time.low * 60 * 1000\n )\n }\n return extreme\n}\n\nconst getExtremeLabel = (\n label: 'high' | 'low',\n highLowLabels?: ExtremeLabels\n): string => {\n if (\n typeof highLowLabels !== 'undefined' &&\n typeof highLowLabels[label] !== 'undefined'\n ) {\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: InternalHarmonicConstituent[]\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 value = constituent._model.value(baseAstro)\n const speed = constituent._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 constituentU = modulus(constituent._model.u(itemAstro), 360)\n\n uItem[constituent.name] = d2r * constituentU\n fItem[constituent.name] = modulus(constituent._model.f(itemAstro), 360)\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 { d2r, r2d } from '../astronomy/constants.js'\nimport type { AstroData } from '../astronomy/index.js'\n\nexport type NodeCorrectionFunction = (\n a: AstroData,\n ...args: unknown[]\n) => number\n\nexport interface NodeCorrections {\n fUnity: () => number\n fMm: (a: AstroData) => number\n fMf: (a: AstroData) => number\n fO1: (a: AstroData) => number\n fJ1: (a: AstroData) => number\n fOO1: (a: AstroData) => number\n fM2: (a: AstroData) => number\n fK1: (a: AstroData) => number\n fL2: (a: AstroData) => number\n fK2: (a: AstroData) => number\n fM1: (a: AstroData) => number\n fModd: (a: AstroData, n: number) => number\n uZero: () => number\n uMf: (a: AstroData) => number\n uO1: (a: AstroData) => number\n uJ1: (a: AstroData) => number\n uOO1: (a: AstroData) => number\n uM2: (a: AstroData) => number\n uK1: (a: AstroData) => number\n uL2: (a: AstroData) => number\n uK2: (a: AstroData) => number\n uM1: (a: AstroData) => number\n uModd: (a: AstroData, n: number) => number\n}\n\nconst corrections: NodeCorrections = {\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)) *\n (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) *\n Math.pow(Math.cos(0.5 * omega), 2) *\n 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 =\n 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) *\n Math.pow(Math.sin(0.5 * omega), 2) *\n 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 =\n 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 =\n 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) +\n 0.1689 * Math.sin(2 * I) * Math.cos(nu) +\n 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 =\n 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 *\n Math.cos(I) *\n Math.cos(2 * P) *\n 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(\n Math.sin(2 * P) /\n ((1 / 6.0) * Math.pow(Math.tan(0.5 * I), -2) - Math.cos(2 * P))\n )\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 =\n r2d *\n 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 nodeCorrections from '../node-corrections/index.js'\nimport type { AstroData } from '../astronomy/index.js'\nimport type { NodeCorrectionFunction } from '../node-corrections/index.js'\n\n/**\n * Computes the dot notation of two arrays\n */\nconst 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\nconst astronimicDoodsonNumber = (\n astro: AstroData\n): AstroData[keyof AstroData][] => {\n return [\n astro['T+h-s'],\n astro.s,\n astro.h,\n astro.p,\n astro.N,\n astro.pp,\n astro['90']\n ]\n}\n\nconst astronomicSpeed = (astro: AstroData): number[] => {\n const results: number[] = []\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.speed)\n })\n return results\n}\n\nconst astronomicValues = (astro: AstroData): number[] => {\n const results: number[] = []\n astronimicDoodsonNumber(astro).forEach((number) => {\n results.push(number.value)\n })\n return results\n}\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\nconst constituentFactory = (\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 const constituent: Constituent = {\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 return Object.freeze(constituent)\n}\n\nexport default constituentFactory\nexport { astronimicDoodsonNumber, astronomicSpeed, astronomicValues }\n","import type { Constituent } from './constituent.js'\nimport type { AstroData } from '../astronomy/index.js'\n\nexport interface ConstituentMember {\n constituent: Constituent\n factor: number\n}\n\nexport interface CompoundConstituent {\n name: string\n coefficients: number[]\n speed: (astro: AstroData) => number\n value: (astro: AstroData) => number\n u: (astro: AstroData) => number\n f: (astro: AstroData) => number\n}\n\nconst compoundConstituentFactory = (\n name: string,\n members: ConstituentMember[]\n): CompoundConstituent => {\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 const compoundConstituent: CompoundConstituent = {\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 return Object.freeze(compoundConstituent)\n}\n\nexport default compoundConstituentFactory\n","import constituent from './constituent.js'\nimport compoundConstituent from './compound-constituent.js'\nimport nc from '../node-corrections/index.js'\nimport type { Constituent } from './constituent.js'\nimport type { CompoundConstituent } from './compound-constituent.js'\n\nexport interface Constituents {\n Z0: Constituent\n SA: Constituent\n SSA: Constituent\n MM: Constituent\n MF: Constituent\n Q1: Constituent\n O1: Constituent\n K1: Constituent\n J1: Constituent\n M1: Constituent\n P1: Constituent\n S1: Constituent\n OO1: Constituent\n '2N2': Constituent\n N2: Constituent\n NU2: Constituent\n M2: Constituent\n LAM2: Constituent\n L2: Constituent\n T2: Constituent\n S2: Constituent\n R2: Constituent\n K2: Constituent\n M3: Constituent\n MSF: CompoundConstituent\n '2Q1': CompoundConstituent\n RHO: CompoundConstituent\n MU2: CompoundConstituent\n '2SM2': CompoundConstituent\n '2MK3': CompoundConstituent\n MK3: CompoundConstituent\n MN4: CompoundConstituent\n M4: CompoundConstituent\n MS4: CompoundConstituent\n S4: CompoundConstituent\n M6: CompoundConstituent\n S6: CompoundConstituent\n M8: CompoundConstituent\n [key: string]: Constituent | CompoundConstituent\n}\n\nconst constituents: Partial<Constituents> = {}\n\n// Long Term\nconstituents.Z0 = constituent('Z0', [0, 0, 0, 0, 0, 0, 0], nc.uZero, nc.fUnity)\nconstituents.SA = constituent('Sa', [0, 0, 1, 0, 0, 0, 0], nc.uZero, nc.fUnity)\nconstituents.SSA = constituent(\n 'Ssa',\n [0, 0, 2, 0, 0, 0, 0],\n nc.uZero,\n nc.fUnity\n)\nconstituents.MM = constituent('MM', [0, 1, 0, -1, 0, 0, 0], nc.uZero, nc.fMm)\nconstituents.MF = constituent('MF', [0, 2, 0, 0, 0, 0, 0], nc.uMf, nc.fMf)\n// Diurnals\nconstituents.Q1 = constituent('Q1', [1, -2, 0, 1, 0, 0, 1], nc.uO1, nc.fO1)\nconstituents.O1 = constituent('O1', [1, -1, 0, 0, 0, 0, 1], nc.uO1, nc.fO1)\nconstituents.K1 = constituent('K1', [1, 1, 0, 0, 0, 0, -1], nc.uK1, nc.fK1)\nconstituents.J1 = constituent('J1', [1, 2, 0, -1, 0, 0, -1], nc.uJ1, nc.fJ1)\nconstituents.M1 = constituent('M1', [1, 0, 0, 0, 0, 0, 1], nc.uM1, nc.fM1)\nconstituents.P1 = constituent('P1', [1, 1, -2, 0, 0, 0, 1], nc.uZero, nc.fUnity)\nconstituents.S1 = constituent('S1', [1, 1, -1, 0, 0, 0, 0], nc.uZero, nc.fUnity)\nconstituents.OO1 = constituent('OO1', [1, 3, 0, 0, 0, 0, -1], nc.uOO1, nc.fOO1)\n// Semi diurnals\nconstituents['2N2'] = constituent('2N2', [2, -2, 0, 2, 0, 0, 0], nc.uM2, nc.fM2)\nconstituents.N2 = constituent('N2', [2, -1, 0, 1, 0, 0, 0], nc.uM2, nc.fM2)\nconstituents.NU2 = constituent('NU2', [2, -1, 2, -1, 0, 0, 0], nc.uM2, nc.fM2)\nconstituents.M2 = constituent('M2', [2, 0, 0, 0, 0, 0, 0], nc.uM2, nc.fM2)\nconstituents.LAM2 = constituent('LAM2', [2, 1, -2, 1, 0, 0, 2], nc.uM2, nc.fM2)\nconstituents.L2 = constituent('L2', [2, 1, 0, -1, 0, 0, 2], nc.uL2, nc.fL2)\nconstituents.T2 = constituent('T2', [2, 2, -3, 0, 0, 1, 0], nc.uZero, nc.fUnity)\nconstituents.S2 = constituent('S2', [2, 2, -2, 0, 0, 0, 0], nc.uZero, nc.fUnity)\nconstituents.R2 = constituent(\n 'R2',\n [2, 2, -1, 0, 0, -1, 2],\n nc.uZero,\n nc.fUnity\n)\nconstituents.K2 = constituent('K2', [2, 2, 0, 0, 0, 0, 0], nc.uK2, nc.fK2)\n// Third diurnal\nconstituents.M3 = constituent(\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// Compound\nconstituents.MSF = compoundConstituent('MSF', [\n { constituent: constituents.S2!, factor: 1 },\n { constituent: constituents.M2!, factor: -1 }\n])\n\n// Diurnal\nconstituents['2Q1'] = compoundConstituent('2Q1', [\n { constituent: constituents.N2!, factor: 1 },\n { constituent: constituents.J1!, factor: -1 }\n])\nconstituents.RHO = compoundConstituent('RHO', [\n { constituent: constituents.NU2!, factor: 1 },\n { constituent: constituents.K1!, factor: -1 }\n])\n\n// Semi-Diurnal\n\nconstituents.MU2 = compoundConstituent('MU2', [\n { constituent: constituents.M2!, factor: 2 },\n { constituent: constituents.S2!, factor: -1 }\n])\nconstituents['2SM2'] = compoundConstituent('2SM2', [\n { constituent: constituents.S2!, factor: 2 },\n { constituent: constituents.M2!, factor: -1 }\n])\n\n// Third-Diurnal\nconstituents['2MK3'] = compoundConstituent('2MK3', [\n { constituent: constituents.M2!, factor: 1 },\n { constituent: constituents.O1!, factor: 1 }\n])\nconstituents.MK3 = compoundConstituent('MK3', [\n { constituent: constituents.M2!, factor: 1 },\n { constituent: constituents.K1!, factor: 1 }\n])\n\n// Quarter-Diurnal\nconstituents.MN4 = compoundConstituent('MN4', [\n { constituent: constituents.M2!, factor: 1 },\n { constituent: constituents.N2!, factor: 1 }\n])\nconstituents.M4 = compoundConstituent('M4', [\n { constituent: constituents.M2!, factor: 2 }\n])\nconstituents.MS4 = compoundConstituent('MS4', [\n { constituent: constituents.M2!, factor: 1 },\n { constituent: constituents.S2!, factor: 1 }\n])\nconstituents.S4 = compoundConstituent('S4', [\n { constituent: constituents.S2!, factor: 2 }\n])\n\n// Sixth-Diurnal\nconstituents.M6 = compoundConstituent('M6', [\n { constituent: constituents.M2!, factor: 3 }\n])\nconstituents.S6 = compoundConstituent('S6', [\n { constituent: constituents.S2!, factor: 3 }\n])\n\n// Eighth-Diurnals\nconstituents.M8 = compoundConstituent('M8', [\n { constituent: constituents.M2!, factor: 4 }\n])\n\nexport default constituents as Constituents\n","import prediction from './prediction.js'\nimport constituentModels from '../constituents/index.js'\nimport { d2r } from '../astronomy/constants.js'\nimport type {\n HarmonicConstituent,\n InternalHarmonicConstituent,\n Prediction\n} from './prediction.js'\n\nexport type * from './prediction.js'\n\nexport interface HarmonicsOptions {\n harmonicConstituents: HarmonicConstituent[]\n phaseKey: string\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 = ({\n harmonicConstituents,\n phaseKey,\n offset\n}: HarmonicsOptions): Harmonics => {\n if (!Array.isArray(harmonicConstituents)) {\n throw new Error('Harmonic constituents are not an array')\n }\n const constituents: InternalHarmonicConstituent[] = []\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 _model: constituentModels[constituent.name],\n _phase: d2r * constituent[phaseKey]\n })\n }\n })\n\n if (offset !== false) {\n constituents.push({\n name: 'Z0',\n _model: constituentModels.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 = (\n startTime: Date | number,\n endTime: Date | number\n ): 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 =\n 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 {\n TimelinePoint,\n Extreme,\n ExtremeOffsets\n} from './harmonics/prediction.js'\n\nexport interface TidePredictionOptions {\n phaseKey?: string\n offset?: number | false\n}\n\nexport interface TimeSpan {\n start: Date\n end: Date\n}\n\nexport interface ExtremesInput extends TimeSpan {\n labels?: {\n high?: string\n low?: string\n }\n offsets?: ExtremeOffsets\n timeFidelity?: number\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 phaseKey: 'phase_GMT',\n offset: false as number | false,\n ...options\n }\n\n const tidePrediction: TidePrediction = {\n getTimelinePrediction: ({ start, end }: TimeSpan): TimelinePoint[] => {\n return harmonics(harmonicsOptions)\n .setTimeSpan(start, end)\n .prediction()\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;EACZ;EACA;EACA;EACA;EACD;CAED,gBAAgB;EAAC;EAAW;EAAa;EAAU;CAEnD,kBAAkB,CAAC,MAAM;CAEzB,gBAAgB;EACd;EACA;EACA;EACA,IAAI,SA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
interface AstroValue {
|
|
3
|
+
value: number;
|
|
4
|
+
speed: number;
|
|
5
|
+
}
|
|
6
|
+
interface AstroData {
|
|
7
|
+
s: AstroValue;
|
|
8
|
+
h: AstroValue;
|
|
9
|
+
p: AstroValue;
|
|
10
|
+
N: AstroValue;
|
|
11
|
+
pp: AstroValue;
|
|
12
|
+
'90': AstroValue;
|
|
13
|
+
omega: AstroValue;
|
|
14
|
+
i: AstroValue;
|
|
15
|
+
I: AstroValue;
|
|
16
|
+
xi: AstroValue;
|
|
17
|
+
nu: AstroValue;
|
|
18
|
+
nup: AstroValue;
|
|
19
|
+
nupp: AstroValue;
|
|
20
|
+
'T+h-s': AstroValue;
|
|
21
|
+
P: AstroValue;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/node-corrections/index.d.ts
|
|
25
|
+
type NodeCorrectionFunction = (a: AstroData, ...args: unknown[]) => number;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/constituents/constituent.d.ts
|
|
28
|
+
interface Constituent {
|
|
29
|
+
name: string;
|
|
30
|
+
coefficients: number[];
|
|
31
|
+
value: (astro: AstroData) => number;
|
|
32
|
+
speed: (astro: AstroData) => number;
|
|
33
|
+
u: NodeCorrectionFunction;
|
|
34
|
+
f: NodeCorrectionFunction;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/constituents/compound-constituent.d.ts
|
|
38
|
+
interface CompoundConstituent {
|
|
39
|
+
name: string;
|
|
40
|
+
coefficients: number[];
|
|
41
|
+
speed: (astro: AstroData) => number;
|
|
42
|
+
value: (astro: AstroData) => number;
|
|
43
|
+
u: (astro: AstroData) => number;
|
|
44
|
+
f: (astro: AstroData) => number;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/constituents/index.d.ts
|
|
48
|
+
interface Constituents {
|
|
49
|
+
Z0: Constituent;
|
|
50
|
+
SA: Constituent;
|
|
51
|
+
SSA: Constituent;
|
|
52
|
+
MM: Constituent;
|
|
53
|
+
MF: Constituent;
|
|
54
|
+
Q1: Constituent;
|
|
55
|
+
O1: Constituent;
|
|
56
|
+
K1: Constituent;
|
|
57
|
+
J1: Constituent;
|
|
58
|
+
M1: Constituent;
|
|
59
|
+
P1: Constituent;
|
|
60
|
+
S1: Constituent;
|
|
61
|
+
OO1: Constituent;
|
|
62
|
+
'2N2': Constituent;
|
|
63
|
+
N2: Constituent;
|
|
64
|
+
NU2: Constituent;
|
|
65
|
+
M2: Constituent;
|
|
66
|
+
LAM2: Constituent;
|
|
67
|
+
L2: Constituent;
|
|
68
|
+
T2: Constituent;
|
|
69
|
+
S2: Constituent;
|
|
70
|
+
R2: Constituent;
|
|
71
|
+
K2: Constituent;
|
|
72
|
+
M3: Constituent;
|
|
73
|
+
MSF: CompoundConstituent;
|
|
74
|
+
'2Q1': CompoundConstituent;
|
|
75
|
+
RHO: CompoundConstituent;
|
|
76
|
+
MU2: CompoundConstituent;
|
|
77
|
+
'2SM2': CompoundConstituent;
|
|
78
|
+
'2MK3': CompoundConstituent;
|
|
79
|
+
MK3: CompoundConstituent;
|
|
80
|
+
MN4: CompoundConstituent;
|
|
81
|
+
M4: CompoundConstituent;
|
|
82
|
+
MS4: CompoundConstituent;
|
|
83
|
+
S4: CompoundConstituent;
|
|
84
|
+
M6: CompoundConstituent;
|
|
85
|
+
S6: CompoundConstituent;
|
|
86
|
+
M8: CompoundConstituent;
|
|
87
|
+
[key: string]: Constituent | CompoundConstituent;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/harmonics/prediction.d.ts
|
|
91
|
+
interface HarmonicConstituent {
|
|
92
|
+
name: string;
|
|
93
|
+
amplitude: number;
|
|
94
|
+
[key: string]: any;
|
|
95
|
+
}
|
|
96
|
+
interface TimelinePoint {
|
|
97
|
+
time: Date;
|
|
98
|
+
hour: number;
|
|
99
|
+
level: number;
|
|
100
|
+
}
|
|
101
|
+
interface Extreme {
|
|
102
|
+
time: Date;
|
|
103
|
+
level: number;
|
|
104
|
+
high: boolean;
|
|
105
|
+
low: boolean;
|
|
106
|
+
label: string;
|
|
107
|
+
}
|
|
108
|
+
interface ExtremeOffsets {
|
|
109
|
+
height?: {
|
|
110
|
+
high?: number;
|
|
111
|
+
low?: number;
|
|
112
|
+
type?: 'fixed' | 'ratio';
|
|
113
|
+
};
|
|
114
|
+
time?: {
|
|
115
|
+
high?: number;
|
|
116
|
+
low?: number;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/index.d.ts
|
|
121
|
+
interface TidePredictionOptions {
|
|
122
|
+
phaseKey?: string;
|
|
123
|
+
offset?: number | false;
|
|
124
|
+
}
|
|
125
|
+
interface TimeSpan {
|
|
126
|
+
start: Date;
|
|
127
|
+
end: Date;
|
|
128
|
+
}
|
|
129
|
+
interface ExtremesInput extends TimeSpan {
|
|
130
|
+
labels?: {
|
|
131
|
+
high?: string;
|
|
132
|
+
low?: string;
|
|
133
|
+
};
|
|
134
|
+
offsets?: ExtremeOffsets;
|
|
135
|
+
timeFidelity?: number;
|
|
136
|
+
}
|
|
137
|
+
interface TidePrediction {
|
|
138
|
+
getTimelinePrediction: (params: TimeSpan) => TimelinePoint[];
|
|
139
|
+
getExtremesPrediction: (params: ExtremesInput) => Extreme[];
|
|
140
|
+
getWaterLevelAtTime: (params: {
|
|
141
|
+
time: Date;
|
|
142
|
+
}) => TimelinePoint;
|
|
143
|
+
}
|
|
144
|
+
declare const tidePredictionFactory: {
|
|
145
|
+
(constituents: HarmonicConstituent[], options?: TidePredictionOptions): TidePrediction;
|
|
146
|
+
constituents: Constituents;
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { type Extreme, ExtremesInput, type HarmonicConstituent, TidePrediction, TidePredictionOptions, TimeSpan, type TimelinePoint, tidePredictionFactory as default };
|
|
150
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
//#region src/astronomy/index.d.ts
|
|
2
|
+
interface AstroValue {
|
|
3
|
+
value: number;
|
|
4
|
+
speed: number;
|
|
5
|
+
}
|
|
6
|
+
interface AstroData {
|
|
7
|
+
s: AstroValue;
|
|
8
|
+
h: AstroValue;
|
|
9
|
+
p: AstroValue;
|
|
10
|
+
N: AstroValue;
|
|
11
|
+
pp: AstroValue;
|
|
12
|
+
'90': AstroValue;
|
|
13
|
+
omega: AstroValue;
|
|
14
|
+
i: AstroValue;
|
|
15
|
+
I: AstroValue;
|
|
16
|
+
xi: AstroValue;
|
|
17
|
+
nu: AstroValue;
|
|
18
|
+
nup: AstroValue;
|
|
19
|
+
nupp: AstroValue;
|
|
20
|
+
'T+h-s': AstroValue;
|
|
21
|
+
P: AstroValue;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/node-corrections/index.d.ts
|
|
25
|
+
type NodeCorrectionFunction = (a: AstroData, ...args: unknown[]) => number;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/constituents/constituent.d.ts
|
|
28
|
+
interface Constituent {
|
|
29
|
+
name: string;
|
|
30
|
+
coefficients: number[];
|
|
31
|
+
value: (astro: AstroData) => number;
|
|
32
|
+
speed: (astro: AstroData) => number;
|
|
33
|
+
u: NodeCorrectionFunction;
|
|
34
|
+
f: NodeCorrectionFunction;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/constituents/compound-constituent.d.ts
|
|
38
|
+
interface CompoundConstituent {
|
|
39
|
+
name: string;
|
|
40
|
+
coefficients: number[];
|
|
41
|
+
speed: (astro: AstroData) => number;
|
|
42
|
+
value: (astro: AstroData) => number;
|
|
43
|
+
u: (astro: AstroData) => number;
|
|
44
|
+
f: (astro: AstroData) => number;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/constituents/index.d.ts
|
|
48
|
+
interface Constituents {
|
|
49
|
+
Z0: Constituent;
|
|
50
|
+
SA: Constituent;
|
|
51
|
+
SSA: Constituent;
|
|
52
|
+
MM: Constituent;
|
|
53
|
+
MF: Constituent;
|
|
54
|
+
Q1: Constituent;
|
|
55
|
+
O1: Constituent;
|
|
56
|
+
K1: Constituent;
|
|
57
|
+
J1: Constituent;
|
|
58
|
+
M1: Constituent;
|
|
59
|
+
P1: Constituent;
|
|
60
|
+
S1: Constituent;
|
|
61
|
+
OO1: Constituent;
|
|
62
|
+
'2N2': Constituent;
|
|
63
|
+
N2: Constituent;
|
|
64
|
+
NU2: Constituent;
|
|
65
|
+
M2: Constituent;
|
|
66
|
+
LAM2: Constituent;
|
|
67
|
+
L2: Constituent;
|
|
68
|
+
T2: Constituent;
|
|
69
|
+
S2: Constituent;
|
|
70
|
+
R2: Constituent;
|
|
71
|
+
K2: Constituent;
|
|
72
|
+
M3: Constituent;
|
|
73
|
+
MSF: CompoundConstituent;
|
|
74
|
+
'2Q1': CompoundConstituent;
|
|
75
|
+
RHO: CompoundConstituent;
|
|
76
|
+
MU2: CompoundConstituent;
|
|
77
|
+
'2SM2': CompoundConstituent;
|
|
78
|
+
'2MK3': CompoundConstituent;
|
|
79
|
+
MK3: CompoundConstituent;
|
|
80
|
+
MN4: CompoundConstituent;
|
|
81
|
+
M4: CompoundConstituent;
|
|
82
|
+
MS4: CompoundConstituent;
|
|
83
|
+
S4: CompoundConstituent;
|
|
84
|
+
M6: CompoundConstituent;
|
|
85
|
+
S6: CompoundConstituent;
|
|
86
|
+
M8: CompoundConstituent;
|
|
87
|
+
[key: string]: Constituent | CompoundConstituent;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/harmonics/prediction.d.ts
|
|
91
|
+
interface HarmonicConstituent {
|
|
92
|
+
name: string;
|
|
93
|
+
amplitude: number;
|
|
94
|
+
[key: string]: any;
|
|
95
|
+
}
|
|
96
|
+
interface TimelinePoint {
|
|
97
|
+
time: Date;
|
|
98
|
+
hour: number;
|
|
99
|
+
level: number;
|
|
100
|
+
}
|
|
101
|
+
interface Extreme {
|
|
102
|
+
time: Date;
|
|
103
|
+
level: number;
|
|
104
|
+
high: boolean;
|
|
105
|
+
low: boolean;
|
|
106
|
+
label: string;
|
|
107
|
+
}
|
|
108
|
+
interface ExtremeOffsets {
|
|
109
|
+
height?: {
|
|
110
|
+
high?: number;
|
|
111
|
+
low?: number;
|
|
112
|
+
type?: 'fixed' | 'ratio';
|
|
113
|
+
};
|
|
114
|
+
time?: {
|
|
115
|
+
high?: number;
|
|
116
|
+
low?: number;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/index.d.ts
|
|
121
|
+
interface TidePredictionOptions {
|
|
122
|
+
phaseKey?: string;
|
|
123
|
+
offset?: number | false;
|
|
124
|
+
}
|
|
125
|
+
interface TimeSpan {
|
|
126
|
+
start: Date;
|
|
127
|
+
end: Date;
|
|
128
|
+
}
|
|
129
|
+
interface ExtremesInput extends TimeSpan {
|
|
130
|
+
labels?: {
|
|
131
|
+
high?: string;
|
|
132
|
+
low?: string;
|
|
133
|
+
};
|
|
134
|
+
offsets?: ExtremeOffsets;
|
|
135
|
+
timeFidelity?: number;
|
|
136
|
+
}
|
|
137
|
+
interface TidePrediction {
|
|
138
|
+
getTimelinePrediction: (params: TimeSpan) => TimelinePoint[];
|
|
139
|
+
getExtremesPrediction: (params: ExtremesInput) => Extreme[];
|
|
140
|
+
getWaterLevelAtTime: (params: {
|
|
141
|
+
time: Date;
|
|
142
|
+
}) => TimelinePoint;
|
|
143
|
+
}
|
|
144
|
+
declare const tidePredictionFactory: {
|
|
145
|
+
(constituents: HarmonicConstituent[], options?: TidePredictionOptions): TidePrediction;
|
|
146
|
+
constituents: Constituents;
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { type Extreme, ExtremesInput, type HarmonicConstituent, TidePrediction, TidePredictionOptions, TimeSpan, type TimelinePoint, tidePredictionFactory as default };
|
|
150
|
+
//# sourceMappingURL=index.d.ts.map
|