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

ParameterTypeDescription
engineEngineThe engine used to evaluate positions.
jdUtnumberThe instant, Julian Day (UT). For "at sunset", resolve it first with riseSet(engine, "sun", jdStart, lat, lonEast, "set").
viewSkyViewSpecObserver, aim (azimuth and altitude), lens, and image size.
optsSkyViewOptionsRefraction inputs, star selection, and the body set.

Returns

SkyViewResult

A SkyViewResult.

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;

Start building

Quickstart →