API Reference / skyView · function
Function: skyView()
function skyView(
engine,
jdUt,
view,
opts?): SkyViewResult;
Project the visible sky into an image frame for a place, instant, aim, and lens. Returns each in-frame body's pixel position, apparent size, brightness, and (for the Moon) phase orientation, a sky-state summary, the bright bodies just outside the frame, and a serialized prompt.
Caelus computes geometry and photometry only. It does not render an image;
the prompt and directives hand color and atmosphere to an image model.
Parameters
| Parameter | Type | Description |
|---|---|---|
engine | Engine | The engine used to evaluate positions. |
jdUt | number | The instant, Julian Day (UT). For "at sunset", resolve it first with riseSet(engine, "sun", jdStart, lat, lonEast, "set"). |
view | SkyViewSpec | Observer, aim (azimuth and altitude), lens, and image size. |
opts | SkyViewOptions | Refraction inputs, star selection, and the body set. |
Returns
Example
const set = riseSet(engine, "sun", julianDay(2026, 6, 21), 47.6, -122.3, "set")!;
const view = skyView(engine, set, {
observer: { lat: 47.6, lonEast: -122.3, altM: 9 },
aim: { azimuth: "W", altitude: 5 },
lens: "normal",
image: { width: 1024, height: 683 },
});
view.bodies.find((b) => b.id === "moon")?.brightLimbClock;