I'm trying to generate the longitudes of planets. I've used the swiss ephemeris dll to do all my hard work. However to my misfortune the values generated by swiss ephemeris for the sidereal mode Lahiri Ayanamsha is way off (by around 25 minutes, especially for moon) from what I'm getting out of other vedic software or online portals including JuniorJyothsh
I've downloaded the .se1 files(for planets and moon) and am using the very accurate Swiss Ephemeris mode. Further I've set the Sidereal mode, the Lahiri Ayanmsha Flag, Topocentric Flag. I've also set the topolgy latitude and longitude location.
What bothers me most is that the values from all other online vedic natal chart generators including Jumior Jyothish seem to match with each other. I'm not sure what it is that I'm doing wrong. Here's a link to my code Swiss ephemeris used in .NET on git with a sample code snippet
[Test]
public void ShouldGetAllPlanetValues()
{
var errorMessage = new StringBuilder(1000);
var longitudeAndLatitude = new Double[6];
var cusps = new Double[13];
var ascentantAndMore = new Double[10];
var julianDayNumbersInEtAndUt = new double[2];
TimeZoneInfo indiaTimeZone = TimeZoneInfo.FindSystemTimeZoneById(IndiaStandardTimeZoneId);
var ephemerisTablesPath = new StringBuilder(@"../../../EphemerisFiles/");
swe_set_ephe_path(ephemerisTablesPath);
var birthTimeInIndianZone = new DateTime(1989, 8, 21, 10, 29, 0);
DateTime birthTimeInUtc = TimeZoneInfo.ConvertTimeToUtc(birthTimeInIndianZone, indiaTimeZone);
int errorCOde = swe_utc_to_jd(birthTimeInUtc.Year, birthTimeInUtc.Month, birthTimeInUtc.Day,
birthTimeInUtc.Hour, birthTimeInUtc.Minute, birthTimeInUtc.Second, 1,
julianDayNumbersInEtAndUt, errorMessage);
if (errorCOde != 0)
{
Assert.Fail("Error ho gaya julian date conversion par !!");
}
Console.WriteLine("Julian Day Number from UTC: " + julianDayNumbersInEtAndUt[1]);
Console.WriteLine(swe_sidtime(julianDayNumbersInEtAndUt[1]));
var computationFlag = EphemerisModes.Sidereal | EphemerisModes.SwissEphemeris
| EphemerisModes.Topocentric;
var longitude = ConvertDegreeAngleToDouble(80, 15, 0);
var latitude = ConvertDegreeAngleToDouble(13, 4, 0);
swe_set_topo(12.9667, 77.5667, 0);
swe_set_sid_mode(SiderealFlag.Lahiri, 0, 0);
foreach (var planet in Planets.AllPlanets)
{
int sweCalcUt = swe_calc_ut(julianDayNumbersInEtAndUt[1], planet, computationFlag, longitudeAndLatitude, errorMessage);
Console.WriteLine("Planet Number " + planet + ": " + GetDegreesMinutesSeconds(longitudeAndLatitude[0]));
}
swe_houses_ex(julianDayNumbersInEtAndUt[1], EphemerisModes.Sidereal, 12.9667, 77.5667, 'A', cusps, ascentantAndMore);
Console.WriteLine("Ascendant: " + GetDegreesMinutesSeconds(ascentantAndMore[0]));
}
Here's a sample of how different the values are for my own birth date (21-August-1989 10:29 AM) Generated from Swiss ephemeris as per my code :
Planet Number 0: 124:24:30 SUN
Planet Number 1: 359:38:55 Moon
Planet Number 2: 150:20:40 Mercury
Planet Number 3: 160:0:11 Venus
Planet Number 4: 137:26:47 Mars
Planet Number 5: 70:20:45 Jupiter
Planet Number 6: 253:56:35 Satrun
Planet Number 10: 301:46:40 Rahu (Mean Node)
Ascendant: 187.27:46
Value form most other sources (JuniorJyothish, ProKerala, NadiAstrology, Astrosage):
Planet Number 0: 124:24:35 SUN
Planet Number 1: 0:6:21 Moon
Planet Number 2: 150:20:45 Mercury
Planet Number 3: 160:00:17 Venus
Planet Number 4: 137:26:56 Mars
Planet Number 5: 70:20:57 Jupiter
Planet Number 6: 253:56:48 Satrun
Planet Number 10: 301:46:52 Rahu
Ascendant : 187:28:6 Ascendant
Any help/hint/suggestion to point me in the right direction is deeply appreciated.
Thanks