@zodiacs/engine 1.0.0 → 2.0.0-rc.2

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +1244 -0
  2. package/LICENSING.md +172 -27
  3. package/NOTICE +78 -12
  4. package/README.md +344 -59
  5. package/dist/{api-WbxJ4Wj-.d.ts → api-C_SVd9BJ.d.ts} +39 -3
  6. package/dist/{ayanamsa--YQ46fET.d.ts → ayanamsa-Clgkekhh.d.ts} +2 -1
  7. package/dist/calc.d.ts +91 -4
  8. package/dist/calc.js +368 -126
  9. package/dist/chunk-CV53HA7R.js +87 -0
  10. package/dist/chunk-EEW7746S.js +83 -0
  11. package/dist/{chunk-WS3TDSP3.js → chunk-FVGA776A.js} +7 -3
  12. package/dist/chunk-HNVGWN3S.js +852 -0
  13. package/dist/chunk-I3L4POY7.js +18 -0
  14. package/dist/{chunk-FTX3JDJA.js → chunk-IXFUYEUF.js} +65 -29
  15. package/dist/{chunk-7TRLIFFI.js → chunk-LWZS7HI3.js} +1 -1
  16. package/dist/{chunk-CHSYDKBL.js → chunk-N4UQLCBN.js} +3 -3
  17. package/dist/{chunk-YIITY7Q7.js → chunk-NX4PHQBL.js} +34 -22
  18. package/dist/chunk-OVXQQEXL.js +41 -0
  19. package/dist/{chunk-SRXBTP5H.js → chunk-PNXIA7MI.js} +217 -192
  20. package/dist/chunk-RMBWKZI2.js +130 -0
  21. package/dist/{chunk-DMGHYCDI.js → chunk-SCRO6HWB.js} +5 -3
  22. package/dist/{chunk-OG4OYTJJ.js → chunk-T6F4FYYS.js} +1 -129
  23. package/dist/chunk-UXY4RU57.js +48 -0
  24. package/dist/{chunk-PFGUCNOK.js → chunk-WONTOC5W.js} +7 -6
  25. package/dist/conventions.d.ts +70 -0
  26. package/dist/conventions.js +26 -0
  27. package/dist/crossings.d.ts +15 -4
  28. package/dist/de440-pack.d.ts +43 -0
  29. package/dist/de440-pack.js +16 -0
  30. package/dist/de440.d.ts +113 -0
  31. package/dist/de440.js +19 -0
  32. package/dist/ephemeris-D1lM832F.d.ts +64 -0
  33. package/dist/geo.d.ts +28 -7
  34. package/dist/geo.js +2 -2
  35. package/dist/houses-extra.d.ts +5 -4
  36. package/dist/{houses-CFERsAlK.d.ts → houses-icK01yXi.d.ts} +3 -3
  37. package/dist/index.d.ts +8 -6
  38. package/dist/index.js +40 -28
  39. package/dist/{internal-math-DJJ8BYex.d.ts → internal-math-BGX23p4h.d.ts} +2 -2
  40. package/dist/internal-math.d.ts +4 -3
  41. package/dist/internal-math.js +14 -12
  42. package/dist/internal.d.ts +16 -7
  43. package/dist/internal.js +25 -4
  44. package/dist/lite-composite.js +114 -0
  45. package/dist/lite-declinations.js +253 -0
  46. package/dist/lite-dignities.js +333 -0
  47. package/dist/lite-sect.js +72 -0
  48. package/dist/lite.d.ts +82 -0
  49. package/dist/lite.js +4 -0
  50. package/dist/receipt.d.ts +3 -2
  51. package/dist/receipt.js +156 -67
  52. package/dist/{rulers-Dla6h_Sm.d.ts → rulers-CpS9qkvu.d.ts} +1 -1
  53. package/dist/sky.d.ts +4 -3
  54. package/dist/sky.js +17 -10
  55. package/dist/techniques.d.ts +102 -6
  56. package/dist/techniques.js +131 -56
  57. package/dist/time-bands-CZA9AlLg.d.ts +36 -0
  58. package/dist/time-scale-DIFNa0gz.d.ts +47 -0
  59. package/dist/time.d.ts +81 -0
  60. package/dist/time.js +74 -0
  61. package/dist/timing.d.ts +6 -5
  62. package/dist/timing.js +24 -17
  63. package/dist/types-BCnyWBQZ.d.ts +352 -0
  64. package/dist/vedic.d.ts +112 -4
  65. package/dist/vedic.js +369 -14
  66. package/dist/window.d.ts +22 -2
  67. package/dist/window.js +86 -28
  68. package/dist/{zone-history-ghdyO0Sc.d.ts → zone-history-0XzMGx9V.d.ts} +32 -10
  69. package/package.json +24 -3
  70. package/dist/types-B-yb_tGL.d.ts +0 -240
@@ -1,5 +1,5 @@
1
1
  import { DeltaT } from './deltat.js';
2
- import { B as BodyName, D as DateInput, d as Chart, h as BirthInput, i as ChartPoints, M as MoonPhase, c as BodyPosition, S as SynastryResult, j as TransitResult } from './types-B-yb_tGL.js';
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-BCnyWBQZ.js';
3
3
  import { LongitudeCrossing, CrossingSearchOptions, CrossingSearchResult } from './crossings.js';
4
4
 
5
5
  /** Geometry over full ecliptic positions; no independent ephemeris is implied. */
@@ -112,6 +112,21 @@ interface ChartDeclinations extends Declinations {
112
112
  utc: string;
113
113
  /** The evaluated provider Delta-T used to obtain true obliquity. */
114
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[];
115
130
  }
116
131
  /**
117
132
  * Rotate full ecliptic longitude/latitude into the equator associated with the
@@ -145,6 +160,19 @@ interface SaturnReturnResult {
145
160
  natalLon: number;
146
161
  natalRetrograde: boolean;
147
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[];
148
176
  }
149
177
  /**
150
178
  * Every instant in (from, to] when `body` sits exactly on `targetLongitude`,
@@ -161,7 +189,10 @@ declare function findLongitudeCrossings(body: BodyName, targetLongitude: number,
161
189
  * {@link findLongitudeCrossings} under an optional budget of ephemeris
162
190
  * evaluations, `maxSamples`, with the step as `stepDays` (default 5). Over
163
191
  * budget, it returns `{ status: "refused", reason: "sample-budget" }` with no
164
- * 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.
165
196
  */
166
197
  declare function searchLongitudeCrossings(body: BodyName, targetLongitude: number, from: DateInput, to: DateInput, options?: CrossingSearchOptions): CrossingSearchResult;
167
198
  declare function groupIntoSeasons(crossings: readonly LongitudeCrossing[], gapDays?: number): ReturnSeason[];
@@ -197,7 +228,12 @@ declare function transits(natal: NatalSource, date: DateInput): TransitResult;
197
228
  declare function synastry(first: NatalSource, second: NatalSource): SynastryResult;
198
229
  /** High-precision Moon phase derived from the same positions as charts. */
199
230
  declare function moonPhase(date: DateInput): MoonPhase;
200
- /** Natal Saturn and return seasons through approximately age 92. */
231
+ /**
232
+ * Natal Saturn and return seasons through approximately age 92. A calendar
233
+ * date with no time, such as "1990-05-03", given in place of a birth or as a
234
+ * birth's `utc`, is refused with a RangeError unless the birth object sets
235
+ * `timeKnown: false`.
236
+ */
201
237
  declare function saturnReturn(birth: SaturnReturnSource): SaturnReturnResult;
202
238
 
203
239
  export { transits as A, type ChartDeclinations as C, DECLINATION_ORB as D, type EquatorialCoordinates as E, type NatalSource as N, RA_POLE_TOLERANCE as R, SUN_BOUND_LATITUDE as S, DECLINATION_ORB_LUMINARY as a, DEFAULT_DECLINATION_ORB_POLICY as b, type DeclinationAspect as c, type DeclinationAspectType as d, type DeclinationBody as e, type DeclinationOrbPolicy as f, type DeclinationRow as g, type Declinations as h, type ReturnSeason as i, type SaturnReturnResult as j, type SaturnReturnSource as k, chartDeclinations as l, chartPoints as m, declinationOf as n, declinationOrb as o, declinationsForBodies as p, eclipticToEquatorial as q, findDeclinationAspects as r, findLongitudeCrossings as s, groupIntoSeasons as t, moonPhase as u, natalChart as v, positions as w, saturnReturn as x, searchLongitudeCrossings as y, synastry as z };
@@ -1,5 +1,6 @@
1
1
  import { DeltaT } from './deltat.js';
2
- import { T as TimeScaleName, e as TimeScale, D as DateInput } from './types-B-yb_tGL.js';
2
+ import { a as TimeScaleName, T as TimeScale } from './time-scale-DIFNa0gz.js';
3
+ import { e as DateInput } from './types-BCnyWBQZ.js';
3
4
 
4
5
  /** The precession model of an epoch value: the engine's IAU 2006, Newcomb's (Kinoshita 1975) or IAU 1976. */
5
6
  type AyanamsaPrecessionModel = "engine" | "newcomb" | "iau1976";
package/dist/calc.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { DeltaT } from './deltat.js';
2
2
  import { E as EPHEMERIS_SPAN } from './reference-span-CILpclrz.js';
3
- import { e as TimeScale, T as TimeScaleName, B as BodyName, H as HouseSystem, g as ChartFlag, d as Chart, A as Angles } from './types-B-yb_tGL.js';
4
- import { A as AyanamsaName, a as AyanamsaPrecessionModel } from './ayanamsa--YQ46fET.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-BCnyWBQZ.js';
6
+ import { A as AyanamsaName, a as AyanamsaPrecessionModel } from './ayanamsa-Clgkekhh.js';
5
7
 
6
8
  /**
7
9
  * The frames of the calc entry point. A position is first found as a vector on
@@ -178,8 +180,14 @@ interface CalcReceipt<Request> {
178
180
  readonly engine: {
179
181
  readonly name: "@zodiacs/engine";
180
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
+ */
181
189
  readonly ephemeris: {
182
- readonly name: "astronomy-engine";
190
+ readonly name: string;
183
191
  readonly version: string;
184
192
  };
185
193
  };
@@ -203,6 +211,27 @@ interface CalcBounds {
203
211
  readonly stepDays: number | null;
204
212
  }) | null;
205
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
+ }
206
235
  interface CalcPosition {
207
236
  readonly status: "ok";
208
237
  readonly body: CalcBody;
@@ -232,6 +261,14 @@ interface CalcPosition {
232
261
  readonly ayanamsa: CalcAyanamsaValue | null;
233
262
  /** In the sidereal zodiac, each includes the ayanamsa's own bound. */
234
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[];
235
272
  readonly receipt: CalcReceipt<CalcRequest>;
236
273
  }
237
274
  /**
@@ -303,6 +340,24 @@ interface HousesResult {
303
340
  readonly angles: CalcBound;
304
341
  readonly cusps: CalcBound;
305
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
+ };
306
361
  readonly receipt: CalcReceipt<HousesRequest>;
307
362
  }
308
363
  /** The angles, the Vertex, the East Point and the cusps for an instant and a place, as natalChart() computes them. */
@@ -329,6 +384,15 @@ interface CalcEvent {
329
384
  readonly jdTt: number;
330
385
  /** True when the body moved backward through the longitude. */
331
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
+ };
332
396
  }
333
397
  interface EventsResult {
334
398
  readonly status: "ok";
@@ -336,6 +400,12 @@ interface EventsResult {
336
400
  readonly events: readonly CalcEvent[];
337
401
  /** Longitude evaluations made. */
338
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[];
339
409
  readonly bounds: {
340
410
  readonly timing: CalcBound;
341
411
  };
@@ -348,6 +418,7 @@ interface EventsResult {
348
418
  */
349
419
  declare function events(request: EventsRequest): EventsResult | CalcRefusal;
350
420
  interface ChartRequest {
421
+ /** A calendar date with no time, such as "1990-05-03", is refused with a RangeError unless `timeKnown` is false. */
351
422
  readonly time: CalcTime;
352
423
  /** Without a place there are no angles or houses. */
353
424
  readonly place?: CalcLocation;
@@ -365,6 +436,22 @@ interface ChartResult {
365
436
  readonly chart: Chart;
366
437
  /** In the sidereal zodiac, the chart's longitudes as `@zodiacs/engine/vedic`'s siderealChart() gives them; null in the tropical zodiac. */
367
438
  readonly sidereal: CalcSiderealChart | null;
439
+ /**
440
+ * The bands of `chart`, the tropical chart, from the time basis, which are
441
+ * not bounds: the instant's; each body's longitude, its speed times the TT
442
+ * band; and the ascendant's and the midheaven's, their rates on UT1 and on
443
+ * TT times those bands, as houses() gives them in the tropical zodiac, null
444
+ * without angles; arcseconds (docs/calc.md, "Bands").
445
+ */
446
+ readonly band: {
447
+ readonly time: TimeBands;
448
+ readonly bodies: readonly {
449
+ readonly body: BodyName;
450
+ readonly lon: number;
451
+ }[];
452
+ readonly asc: number | null;
453
+ readonly mc: number | null;
454
+ };
368
455
  readonly receipt: CalcReceipt<ChartRequest>;
369
456
  }
370
457
  /** A chart's sidereal longitudes, degrees in [0, 360), as siderealChart() gives them. */
@@ -387,4 +474,4 @@ interface CalcSiderealChart {
387
474
  /** A natal chart from the calc vocabulary: natalChart()'s chart, with a receipt. */
388
475
  declare function chart(request: ChartRequest): ChartResult | CalcRefusal;
389
476
 
390
- 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 CalcUserAyanamsa, type CalcZodiac, Chart, ChartFlag, type ChartRequest, type ChartResult, DeltaT, type EventsRequest, type EventsResult, HouseSystem, type HousesRequest, type HousesResult, TimeScale, calc, chart, events, houses };
477
+ 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 };