How a panchang is checked against NASA JPL Horizons

A panchang tested against NASA JPL Horizons DE441 has correct Sun and Moon positions. That cannot confirm which tradition's rule applies to your festival.

Mihira7 min read
Panchang

How a panchang is checked against NASA JPL Horizons

Mihira, an iPhone panchang, calculates the Sun and Moon on the phone with the Swiss Ephemeris. It then tests those positions against NASA JPL Horizons (DE441), a public reference. A match shows that the astronomy is right: where the Sun and Moon are at a given moment. It does not show which tradition's rule decides your festival date.

Key takeaways

  • Verification here means one thing: the Sun and Moon positions from the phone match a trusted reference to a very small angle.
  • A tithi and a nakshatra are fixed by those two positions, so correct positions give correct start and end times for a city.
  • Verification cannot say which day is the festival. That depends on a rule from a text or a tradition, such as Smārta or Vaiṣṇava Ekādaśī.
  • The Swiss Ephemeris and Horizons are two separate sources, so agreement between them is a real check and not a copy.

What does a panchang need from astronomy?

A panchang reads two longitudes: the Sun's and the Moon's. A tithi is the gap between them, in steps of 12°. A nakshatra is the Moon's place along the sidereal zodiac, in steps of 13°20′. Sunrise for your city decides which tithi counts for the day, by the udaya tithi rule. Sunrise itself is covered in how a panchang finds sunrise.

So the astronomy has a narrow job. It must give the Sun and Moon longitude for any moment, and it must give sunrise for a city. If either is wrong, every time on the screen is wrong, however good the rules are. For the maths behind these definitions, see Surya Siddhanta vs modern ephemeris.

What is JPL Horizons, and why use it as the reference?

Horizons is NASA's Jet Propulsion Laboratory service for positions of the Sun, Moon, planets and spacecraft. It serves the JPL development ephemerides, which integrate the motion of the solar system from the laws of gravity and fit it to radar, laser-ranging and spacecraft data.

DE441 is one of two ephemerides published together in 2021. According to the JPL documentation, DE441 is a little less accurate than DE440 for the present century and more accurate across long spans in the past and future. It covers the years −13,200 to +17,191 (Park et al., 2021). A panchang must work for ceremonies decades from now and for dates centuries back, so the wide range is a good fit.

How do I verify panchang calculations against NASA JPL Horizons?

Request the Sun and Moon ecliptic longitude for one moment from Horizons, run the same moment through the panchang's calculation, and compare the two in arc seconds. Use the same kind of position and the same time scale for both. Then convert the gap to time: the Moon gains about 0.5° on the Sun each hour, so a small gap moves a tithi boundary very little.

Here is how that works for Mihira. The phone does not call Horizons. The app has no server and makes no network call. Horizons is the yardstick used while the app is built and tested. The Swiss Ephemeris is a separate piece of software that was itself derived from an earlier JPL ephemeris, DE431. The check therefore compares two independent implementations of the same sky. The ephemeris library gives positions. The panchang engine on top of it applies the rules.

The steps are:

  1. Choose test moments. Pick dates and times across many years, including moments near a tithi change, where a small error matters most.
  2. Ask Horizons. Download the Sun and Moon ecliptic longitude for each moment from the reference.
  3. Ask the phone code. Run the same moments through the Swiss Ephemeris calculation that the app uses.
  4. Match the settings. Compare the same kind of position (geocentric, with the same time scale). A mismatch here creates an error that looks like an astronomy fault and is not.
  5. Measure the gap. Record the difference in arc seconds and convert it to minutes of time on the tithi boundary.

The reader does not need to trust this blindly. Horizons is public, so anyone can request the same positions and compare.

How small does the gap need to be?

The Moon gains about 12° on the Sun each day, so a tithi lasts about 24 hours on average, though the length of a single tithi varies. That makes 1° of error worth about 2 hours.

A panchang prints times to the minute. So a position error of a few arc seconds is far below what anyone can see on the screen. The test is useful because it catches large mistakes, such as a wrong time zone, a wrong time scale or a bad ayanamsa step, which would shift a boundary by minutes or hours.

What does verification confirm, and what can it not confirm?

QuestionCan Horizons settle it?Why
Where are the Sun and Moon at 6:21 AM in Edison, New Jersey?YesIt is a measured astronomical fact.
When does this tithi start and end?YesIt follows from the two positions and a fixed 12° definition.
When is sunrise in this city?PartlyThe Sun's position comes from the reference. The sunrise definition (upper limb, refraction) is a choice.
Which ayanamsa gives the sidereal zodiac?NoTraditions fix the zero point differently.
Which day is Ekādaśī for my household?NoSmārta and Vaiṣṇava rules read the same tithi differently.
Is Rahu kalam inauspicious?NoIt is a custom, not a measurement.

The pattern is simple. Horizons answers questions about the sky. It cannot answer questions about what a text or a community says to do under that sky.

Where does the tradition's rule come in?

After the positions are right, a rule picks the day. For example, a festival tied to a tithi may need that tithi at sunrise, at midday or at moonrise. Two sound traditions can apply different rules to the same correct positions and name different days. That is why festival dates differ between countries and communities, and why Smārta and Vaiṣṇava Ekādaśī can fall a day apart.

Mihira handles this in the open. Each rule cites its source text. Where traditions differ, the app shows the common date first, names the tradition and notes the alternative. When a rule cannot be completed, the screen says so and does not guess. The method is set out in how a panchang rule is sourced.

What are the limits of this check?

  • It covers positions, not rules. The rule layer is checked by reading the cited text, not by an ephemeris.
  • It tests the dates and moments chosen. It is a sample across time, not a proof for every second.
  • It depends on matching settings. The reference and the phone must use the same kind of position and time scale.
  • The Swiss Ephemeris and DE441 are different JPL generations. They agree closely for the Sun and Moon, but a small gap is expected and is measured, not hidden.
  • It assumes the city's coordinates and time zone are right. Those come from the app's offline catalogue of 34,135 cities, and they are not part of the Horizons comparison. See city versus GPS precision.

How can you check a panchang yourself?

  1. Look for the source behind each rule, not only the time. A panchang that names a text can be checked. One that gives only a time cannot.
  2. Check that the times are for your city and not for India or another city. The panchang app checklist lists more tests like this.
  3. Find out which tradition it follows for the festival you keep, and whether it shows the alternative.
  4. Ask your priest or temple which rule your family follows. That answer settles the date, not the software.

FAQ

Does Mihira use NASA JPL Horizons on the phone?

No. Mihira calculates on the phone with the Swiss Ephemeris and makes no network call. Horizons is the reference its results are tested against.

Does a Horizons match mean the festival date is right?

No. A match means the Sun and Moon positions, and so the tithi and nakshatra times, are right. The festival date also depends on a rule from a text or tradition, which Horizons cannot check.

What is DE441?

DE441 is a JPL planetary and lunar ephemeris published in 2021. It is slightly less accurate than DE440 for the present century and better over long spans, covering the years −13,200 to +17,191.

Why can two correct panchangs show different dates?

They can apply different rules to the same correct positions. For example, one may count a tithi at sunrise and another at midday, or one may follow the Smārta view and another the Vaiṣṇava view.

Can I check a panchang against Horizons myself?

Yes, for positions. Horizons is public, so you can request the Sun and Moon longitude for a moment and compare it. You cannot check the rule that way.

Mihira shows the time, the rule behind it and the text it comes from, so you can check each part. Read more on mihira.app. Mihira is free in the beta and is in App Store review.

More to read