Please enable JavaScript to view this site.

 

bool = PlanetIsUp(nDate, nTimeOfDay, nPlanetID, nMoonSourceIndex)

 

This macro function checks whether nPlanetID is “up” at nTimeOfDay on nDate, meaning that its altitude exceeds the function's horizon threshold. It uses the body's topocentric apparent altitude: its altitude as seen from the observer at the selected Moon data source, including atmospheric refraction.

 

•The allowed values for nPlanetID range from n_MERCURY to n_PLUTO, and also include n_MOON (for the Sun, use the function SunIsUp).

•nDate and nTimeOfDay use the local-time settings of nMoonSourceIndex. Supply the time in millionths of a day, using MillionFromHMS.

 

The result is true only when the Moon's apparent altitude is strictly greater than 8 arcminutes (about 0.1333°), or another supported body's apparent altitude is strictly greater than 0°. Equality with the threshold returns false.

 

The function evaluates the position at the requested instant; it does not search for rising or setting events. Use a calculated Moon data source. A data-table source returns false; an undefined or unselected source causes an error.

 

The following example checks whether Jupiter is up at 22:00 local time on the date of the incoming macro token, using Moon data source 1.

nTime = MillionFromHMS(22,0,0)
sResult = ''
if PlanetIsUp(n_TokenDate,nTime,n_JUPITER,1)
    sResult = 'Jupiter is up at 22:00'
endif

Being “up” is not a prediction of naked-eye visibility. This test does not require a dark sky or check the body's brightness, weather or local obstructions. For the separate visibility model, see PlanetIsVisible.

 

See also: planetary macro functions.

 


Topic 179955, last updated on 12-Oct-2026