@zodiacs/engine 0.1.1-rc.16 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1478 -0
- package/LICENSING.md +184 -30
- package/NOTICE +81 -14
- package/README.md +345 -67
- package/dist/{api-VOW6Umy5.d.ts → api-ChL1N2Sr.d.ts} +44 -7
- package/dist/ayanamsa-ClFzkKmV.d.ts +135 -0
- package/dist/calc.d.ts +218 -21
- package/dist/calc.js +580 -160
- package/dist/chunk-2PZYJQV5.js +83 -0
- package/dist/chunk-47ERTK5X.js +27 -0
- package/dist/{chunk-O3NJRGJ2.js → chunk-4XOYTBLS.js} +1 -1
- package/dist/chunk-767FTO7O.js +48 -0
- package/dist/{chunk-N4B5JNMA.js → chunk-7Y2F2IWN.js} +40 -28
- package/dist/chunk-B4M2Y7FT.js +96 -0
- package/dist/{chunk-KHBLFXFG.js → chunk-B5LKF437.js} +29 -28
- package/dist/{chunk-ONBZ4HK7.js → chunk-BHJXUY67.js} +4 -2
- package/dist/{chunk-PFGUCNOK.js → chunk-BMDASNPB.js} +6 -6
- package/dist/chunk-I3L4POY7.js +18 -0
- package/dist/{chunk-I7O5EGFV.js → chunk-LNGURVNH.js} +3 -3
- package/dist/{chunk-4NV4ZEFZ.js → chunk-NNOSOOWS.js} +4 -4
- package/dist/chunk-OVXQQEXL.js +41 -0
- package/dist/{chunk-WOU7JVD3.js → chunk-QLIEEICB.js} +205 -194
- package/dist/chunk-RMBWKZI2.js +130 -0
- package/dist/{chunk-AECKV73C.js → chunk-TSS2SZWQ.js} +8 -2
- package/dist/{chunk-L6ZHWJZ6.js → chunk-TZVPZHZM.js} +51 -29
- package/dist/chunk-WBTWY2OB.js +478 -0
- package/dist/chunk-Y4E3WJU5.js +87 -0
- package/dist/chunk-YPU3MDNI.js +852 -0
- package/dist/conventions.d.ts +70 -0
- package/dist/conventions.js +26 -0
- package/dist/crossings.d.ts +22 -10
- package/dist/crossings.js +1 -1
- package/dist/de440-pack.d.ts +43 -0
- package/dist/de440-pack.js +16 -0
- package/dist/de440.d.ts +113 -0
- package/dist/de440.js +19 -0
- package/dist/deltat.d.ts +28 -3
- package/dist/deltat.js +1 -1
- package/dist/ephemeris-exTSqBgb.d.ts +60 -0
- package/dist/geo.d.ts +46 -13
- package/dist/geo.js +4 -2
- package/dist/{houses-q1O2GGp4.d.ts → houses-Bh7GCnPi.d.ts} +14 -4
- package/dist/houses-extra.d.ts +22 -7
- package/dist/houses-extra.js +4 -2
- package/dist/index.d.ts +36 -49
- package/dist/index.js +54 -34
- package/dist/{internal-math-CmJ9xtaW.d.ts → internal-math-CxenuGfm.d.ts} +41 -27
- package/dist/internal-math.d.ts +4 -3
- package/dist/internal-math.js +14 -12
- package/dist/internal.d.ts +16 -7
- package/dist/internal.js +27 -6
- package/dist/lite-composite.js +114 -0
- package/dist/lite-declinations.js +253 -0
- package/dist/lite-dignities.js +333 -0
- package/dist/lite-sect.js +72 -0
- package/dist/lite.d.ts +82 -0
- package/dist/lite.js +4 -0
- package/dist/receipt.d.ts +3 -268
- package/dist/receipt.js +202 -89
- package/dist/reference-span-CILpclrz.d.ts +40 -0
- package/dist/{rulers-9wljfVaO.d.ts → rulers-CSSWtiWF.d.ts} +7 -2
- package/dist/sky.d.ts +26 -10
- package/dist/sky.js +23 -14
- package/dist/techniques.d.ts +160 -21
- package/dist/techniques.js +157 -89
- package/dist/time-bands-CZA9AlLg.d.ts +36 -0
- package/dist/time-scale-DIFNa0gz.d.ts +47 -0
- package/dist/time.d.ts +81 -0
- package/dist/time.js +74 -0
- package/dist/timing.d.ts +55 -17
- package/dist/timing.js +33 -45
- package/dist/types-DpPdtXgO.d.ts +335 -0
- package/dist/vedic.d.ts +150 -123
- package/dist/vedic.js +398 -440
- package/dist/window.d.ts +102 -80
- package/dist/window.js +108 -51
- package/dist/zone-history-BxmDCcTK.d.ts +290 -0
- package/package.json +26 -3
- package/dist/chunk-2OWGBT3O.js +0 -219
- package/dist/types-B4MCoCCS.d.ts +0 -228
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { DeltaT } from './deltat.js';
|
|
2
|
-
import { B as BodyName,
|
|
2
|
+
import { E as EphemerisFallback, B as BodyName, e as DateInput, d as Chart, h as BirthInput, i as ChartPoints, M as MoonPhase, c as BodyPosition, S as SynastryResult, T as TransitResult } from './types-DpPdtXgO.js';
|
|
3
3
|
import { LongitudeCrossing, CrossingSearchOptions, CrossingSearchResult } from './crossings.js';
|
|
4
4
|
|
|
5
5
|
/** Geometry over full ecliptic positions; no independent ephemeris is implied. */
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Site-compatible maximum orb, in degrees, for a pair without Sun or Moon.
|
|
9
|
+
* @deprecated The same value as DEFAULT_DECLINATION_ORB_POLICY.orb; use that.
|
|
10
|
+
*/
|
|
8
11
|
declare const DECLINATION_ORB = 1;
|
|
9
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Site-compatible maximum orb when either identifier is exactly Sun or Moon.
|
|
14
|
+
* @deprecated The same value as DEFAULT_DECLINATION_ORB_POLICY.luminaryOrb; use that.
|
|
15
|
+
*/
|
|
10
16
|
declare const DECLINATION_ORB_LUMINARY = 1.5;
|
|
11
17
|
interface DeclinationOrbPolicy {
|
|
12
18
|
/** Inclusive maximum difference in degrees for an ordinary pair. */
|
|
@@ -102,10 +108,25 @@ interface Declinations {
|
|
|
102
108
|
receiptScope: "not-included-in-natal-receipt";
|
|
103
109
|
}
|
|
104
110
|
interface ChartDeclinations extends Declinations {
|
|
105
|
-
/**
|
|
111
|
+
/** The chart's instant as given, ISO 8601, on the scale its `input.timeScale` names, as ChartInput.utc. */
|
|
106
112
|
utc: string;
|
|
107
113
|
/** The evaluated provider Delta-T used to obtain true obliquity. */
|
|
108
114
|
deltaT: DeltaT;
|
|
115
|
+
/**
|
|
116
|
+
* From 1.1.0-rc.12: the ephemeris of the chart the rows were derived from,
|
|
117
|
+
* its own `ephemeris`; null for a supplied chart that names none (one from
|
|
118
|
+
* 1.1.0-rc.9 or earlier).
|
|
119
|
+
*/
|
|
120
|
+
ephemeris: {
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly version: string;
|
|
123
|
+
} | null;
|
|
124
|
+
/**
|
|
125
|
+
* From 1.1.0-rc.12: the chart's fallback flags (`EphemerisFallback`): where
|
|
126
|
+
* its bodies are astronomy-engine's as a fallback from the shipped pack,
|
|
127
|
+
* the rows are too, and say so here.
|
|
128
|
+
*/
|
|
129
|
+
flags: EphemerisFallback[];
|
|
109
130
|
}
|
|
110
131
|
/**
|
|
111
132
|
* Rotate full ecliptic longitude/latitude into the equator associated with the
|
|
@@ -139,6 +160,19 @@ interface SaturnReturnResult {
|
|
|
139
160
|
natalLon: number;
|
|
140
161
|
natalRetrograde: boolean;
|
|
141
162
|
seasons: ReturnSeason[];
|
|
163
|
+
/**
|
|
164
|
+
* The ephemeris the result's positions came from, as a BodyPosition names it; set by `saturnReturn` from
|
|
165
|
+
* 1.1.0-rc.10. From 1.1.0-rc.12 it is astronomy-engine wherever `flags` holds a fallback, a search that ran
|
|
166
|
+
* past an end of the shipped DE440 pack included; in rc.10 and rc.11 it named natal Saturn's ephemeris there.
|
|
167
|
+
*/
|
|
168
|
+
ephemeris?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Each kind of fallback from the shipped DE440 pack to astronomy-engine
|
|
171
|
+
* that the natal position or the search to about age 92 met, or none: a
|
|
172
|
+
* search that runs past the pack's last year reports `"outside-de440-span"`.
|
|
173
|
+
* Set by `saturnReturn` from 1.1.0-rc.10.
|
|
174
|
+
*/
|
|
175
|
+
flags?: EphemerisFallback[];
|
|
142
176
|
}
|
|
143
177
|
/**
|
|
144
178
|
* Every instant in (from, to] when `body` sits exactly on `targetLongitude`,
|
|
@@ -150,14 +184,17 @@ interface SaturnReturnResult {
|
|
|
150
184
|
* sample budget; {@link searchLongitudeCrossings} takes one and refuses
|
|
151
185
|
* instead of throwing. Invalid input throws RangeError.
|
|
152
186
|
*/
|
|
153
|
-
declare function findLongitudeCrossings(body: BodyName, targetLongitude: number, from:
|
|
187
|
+
declare function findLongitudeCrossings(body: BodyName, targetLongitude: number, from: DateInput, to: DateInput, stepDays?: number): LongitudeCrossing[];
|
|
154
188
|
/**
|
|
155
189
|
* {@link findLongitudeCrossings} under an optional budget of ephemeris
|
|
156
190
|
* evaluations, `maxSamples`, with the step as `stepDays` (default 5). Over
|
|
157
191
|
* budget, it returns `{ status: "refused", reason: "sample-budget" }` with no
|
|
158
|
-
* crossings rather than throwing.
|
|
192
|
+
* crossings rather than throwing. A complete result carries `flags`: each
|
|
193
|
+
* kind of fallback from the shipped DE440 pack to astronomy-engine that a
|
|
194
|
+
* longitude of the search met (`EphemerisFallback`), or none.
|
|
195
|
+
* `findLongitudeCrossings` returns the bare crossings and cannot say.
|
|
159
196
|
*/
|
|
160
|
-
declare function searchLongitudeCrossings(body: BodyName, targetLongitude: number, from:
|
|
197
|
+
declare function searchLongitudeCrossings(body: BodyName, targetLongitude: number, from: DateInput, to: DateInput, options?: CrossingSearchOptions): CrossingSearchResult;
|
|
161
198
|
declare function groupIntoSeasons(crossings: readonly LongitudeCrossing[], gapDays?: number): ReturnSeason[];
|
|
162
199
|
|
|
163
200
|
type NatalSource = Chart | BirthInput;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { DeltaT } from './deltat.js';
|
|
2
|
+
import { a as TimeScaleName, T as TimeScale } from './time-scale-DIFNa0gz.js';
|
|
3
|
+
import { e as DateInput } from './types-DpPdtXgO.js';
|
|
4
|
+
|
|
5
|
+
/** The precession model of an epoch value: the engine's IAU 2006, Newcomb's (Kinoshita 1975) or IAU 1976. */
|
|
6
|
+
type AyanamsaPrecessionModel = "engine" | "newcomb" | "iau1976";
|
|
7
|
+
/** The built-in ayanamsas: the keys of AYANAMSAS. */
|
|
8
|
+
type AyanamsaName = "lahiri" | "fagan-bradley" | "krishnamurti" | "raman" | "yukteswar" | "true-chitra" | "true-revati" | "true-pushya" | "galactic-center";
|
|
9
|
+
interface Definition {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** Short citation; docs/vedic.md has the full one. */
|
|
13
|
+
readonly source: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A mean `value` (degrees) at TT Julian date `epochTT`, computed with
|
|
17
|
+
* `model`'s precession. The engine holds the zodiac where that model puts it
|
|
18
|
+
* at J2000.0 and carries it with its own; with an older model its value at
|
|
19
|
+
* the epoch differs from `value`.
|
|
20
|
+
*/
|
|
21
|
+
interface EpochAyanamsa extends Definition {
|
|
22
|
+
readonly kind: "epoch";
|
|
23
|
+
readonly epochTT: number;
|
|
24
|
+
readonly value: number;
|
|
25
|
+
readonly model: AyanamsaPrecessionModel;
|
|
26
|
+
}
|
|
27
|
+
/** `value` degrees at `epochTT` plus `rate` arcseconds per Julian year (365.25 days of TT). */
|
|
28
|
+
interface LinearAyanamsa extends Definition {
|
|
29
|
+
readonly kind: "linear";
|
|
30
|
+
readonly epochTT: number;
|
|
31
|
+
readonly value: number;
|
|
32
|
+
readonly rate: number;
|
|
33
|
+
}
|
|
34
|
+
/** A catalogue star, ICRS, with its space motion. */
|
|
35
|
+
interface CatalogueStar {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
/** Right ascension and declination at `epochTT`, degrees. */
|
|
38
|
+
readonly ra: number;
|
|
39
|
+
readonly dec: number;
|
|
40
|
+
readonly epochTT: number;
|
|
41
|
+
/** Proper motion, mas/yr; `pmRa` is μα·cos δ. */
|
|
42
|
+
readonly pmRa: number;
|
|
43
|
+
readonly pmDec: number;
|
|
44
|
+
/** Parallax, mas (0: at infinity). */
|
|
45
|
+
readonly parallax: number;
|
|
46
|
+
/** Radial velocity, km/s. */
|
|
47
|
+
readonly radialVelocity: number;
|
|
48
|
+
}
|
|
49
|
+
/** The star's apparent geocentric place sits at sidereal `longitude` degrees at every instant. */
|
|
50
|
+
interface StarAyanamsa extends Definition {
|
|
51
|
+
readonly kind: "star";
|
|
52
|
+
readonly star: CatalogueStar;
|
|
53
|
+
readonly longitude: number;
|
|
54
|
+
}
|
|
55
|
+
/** A definition; functions accept only AYANAMSAS entries and userAyanamsa results. */
|
|
56
|
+
type AyanamsaDefinition = EpochAyanamsa | LinearAyanamsa | StarAyanamsa;
|
|
57
|
+
/** The built-in definitions. docs/vedic.md cites each in full. */
|
|
58
|
+
declare const AYANAMSAS: Readonly<Record<AyanamsaName, AyanamsaDefinition>>;
|
|
59
|
+
/** Input to userAyanamsa. */
|
|
60
|
+
interface UserAyanamsaInput {
|
|
61
|
+
/** Lowercase identifier, at most 64 characters, not a built-in name; default "user". */
|
|
62
|
+
readonly name?: string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* When `value` holds: `{ julianDateTT }`, a TT Julian date within the Date
|
|
65
|
+
* range, or a UTC instant as a Date or an ISO 8601 string, read on the
|
|
66
|
+
* engine's time basis. A bare number is refused: it could be a Julian date
|
|
67
|
+
* or epoch milliseconds.
|
|
68
|
+
*/
|
|
69
|
+
readonly epoch: Date | string | {
|
|
70
|
+
readonly julianDateTT: number;
|
|
71
|
+
};
|
|
72
|
+
/** The mean ayanamsa at `epoch` as `model` computes it, degrees, in [−360, 360]. */
|
|
73
|
+
readonly value: number;
|
|
74
|
+
/** Arcseconds per Julian year, in [−3600, 3600]: a linear ayanamsa. */
|
|
75
|
+
readonly rate?: number | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Without `rate`: the model `value` was computed with, default "engine"
|
|
78
|
+
* (`value` then holds at `epoch`); an older model's zodiac is held at
|
|
79
|
+
* J2000.0, as for the built-ins.
|
|
80
|
+
*/
|
|
81
|
+
readonly model?: AyanamsaPrecessionModel | undefined;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A caller's ayanamsa, frozen. Refuses a key not named in UserAyanamsaInput, a
|
|
85
|
+
* built-in name, a bare-number epoch, both `rate` and `model`, and
|
|
86
|
+
* out-of-range values.
|
|
87
|
+
*/
|
|
88
|
+
declare function userAyanamsa(input: UserAyanamsaInput): AyanamsaDefinition;
|
|
89
|
+
/** An ayanamsa at an instant; made only by `ayanamsa`. Degrees throughout. */
|
|
90
|
+
interface AyanamsaValue {
|
|
91
|
+
/** The definition's name. */
|
|
92
|
+
readonly ayanamsa: string;
|
|
93
|
+
/**
|
|
94
|
+
* The instant as given, ISO 8601, on the scale `timeScale.input` names (UTC
|
|
95
|
+
* unless the options say otherwise), named as ChartInput.utc is: on UT1 or
|
|
96
|
+
* TT input it is that reading, with a Z. A SiderealLongitude made from this
|
|
97
|
+
* value has the UTC instant of the time basis in its own `utc`.
|
|
98
|
+
*/
|
|
99
|
+
readonly utc: string;
|
|
100
|
+
/** How the instant became UT1 and TT, as a chart's `timeScale` (docs/time.md). */
|
|
101
|
+
readonly timeScale: TimeScale;
|
|
102
|
+
readonly julianDateTT: number;
|
|
103
|
+
/** The ΔT (TT − UT1) the instant was read with: its time basis's, or the pin. */
|
|
104
|
+
readonly deltaT: DeltaT;
|
|
105
|
+
/** Referred to the mean equinox and ecliptic of date, in (−180, 180]. */
|
|
106
|
+
readonly mean: number;
|
|
107
|
+
/** The engine's nutation in longitude Δψ. */
|
|
108
|
+
readonly nutation: number;
|
|
109
|
+
/** mean + nutation: subtract it from the engine's tropical longitudes. */
|
|
110
|
+
readonly true: number;
|
|
111
|
+
/** "outside-reference-span" when the instant, or an epoch definition's epoch, is outside REFERENCE_SPAN. */
|
|
112
|
+
readonly flags: readonly AyanamsaFlag[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A flag on an ayanamsa's value. A minor release may add one, as for a
|
|
116
|
+
* chart's flags, so code that switches on a flag should handle one it does
|
|
117
|
+
* not know.
|
|
118
|
+
*/
|
|
119
|
+
type AyanamsaFlag = "outside-reference-span";
|
|
120
|
+
/** Options for ayanamsa. A key not named here is refused with a RangeError. */
|
|
121
|
+
interface AyanamsaOptions {
|
|
122
|
+
/** A fixed ΔT (TT − UT1) in seconds, as BirthInput.deltaT; the engine's time basis when absent. */
|
|
123
|
+
readonly deltaT?: number | undefined;
|
|
124
|
+
/** The scale the instant is on, as BirthInput.timeScale: "utc" (default), "ut1" or "tt". */
|
|
125
|
+
readonly timeScale?: TimeScaleName | undefined;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The mean and true ayanamsa of a definition at an instant, read as a chart
|
|
129
|
+
* reads its own: on the engine's time basis, or a pinned ΔT, and refused
|
|
130
|
+
* outside EPHEMERIS_SPAN. `true` adds the engine's nutation in longitude (IAU
|
|
131
|
+
* 2000B, all 77 terms), which cancels from sidereal longitudes.
|
|
132
|
+
*/
|
|
133
|
+
declare function ayanamsa(definition: AyanamsaName | AyanamsaDefinition, at: DateInput, options?: AyanamsaOptions): AyanamsaValue;
|
|
134
|
+
|
|
135
|
+
export { type AyanamsaName as A, type CatalogueStar as C, type EpochAyanamsa as E, type LinearAyanamsa as L, type StarAyanamsa as S, type UserAyanamsaInput as U, type AyanamsaPrecessionModel as a, type AyanamsaValue as b, type AyanamsaDefinition as c, AYANAMSAS as d, type AyanamsaFlag as e, type AyanamsaOptions as f, ayanamsa as g, userAyanamsa as u };
|
package/dist/calc.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { DeltaT } from './deltat.js';
|
|
2
|
-
import {
|
|
2
|
+
import { E as EPHEMERIS_SPAN } from './reference-span-CILpclrz.js';
|
|
3
|
+
import { T as TimeBands } from './time-bands-CZA9AlLg.js';
|
|
4
|
+
import { T as TimeScale, a as TimeScaleName } from './time-scale-DIFNa0gz.js';
|
|
5
|
+
import { g as ChartFlag, B as BodyName, H as HouseSystem, d as Chart, A as Angles } from './types-DpPdtXgO.js';
|
|
6
|
+
import { A as AyanamsaName, a as AyanamsaPrecessionModel } from './ayanamsa-ClFzkKmV.js';
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* The frames of the calc entry point. A position is first found as a vector on
|
|
@@ -17,7 +21,6 @@ import { h as TimeScale, H as HouseSystem, e as ChartFlag, d as Chart, A as Angl
|
|
|
17
21
|
* equinox of J2000.0, or the ICRS axes.
|
|
18
22
|
*/
|
|
19
23
|
type CalcFrame = "ecliptic-true-of-date" | "ecliptic-mean-of-date" | "ecliptic-j2000" | "ecliptic-icrs" | "equatorial-true-of-date" | "equatorial-mean-of-date" | "equatorial-j2000" | "equatorial-icrs";
|
|
20
|
-
declare const CALC_FRAMES: readonly ["ecliptic-true-of-date", "ecliptic-mean-of-date", "ecliptic-j2000", "ecliptic-icrs", "equatorial-true-of-date", "equatorial-mean-of-date", "equatorial-j2000", "equatorial-icrs"];
|
|
21
24
|
/**
|
|
22
25
|
* "apparent": light time and aberration (annual, and diurnal for a topocentric
|
|
23
26
|
* observer), without gravitational deflection. "astrometric": light time only.
|
|
@@ -28,8 +31,10 @@ type CalcCorrection = "apparent" | "astrometric" | "geometric";
|
|
|
28
31
|
/** The Sun, Moon, Earth and planets, the true and mean lunar nodes, and Black Moon Lilith (the mean apogee). */
|
|
29
32
|
type CalcBody = "Sun" | "Moon" | "Mercury" | "Venus" | "Earth" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto" | "North Node" | "South Node" | "Mean Node" | "Mean South Node" | "Black Moon Lilith";
|
|
30
33
|
declare const CALC_BODIES: readonly CalcBody[];
|
|
31
|
-
/** The time scale of a Julian date:
|
|
32
|
-
type CalcScale =
|
|
34
|
+
/** The time scale of a Julian date: "utc", "ut1" or "tt", the root entry's TimeScaleName. */
|
|
35
|
+
type CalcScale = TimeScaleName;
|
|
36
|
+
/** The frames calc() gives a position in. */
|
|
37
|
+
declare const CALC_FRAMES: readonly CalcFrame[];
|
|
33
38
|
/**
|
|
34
39
|
* An instant: an ISO 8601 string or a Date, read as UTC on the engine's time
|
|
35
40
|
* basis, as positions() and natalChart() read one; or a Julian date on a
|
|
@@ -45,21 +50,86 @@ type CalcTime = string | Date | {
|
|
|
45
50
|
readonly scale: CalcScale;
|
|
46
51
|
readonly deltaT?: number;
|
|
47
52
|
};
|
|
48
|
-
/**
|
|
49
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Geodetic latitude and east longitude, degrees: the place `houses()` and
|
|
55
|
+
* `chart()` take, which has no height.
|
|
56
|
+
*/
|
|
57
|
+
interface CalcLocation {
|
|
50
58
|
readonly latitude: number;
|
|
51
59
|
readonly longitude: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Geodetic latitude and east longitude, degrees; `height` in metres above the
|
|
63
|
+
* IERS 2003 ellipsoid, from −12,000 to 100,000, 0 by default: a topocentric
|
|
64
|
+
* center. `@zodiacs/engine/sky`'s Observer has the same fields on WGS84, with
|
|
65
|
+
* heights from −10,000 m.
|
|
66
|
+
*/
|
|
67
|
+
interface CalcPlace extends CalcLocation {
|
|
52
68
|
readonly height?: number;
|
|
53
69
|
}
|
|
54
70
|
type CalcCenter = "geocentric" | "heliocentric" | "barycentric" | {
|
|
55
71
|
readonly topocentric: CalcPlace;
|
|
56
72
|
};
|
|
57
|
-
/**
|
|
58
|
-
type CalcAyanamsa =
|
|
73
|
+
/** The built-in ayanamsas, by name: `@zodiacs/engine/vedic`'s AyanamsaName, whose guide (docs/vedic.md) defines each. */
|
|
74
|
+
type CalcAyanamsa = AyanamsaName;
|
|
75
|
+
/** The built-in ayanamsas' names, in the order of `@zodiacs/engine/vedic`'s AYANAMSAS, from which they are taken. */
|
|
59
76
|
declare const CALC_AYANAMSAS: readonly CalcAyanamsa[];
|
|
77
|
+
/** The precession model a caller's ayanamsa was computed with: the engine's IAU 2006, Newcomb's (Kinoshita 1975) or IAU 1976; `@zodiacs/engine/vedic`'s AyanamsaPrecessionModel. */
|
|
78
|
+
type CalcAyanamsaModel = AyanamsaPrecessionModel;
|
|
79
|
+
/**
|
|
80
|
+
* A caller's ayanamsa, the counterpart of Swiss Ephemeris's SE_SIDM_USER: the
|
|
81
|
+
* mean ayanamsa `value` at `epoch`, carried from there by precession in
|
|
82
|
+
* `model`, or by a fixed `rate`. It defines what `@zodiacs/engine/vedic`'s
|
|
83
|
+
* userAyanamsa defines, with its epoch given as any instant in a request is.
|
|
84
|
+
*/
|
|
85
|
+
interface CalcUserAyanamsa {
|
|
86
|
+
/** A lowercase identifier of at most 64 characters that is not a built-in name; default "user". */
|
|
87
|
+
readonly name?: string;
|
|
88
|
+
/**
|
|
89
|
+
* When `value` holds, read as `time` is: `{ jd, scale: "tt" }` is
|
|
90
|
+
* SE_SIDM_USER's TT epoch, and `{ jd, scale: "ut1" }` its UT epoch
|
|
91
|
+
* (SE_SIDBIT_USER_UT), whose TT comes from the time basis.
|
|
92
|
+
*/
|
|
93
|
+
readonly epoch: CalcTime;
|
|
94
|
+
/** The mean ayanamsa at `epoch`, degrees, from −360 to 360. */
|
|
95
|
+
readonly value: number;
|
|
96
|
+
/** Arcseconds per Julian year, from −3600 to 3600: an ayanamsa that grows by this rate, with no precession model. */
|
|
97
|
+
readonly rate?: number;
|
|
98
|
+
/** Without `rate`: the model `value` was computed with, default "engine". An older model's zodiac is held where that model puts it at J2000.0. */
|
|
99
|
+
readonly model?: CalcAyanamsaModel;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* "tropical" (default), or `{ sidereal }` with a built-in ayanamsa's name or a
|
|
103
|
+
* caller's ayanamsa. A sidereal longitude is the longitude in the ecliptic of
|
|
104
|
+
* date less the ayanamsa: the true ayanamsa (the mean plus the nutation in
|
|
105
|
+
* longitude) in the true ecliptic of date, the mean ayanamsa in the mean one.
|
|
106
|
+
*/
|
|
60
107
|
type CalcZodiac = "tropical" | {
|
|
61
|
-
readonly sidereal: CalcAyanamsa;
|
|
108
|
+
readonly sidereal: CalcAyanamsa | CalcUserAyanamsa;
|
|
62
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* The ayanamsa of a sidereal result, at its instant and on its clock, in the
|
|
112
|
+
* result's angular unit; calc(), houses() and chart() give the same shape.
|
|
113
|
+
*/
|
|
114
|
+
interface CalcAyanamsaValue {
|
|
115
|
+
/** The definition's name. */
|
|
116
|
+
readonly name: string;
|
|
117
|
+
/** The mean ayanamsa, counted along the mean ecliptic of date. */
|
|
118
|
+
readonly mean: number;
|
|
119
|
+
/** The engine's nutation in longitude (IAU 2000B). */
|
|
120
|
+
readonly nutation: number;
|
|
121
|
+
/** The mean ayanamsa plus the nutation in longitude, counted along the true ecliptic of date, in (−180°, 180°]. */
|
|
122
|
+
readonly true: number;
|
|
123
|
+
/** The one subtracted: "true" in the true ecliptic of date, "mean" in the mean ecliptic of date. */
|
|
124
|
+
readonly subtracted: "true" | "mean";
|
|
125
|
+
/**
|
|
126
|
+
* The mean ayanamsa's difference from ERFA's construction of the same
|
|
127
|
+
* definition, the bound a sidereal result's own bounds add. The nutation
|
|
128
|
+
* cancels from a sidereal longitude; `true`, read on its own, also differs
|
|
129
|
+
* from IAU 2000A's by the nutation model's difference (docs/calc.md).
|
|
130
|
+
*/
|
|
131
|
+
readonly bound: CalcBound;
|
|
132
|
+
}
|
|
63
133
|
interface CalcFlags {
|
|
64
134
|
/** Default "apparent". */
|
|
65
135
|
readonly correction?: CalcCorrection;
|
|
@@ -93,7 +163,13 @@ interface CalcInstant {
|
|
|
93
163
|
/** The scale the instant was given on and the basis that gave UT1 and TT, as a chart records it. */
|
|
94
164
|
readonly timeScale: TimeScale;
|
|
95
165
|
}
|
|
96
|
-
|
|
166
|
+
/**
|
|
167
|
+
* The schema id of a calc receipt. Candidates before 1.0.0 wrote
|
|
168
|
+
* "zodiacs.calc-receipt.draft-v1", whose requests name a Julian date's scale
|
|
169
|
+
* in capitals and houses()'s house system as `system`; from 1.0.0 the id is
|
|
170
|
+
* this one, and its requests are 1.0's.
|
|
171
|
+
*/
|
|
172
|
+
declare const CALC_RECEIPT_SCHEMA = "zodiacs.calc-receipt.v1";
|
|
97
173
|
interface CalcReceipt<Request> {
|
|
98
174
|
readonly schema: typeof CALC_RECEIPT_SCHEMA;
|
|
99
175
|
/** The request as read, every default filled in, as JSON; passing it back repeats the calculation. */
|
|
@@ -104,8 +180,14 @@ interface CalcReceipt<Request> {
|
|
|
104
180
|
readonly engine: {
|
|
105
181
|
readonly name: "@zodiacs/engine";
|
|
106
182
|
readonly version: string;
|
|
183
|
+
/**
|
|
184
|
+
* What the result was computed on: `"jpl-de440"` with the shipped pack's
|
|
185
|
+
* SHA-256, or `"astronomy-engine"` with its version (docs/calc.md, "Which
|
|
186
|
+
* ephemeris"). Where astronomy-engine stands in for the pack, the
|
|
187
|
+
* result's flags say so.
|
|
188
|
+
*/
|
|
107
189
|
readonly ephemeris: {
|
|
108
|
-
readonly name:
|
|
190
|
+
readonly name: string;
|
|
109
191
|
readonly version: string;
|
|
110
192
|
};
|
|
111
193
|
};
|
|
@@ -129,6 +211,27 @@ interface CalcBounds {
|
|
|
129
211
|
readonly stepDays: number | null;
|
|
130
212
|
}) | null;
|
|
131
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* A position's band from the time basis: how far its coordinates move, to
|
|
216
|
+
* first order, when the instant's TT and UT1 move by their 1-σ bands. Two
|
|
217
|
+
* kinds are not that movement: for the true nodes, whose speed is a
|
|
218
|
+
* difference over ±0.25 day, the band is that smoothed speed times the TT
|
|
219
|
+
* band; and for a topocentric position it is a conservative bound on the
|
|
220
|
+
* movement, at or above it, since it takes an upper bound on the rate at
|
|
221
|
+
* which the observer's turn moves the position. A band is not a bound on
|
|
222
|
+
* the error: it leaves out the ephemeris's error, which `bounds` gives, and
|
|
223
|
+
* the input time's own (docs/calc.md, "Bands").
|
|
224
|
+
*/
|
|
225
|
+
interface CalcTimeBand {
|
|
226
|
+
/** The 1-σ bands of the instant's TT and UT1, seconds (`timeBands` in `@zodiacs/engine/time`). */
|
|
227
|
+
readonly time: TimeBands;
|
|
228
|
+
/** Arcseconds, in `lon`'s coordinate, whatever `flags.units` says. */
|
|
229
|
+
readonly lon: number;
|
|
230
|
+
/** Arcseconds. */
|
|
231
|
+
readonly lat: number;
|
|
232
|
+
/** au; null where `dist` is null. */
|
|
233
|
+
readonly dist: number | null;
|
|
234
|
+
}
|
|
132
235
|
interface CalcPosition {
|
|
133
236
|
readonly status: "ok";
|
|
134
237
|
readonly body: CalcBody;
|
|
@@ -154,10 +257,25 @@ interface CalcPosition {
|
|
|
154
257
|
readonly vy: number | null;
|
|
155
258
|
readonly vz: number | null;
|
|
156
259
|
} | null;
|
|
260
|
+
/** In the sidereal zodiac, the ayanamsa and which value of it `lon` has subtracted; null in the tropical zodiac. */
|
|
261
|
+
readonly ayanamsa: CalcAyanamsaValue | null;
|
|
262
|
+
/** In the sidereal zodiac, each includes the ayanamsa's own bound. */
|
|
157
263
|
readonly bounds: CalcBounds;
|
|
264
|
+
/** The band from the time basis, which is not a bound on the error; null without speeds. */
|
|
265
|
+
readonly band: CalcTimeBand | null;
|
|
266
|
+
/**
|
|
267
|
+
* "delta-t-extrapolated" where the position moves with an extrapolated ΔT, and `bounds` are widened (docs/calc.md,
|
|
268
|
+
* "Bounds"). "de440-unavailable" where the shipped DE440 pack gives this position and could not be opened, so
|
|
269
|
+
* that astronomy-engine gave it: never silently (docs/calc.md, "Which ephemeris").
|
|
270
|
+
*/
|
|
271
|
+
readonly flags: readonly ChartFlag[];
|
|
158
272
|
readonly receipt: CalcReceipt<CalcRequest>;
|
|
159
273
|
}
|
|
160
|
-
/**
|
|
274
|
+
/**
|
|
275
|
+
* Why a request was not computed. A refused search in `@zodiacs/engine/crossings`
|
|
276
|
+
* and `@zodiacs/engine/sky` carries the same `status: "refused"`, and for a
|
|
277
|
+
* spent budget the same `reason: "sample-budget"`.
|
|
278
|
+
*/
|
|
161
279
|
type CalcRefusal = {
|
|
162
280
|
readonly status: "refused";
|
|
163
281
|
readonly detail: string;
|
|
@@ -166,12 +284,15 @@ type CalcRefusal = {
|
|
|
166
284
|
} | {
|
|
167
285
|
readonly reason: "out-of-range";
|
|
168
286
|
readonly span: CalcSpan;
|
|
287
|
+
} | {
|
|
288
|
+
readonly reason: "epoch-out-of-range";
|
|
289
|
+
readonly epochSpan: typeof EPHEMERIS_SPAN;
|
|
169
290
|
} | {
|
|
170
291
|
readonly reason: "sample-budget";
|
|
171
292
|
readonly samples: number;
|
|
172
293
|
readonly maxSamples: number;
|
|
173
294
|
});
|
|
174
|
-
/** From an
|
|
295
|
+
/** From an instant up to, not including, another: ISO 8601 UTC to the millisecond, as Date.prototype.toISOString gives them. */
|
|
175
296
|
interface CalcSpan {
|
|
176
297
|
readonly from: string;
|
|
177
298
|
readonly to: string;
|
|
@@ -187,9 +308,9 @@ declare const CALC_SPAN: CalcSpan;
|
|
|
187
308
|
declare function calc(request: CalcRequest): CalcPosition | CalcRefusal;
|
|
188
309
|
interface HousesRequest {
|
|
189
310
|
readonly time: CalcTime;
|
|
190
|
-
readonly place:
|
|
191
|
-
/** Default "whole", as in natalChart(). */
|
|
192
|
-
readonly
|
|
311
|
+
readonly place: CalcLocation;
|
|
312
|
+
/** Default "whole", as in natalChart() and chart(). */
|
|
313
|
+
readonly houseSystem?: HouseSystem;
|
|
193
314
|
readonly zodiac?: CalcZodiac;
|
|
194
315
|
}
|
|
195
316
|
interface HousesResult {
|
|
@@ -197,8 +318,13 @@ interface HousesResult {
|
|
|
197
318
|
readonly requested: HouseSystem;
|
|
198
319
|
/** The requested system, or whole sign where Placidus or Koch is undefined (flag "polar-fallback"). */
|
|
199
320
|
readonly system: HouseSystem;
|
|
200
|
-
/**
|
|
321
|
+
/**
|
|
322
|
+
* Twelve cusps from the first house, degrees in the true ecliptic of date,
|
|
323
|
+
* in the zodiac asked for; in the sidereal zodiac, whole-sign cusps start at
|
|
324
|
+
* the sidereal ascendant's sign.
|
|
325
|
+
*/
|
|
201
326
|
readonly cusps: readonly number[];
|
|
327
|
+
/** In the zodiac asked for, as the Vertex and the East Point are. */
|
|
202
328
|
readonly angles: Angles;
|
|
203
329
|
readonly vertex: number;
|
|
204
330
|
readonly eastPoint: number;
|
|
@@ -207,10 +333,31 @@ interface HousesResult {
|
|
|
207
333
|
/** The true obliquity used, degrees. */
|
|
208
334
|
readonly obliquity: number;
|
|
209
335
|
readonly flags: readonly ChartFlag[];
|
|
336
|
+
/** In the sidereal zodiac, the ayanamsa, degrees, whose true value is subtracted; null in the tropical zodiac. */
|
|
337
|
+
readonly ayanamsa: CalcAyanamsaValue | null;
|
|
338
|
+
/** In the sidereal zodiac, each includes the ayanamsa's own bound. */
|
|
210
339
|
readonly bounds: {
|
|
211
340
|
readonly angles: CalcBound;
|
|
212
341
|
readonly cusps: CalcBound;
|
|
213
342
|
};
|
|
343
|
+
/**
|
|
344
|
+
* The bands from the time basis, which are not bounds: the instant's, and
|
|
345
|
+
* each angle's and cusp's, arcseconds, its rate on UT1 times the UT1 band
|
|
346
|
+
* plus its rate on TT times the TT band (in the sidereal zodiac the sidereal
|
|
347
|
+
* longitude's, with the ayanamsa's rate). Whole-sign cusps, and the cusps
|
|
348
|
+
* where Placidus or Koch falls back to whole signs, have none: 0. Where TT
|
|
349
|
+
* moved 600 s one way would make Placidus or Koch fall back, a cusp's rate
|
|
350
|
+
* on TT is taken the other way alone, and where both ways would, it is 0
|
|
351
|
+
* (docs/calc.md, "Bands").
|
|
352
|
+
*/
|
|
353
|
+
readonly band: {
|
|
354
|
+
readonly time: TimeBands;
|
|
355
|
+
readonly asc: number;
|
|
356
|
+
readonly mc: number;
|
|
357
|
+
readonly vertex: number;
|
|
358
|
+
readonly eastPoint: number;
|
|
359
|
+
readonly cusps: readonly number[];
|
|
360
|
+
};
|
|
214
361
|
readonly receipt: CalcReceipt<HousesRequest>;
|
|
215
362
|
}
|
|
216
363
|
/** The angles, the Vertex, the East Point and the cusps for an instant and a place, as natalChart() computes them. */
|
|
@@ -219,7 +366,7 @@ interface EventsRequest {
|
|
|
219
366
|
/** The one kind in this version: the instants a body sits on a longitude. */
|
|
220
367
|
readonly kind: "longitude-crossing";
|
|
221
368
|
readonly body: CalcBody;
|
|
222
|
-
/** Apparent geocentric ecliptic longitude of date, degrees. */
|
|
369
|
+
/** Apparent geocentric ecliptic longitude of date, degrees, in the zodiac asked for. */
|
|
223
370
|
readonly longitude: number;
|
|
224
371
|
/** The search covers (from, to]. */
|
|
225
372
|
readonly from: CalcTime;
|
|
@@ -237,6 +384,15 @@ interface CalcEvent {
|
|
|
237
384
|
readonly jdTt: number;
|
|
238
385
|
/** True when the body moved backward through the longitude. */
|
|
239
386
|
readonly retrograde: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* The 1-σ bands, seconds, of the event's UTC and UT1 from the time basis at
|
|
389
|
+
* the event: the ephemeris fixes it in TT, so its TT has none, `utc` is the
|
|
390
|
+
* band of TT − UTC there and `ut1` that of TT − UT1 (docs/calc.md, "Bands").
|
|
391
|
+
*/
|
|
392
|
+
readonly band: {
|
|
393
|
+
readonly utc: number;
|
|
394
|
+
readonly ut1: number;
|
|
395
|
+
};
|
|
240
396
|
}
|
|
241
397
|
interface EventsResult {
|
|
242
398
|
readonly status: "ok";
|
|
@@ -244,6 +400,12 @@ interface EventsResult {
|
|
|
244
400
|
readonly events: readonly CalcEvent[];
|
|
245
401
|
/** Longitude evaluations made. */
|
|
246
402
|
readonly samples: number;
|
|
403
|
+
/**
|
|
404
|
+
* "delta-t-extrapolated" where an event's UTC moves with an extrapolated ΔT; `timing` then adds the widest such
|
|
405
|
+
* band. "de440-unavailable" where the search ran on astronomy-engine because the shipped DE440 pack could not be
|
|
406
|
+
* opened.
|
|
407
|
+
*/
|
|
408
|
+
readonly flags: readonly ChartFlag[];
|
|
247
409
|
readonly bounds: {
|
|
248
410
|
readonly timing: CalcBound;
|
|
249
411
|
};
|
|
@@ -258,7 +420,7 @@ declare function events(request: EventsRequest): EventsResult | CalcRefusal;
|
|
|
258
420
|
interface ChartRequest {
|
|
259
421
|
readonly time: CalcTime;
|
|
260
422
|
/** Without a place there are no angles or houses. */
|
|
261
|
-
readonly place?:
|
|
423
|
+
readonly place?: CalcLocation;
|
|
262
424
|
/** Default "whole". */
|
|
263
425
|
readonly houseSystem?: HouseSystem;
|
|
264
426
|
/** False: `time` is a reference instant, with no angles or houses. Default true. */
|
|
@@ -269,11 +431,46 @@ interface ChartRequest {
|
|
|
269
431
|
}
|
|
270
432
|
interface ChartResult {
|
|
271
433
|
readonly status: "ok";
|
|
272
|
-
/** The chart natalChart() gives for the same instant (to the millisecond), place, settings and ΔT. */
|
|
434
|
+
/** The chart natalChart() gives for the same instant (to the millisecond), place, settings and ΔT: tropical. */
|
|
273
435
|
readonly chart: Chart;
|
|
436
|
+
/** In the sidereal zodiac, the chart's longitudes as `@zodiacs/engine/vedic`'s siderealChart() gives them; null in the tropical zodiac. */
|
|
437
|
+
readonly sidereal: CalcSiderealChart | null;
|
|
438
|
+
/**
|
|
439
|
+
* The bands of `chart`, the tropical chart, from the time basis, which are
|
|
440
|
+
* not bounds: the instant's; each body's longitude, its speed times the TT
|
|
441
|
+
* band; and the ascendant's and the midheaven's, their rates on UT1 and on
|
|
442
|
+
* TT times those bands, as houses() gives them in the tropical zodiac, null
|
|
443
|
+
* without angles; arcseconds (docs/calc.md, "Bands").
|
|
444
|
+
*/
|
|
445
|
+
readonly band: {
|
|
446
|
+
readonly time: TimeBands;
|
|
447
|
+
readonly bodies: readonly {
|
|
448
|
+
readonly body: BodyName;
|
|
449
|
+
readonly lon: number;
|
|
450
|
+
}[];
|
|
451
|
+
readonly asc: number | null;
|
|
452
|
+
readonly mc: number | null;
|
|
453
|
+
};
|
|
274
454
|
readonly receipt: CalcReceipt<ChartRequest>;
|
|
275
455
|
}
|
|
456
|
+
/** A chart's sidereal longitudes, degrees in [0, 360), as siderealChart() gives them. */
|
|
457
|
+
interface CalcSiderealChart {
|
|
458
|
+
/** The ayanamsa at the chart's instant and on its clock, degrees, whose true value is subtracted. */
|
|
459
|
+
readonly ayanamsa: CalcAyanamsaValue;
|
|
460
|
+
/** The chart's bodies, in its order. */
|
|
461
|
+
readonly bodies: readonly {
|
|
462
|
+
readonly body: BodyName;
|
|
463
|
+
readonly lon: number;
|
|
464
|
+
}[];
|
|
465
|
+
/** Null when the chart has no angles. */
|
|
466
|
+
readonly ascendant: number | null;
|
|
467
|
+
readonly midheaven: number | null;
|
|
468
|
+
/** The house system as computed, after any polar fallback; null without houses. */
|
|
469
|
+
readonly houseSystem: HouseSystem | null;
|
|
470
|
+
/** First house first; whole-sign cusps start at the sidereal ascendant's sign. Null without houses. */
|
|
471
|
+
readonly cusps: readonly number[] | null;
|
|
472
|
+
}
|
|
276
473
|
/** A natal chart from the calc vocabulary: natalChart()'s chart, with a receipt. */
|
|
277
474
|
declare function chart(request: ChartRequest): ChartResult | CalcRefusal;
|
|
278
475
|
|
|
279
|
-
export { Angles, CALC_AYANAMSAS, CALC_BODIES, CALC_FRAMES, CALC_RECEIPT_SCHEMA, CALC_SPAN, type CalcAyanamsa, type CalcBody, type CalcBound, type CalcBounds, type CalcCenter, type CalcCorrection, type CalcEvent, type CalcFlags, type CalcFrame, type CalcInstant, type CalcPlace, type CalcPosition, type CalcReceipt, type CalcRefusal, type CalcRequest, type CalcScale, type CalcSpan, type CalcTime, type CalcZodiac, Chart, ChartFlag, type ChartRequest, type ChartResult, DeltaT, type EventsRequest, type EventsResult, HouseSystem, type HousesRequest, type HousesResult, TimeScale, calc, chart, events, houses };
|
|
476
|
+
export { Angles, CALC_AYANAMSAS, CALC_BODIES, CALC_FRAMES, CALC_RECEIPT_SCHEMA, CALC_SPAN, type CalcAyanamsa, type CalcAyanamsaModel, type CalcAyanamsaValue, type CalcBody, type CalcBound, type CalcBounds, type CalcCenter, type CalcCorrection, type CalcEvent, type CalcFlags, type CalcFrame, type CalcInstant, type CalcLocation, type CalcPlace, type CalcPosition, type CalcReceipt, type CalcRefusal, type CalcRequest, type CalcScale, type CalcSiderealChart, type CalcSpan, type CalcTime, type CalcTimeBand, type CalcUserAyanamsa, type CalcZodiac, Chart, ChartFlag, type ChartRequest, type ChartResult, DeltaT, type EventsRequest, type EventsResult, HouseSystem, type HousesRequest, type HousesResult, TimeBands, TimeScale, calc, chart, events, houses };
|