Skip to content

ashokm2025/drik-panchanga

 
 

Repository files navigation

Drik Panchanga

Observational Indian lunisolar calendar using the Swiss ephemeris (Hindu Drig-ganita Panchanga).

Features

Computation of the five essentials of the panchangam:

  • Tithi
  • Nakshatra
  • Yoga
  • Karana
  • Vaara

Not just the values, but also the end times of tithis and nakshatras are computed. The only factor limiting the accuracy of the program output is the uncertainity in your input values (latitude, longitude).

Also includes computation of sunrise, sunset, moonrise and moonset.

By default, the month type is Amavasyanta (new moon to new moon) which is most prominent type of calendar used in South India.

NOTE: All timings are end timings. Timings displayed higher than 24:00 denote hours past midnight because the Hindu day (tithi) starts and ends with sunrise. If applicable, daylight savings (DST) are accounted for automatically based on the date and place entered in the textboxes.

Requirements

Python interface to Swiss ephemeris.

     pip install pyswisseph  # OR apt-get install pyswisseph

The core of the library (panchanga.py) can be imported into other code or used from the command line.

In order to just run the GUI (gui.py) you also need python-tz and wxPython (interface to wxWidgets):

    apt-get install python-tz
    apt-get install python-wxgtk2.8

If you want to modify the GUI (Gui.wxg), you must use wxGlade:

    apt-get install python-wxglade

How does it look?

Sample screenshot:

Sample screenshot

About the calendar

There are two schools of Indian calendar makers:

  1. Those who follow the rules of the Sūrya Siddhāntā (SS, Theory of the Sun) or its variants like Ārya Siddhānta of Aryabhata.
  2. Those who follow the Dṛk Siddhāntā (Empirical Theory).

SS contains semi-analytical equations for specifying the positions of sun and moon. However, the constants in these equations have to be updated regularly ( bīja saṃskāra ). But the equations in SS were last updated around 1000 CE, so they no longer match the planetary positions as we see today. For example, the date of solar eclipse as predicted by the equations of SS are off by many hours from its actual occurence. In spite of this, most Hindu maṭhas still publish yearly pañcāṅgas according to the rules of SS, in the name of preserving and practising tradition ( paramparā ).

The latter one, Drik school, still follow the general concepts from SS, but get the planetary positions from measured or observed data (dṛś = to see). Hence, their results match accurately with observed celestial phenomena. The Swiss Ephemeris is probably the best source available today for planetary calculations. It provides highly accurate databases of planetary data for about 10000 years. Hence, this panchanga is based on the Swiss Ephemeris. Other databases include those published by NASA's JPL (DE405) or the Moshier ephemeris.

References

These ones are helpful for implementing panchanga software:

  • Karanam Ramakumar, Panchangam Calculations
  • Second Level of the Astronomical Calculations in GCAL, used in ISKCON's GCal software.

This is the calendar book (though it mostly deals with Surya Siddhanta):

  • Dershowitz and Reingold, Calendrical Calculations, 3rd edition, 2008.

Similar software

Prof. M. Yanom's online interface to his Perl code -- this is the best version of the old Surya Siddhanta pancanga I've seen.

drikpanchang is a reliable online calendar for the Drik. However, it is neither open source nor do they have a desktop program.

Hindu Calendar for Android is another offline Drik calendar by Alok Mandavgane. Again, this is not open source.

Among open source programs, I found these two:

  • On Google Code: generates a pdf of panchanga for any year and place, but imprecise. For ex., tithi end timings are off by ten minutes sometimes. There is no GUI either.

  • On GitHub: Based on Paul Schlyter's semi-analytical model for planetary positions. This program gives the panchanga for a given instant but doesn't ask for a place's coordinates or timezone. This is probably because the program doesn't compute sunrise timings at all! The planetary model fails for dates outside the range 1800 CE to 2100 CE.

License

GNU Affero GPL version 3 (or later).

TODO

  • Festivals
  • Rahukaala, Yamaganda kaala

About

Observational Indian lunisolar calendar using the Swiss ephemeris (Hindu Drik Panchanga).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%