Please enable JavaScript to view this site.

 

bool = PlanetVisible(nDate, nSunSourceIndex, nPlanetID, bMorning, nRefTime, nRefOffset, nMinDuration)

 

This macro function determines if the planet of planetary index nPlanetID is visible on date nDate.

 

The allowed values for nPlanetID range from n_MERCURY to n_PLUTO.

bMorning determines if the function should look for morning or evening visibility.

nRefTime determines the reference point from which morning or evening is defined, and nRefOffset determines any offset from that reference point to use. The possible values of nRefTime are:

onRefTime = 0 midnight, in which case the value of nRefOffset is ignored.

onRefTime = 1 middle of the night (the half-way point between sunset and sunrise), in which case the value of nRefOffset is also ignored.

onRefTime = 2 absolute time, in which case nRefOffset corresponds to the time in the format HHNN (for example, 0530 for 5:30am).

onRefTime = 3 based on sunrise (if bMorning is true), or on sunset (if bMorning is false), in which case nRefOffset corresponds to the time span to look for visibility, in the format HHNN (for example, 0300 to look during the 3 hours before sunrise or the 3 hours following sunset).

onRefTime = 4 based on civil dawn (if bMorning is true), or on civil dusk (if bMorning is false), in which case nRefOffset corresponds to the time span to look for visibility, in the format HHNN (for example, 0100 to look during the hour before civil dawn or the hour following civil dusk).

onRefTime = 5 based on nautical dawn (if bMorning is true), or on nautical dusk (if bMorning is false), in which case nRefOffset corresponds to the time span to look for visibility, in the format HHNN (although, in the case of nautical dawn/dusk, you would usually use nRefOffset=0).

onRefTime = 6 based on astronomical dawn (if bMorning is true), or on astronomical dusk (if bMorning is false), in which case nRefOffset corresponds to the time span to look for visibility, in the format HHNN (although, in the case of  astronomical dawn/dusk, you would usually use nRefOffset=0).

nMinDuration determines the minimum length of time (in minutes) that the planet should be visible within the time span determined by nRefTime and nRefOffset. (for example, you would use 30 to specify that the planet should be visible for at least 30 minutes for the function to return a true result)

 

If you are not sure of the values to use for the last 3 parameters above, you can use nRefTime=3, nRefOffset=0300, and nMinDuration=30, which are reasonable for both morning and evening visibilities.

 

See also: planetary data exportation and planetary macro functions.

 


Topic 188995, last updated on 12-Apr-2026