Hi there - within Astrobasic it is possible to use the planetaryhour() function to find both the hour ruler and the day ruler. Identifying these two critical planets is more difficult than it might appear, but correct application of the planetaryhour() function will ensure that you end up with the right result.
The following is from the function help page:
planetaryhour
Syntax: planetaryhour(real jd, real zone, real lon, real lat);
Action: returns the planetary hour, jd is UT.
(In my view, it is important to disregard the remaining information on the help page and use the function in the following way.)
In general identifying the hour ruler is straightforward, providing that you use the relevant julian date and the relevant time zone adjustment.
However, identifying the day ruler requires additional code to correctly identify the sunrise prior to birth. The planetary day ruler is constant from sunrise to sunrise, although the hour ruler varies throughout the day.
To do this, the following code seems to reliably identify the relevant sunrise and then the hour ruler of the sunrise time - this becomes the day ruler until the following sunrise.
:planetaryDay;
real jdRiseSet[7];
int useRise;
jdRiseSet[0] = getriseset(pDayJD - pDayZone - 2, SUN, 1, lon, lat, "") + pDayZone; ` sunrise previous day
jdRiseSet[1] = getriseset(jdRiseSet[0] - pDayZone, SUN, 0, lon, lat, "") + pDayZone; ` sunset previous day
jdRiseSet[2] = getriseset(jdRiseSet[1] - pDayZone, SUN, 1, lon, lat, "") + pDayZone; ` sunrise
jdRiseSet[3] = getriseset(jdRiseSet[2] - pDayZone, SUN, 0, lon, lat, "") + pDayZone; ` sunset
jdRiseSet[4] = getriseset(jdRiseSet[3] - pDayZone, SUN, 1, lon, lat, "") + pDayZone; ` sunrise next day
jdRiseSet[5] = getriseset(jdRiseSet[4] - pDayZone, SUN, 0, lon, lat, "") + pDayZone; ` sunset next day
jdRiseSet[6] = getriseset(jdRiseSet[5] - pDayZone, SUN, 1, lon, lat, "") + pDayZone; ` sunrise next day
i = 0; for (i < 7){
if (pDayJD + pDayZone > jdRiseSet[i] && pDayJD + pDayZone < jdRiseSet[i + 1]){
break;}}
` if chart time falls between rise and set, use preceding rise (i)
` else chart time falls between set and rise, use rise preceding set (i - 1)
if (i % 2 = 0)
useRise = i;
else
useRise = i - 1;
real diurnalArc = jdRiseSet[useRise + 1] - jdRiseSet[useRise];
` required
real minute = 1 / MINUTE;
day = planetaryhour(jdRiseSet[useRise] - pDayZone + minute, pDayZone, lon, lat);
return;
If you use this code carefully you should correctly identify the astrological ruler of the day.
Ed