Function: dateSky()
function dateSky(
engine,
constraints,
jdStart,
jdEnd,
opts?): DateSkyResult;
Sky dating: every window in a date range in which a described sky occurred.
Each constraint names a body (or an elongation between two bodies) and an
arc: a zodiac sign, a longitude with an orb, or a from–to span. The
search scans the slowest body across the whole range, then scans each
faster body only inside the windows that survive, so a description of the
seven classical bodies resolves across several thousand years in well under
a minute.
The range is the caller's to choose and must lie inside the data the engine
was built with; engineCapabilities reports each body's span. An
instant is a UT Julian Day; use julianDay with "julian" for
historical dates and calendarDate to read a window back.
Parameters
| Parameter | Type | Description |
|---|---|---|
engine | Engine | The engine to compute positions with. |
constraints | SkyConstraint[] | What the sky looked like. At least one. |
jdStart | number | Start of the range (Julian Day, UT). |
jdEnd | number | End of the range (Julian Day, UT). |
opts | DateSkyOptions | Zodiac, a default pad, and the window limit. |
Returns
The matching windows, and the search funnel: how many windows and days survived each constraint, in scan order.
Example
// The oldest Babylonian horoscope names four planets by sign.
const { windows } = dateSky(engine, [
{ body: "jupiter", sign: "Pisces" },
{ body: "venus", sign: "Taurus" },
{ body: "saturn", sign: "Cancer" },
{ body: "mars", sign: "Gemini" },
], julianDay(-499, 1, 1, 0, 0, 0, "julian"), julianDay(-299, 1, 1, 0, 0, 0, "julian"));
calendarDate(windows[0].start, "julian"); // { year: -409, month: 4, day: 16, ... }