Sunday, July 05, 2009

[Hack]: Rahu Kalam Calculator

Rahu Kalam, in Indian Astrology, is considered that part of the day which is inauspicious for starting new activities or performing good deeds. More on how to calculate Rahu Kalam at Wikipiedia. Essentially, Rahu Kalam is supposed to be calculated on the basis on the sunrise and sunset times, which in turns depends on where you live. Calculating this is quite tedious.

In India, since it is mostly South Indians who believe in Rahu Kalam, they tend to assume that sunrise and sunset is 0600 and 1800 Hrs respectively. This leads to fixed times of the Rahu Kalam on each day of the week. This, however, could be wrong depending on the seasons. Even more importantly, this would be quite wrong in others parts of the world. In Singapore, sunrise is rarely before 7.00 AM and in Scandinavian counties, sunrise and sunset hugely varies depending on the season. So, I decided to write a hack to automate all this.

So the site is at:
http://rahukalamcalculator.appspot.com/

Essentially, you need to tell where you are from (Bangalore, Hyderabad, New York etc) and based on the lat-long on that location, it will calculate the Sunrise Sunset times and tell you the Rahu Kalam for the next 3 days. You are of course free to choose a specific date and find the Rahu Kalam for that date. The system will remember your location choice and not ask you next time. (You can choose to clear it, of course)

The hack itself involves using a bunch of webservices - the Yahoo Maps Webservice for geocoding a location and getting its latitude and longitude. Second, I used the Earthtools API to get the sunrise and the sunset of a given location. Everything else is calculated internally. I have hosted it on Google App Engine.

Please test the tool and give me your much-sought-after feedback/suggestions etc. You may also tell me what you want to see there.

I will clean up the code in a while and post it in public.

Administrative note

All tech posts have now moved to http://tech.shreeni.info or you may subscribe to its RSS feed. In due course, I shall be moving it out completely, so if you follow my tech posts, please shift to following that blog.