I posted such a question in space.stackexchange ( https://space.stackexchange.com/questions/46077/which-are-the-correct-input-parameters-for-nasa-horizons-query-to-get-the-right?noredirect=1#comment150190_46077 ), but probably it fits better here, being it a "topocentric problem", although for other planets than Earth; we could call it "eso-astronomy" ;-)

I am trying to figure out how to retrieve the right data from Nasa Horizons to plot sun analemmas as seen from other worlds; I found a query which works fine for Earth, but upon changing the observer location from Earth to other planets, things get weird, and I get wrong curves w.r.t "official" curves (although there is not a single analemma curve for each planet, but different curves for different times).

This is the query I am using for Earth analemma centered on Greenwich at 12.00:

Result: Greenwich analemma 12:00

Using same coordinates on mars, a longer period, and 1477 minutes as interval (martian day length), I don't get the right plot (link):

Mar analemma 12:00 at "Greenwich" (latitude 51.48)

The right analemma on Mars is this:

Mars real analemma

I noticed that Earth analemmas are plotted against Azimuth, but Mars analemmas are plotted against Equation of Time. Why? And how can I do by myself such a plot in Excel?


2 Answers 2


You did two things wrong, one minor, the other major. The minor thing that you did wrong was to chose the solar system barycenter as the target rather than the Sun. Use the Sun.

The major thing you did wrong was to use a step size of 1477 minutes. That is (to within a minute) the length of a Mars sidereal day. The Sun will march across the horizon if you use a sidereal day. What you want is a Mars solar day, which is 1479 minutes and 35 seconds long.

This presents a new problem. Ideally your step size should be 88775 seconds. But you cannot choose seconds as the unit of a step size. You're stuck with minutes, and that is suboptimal. There is another approach:

  • Choose the "equal intervals (unitless)" option for the step size,
  • Make the time difference between the start and end time be an integral multiple of 88775 seconds, and
  • Specify the step size as the integral multiple chosen to determine the time span.

For example, choosing 711 as the integral multiple and 2020-Aug-20 12:00:00 as the start time means the end time should be 2022-Aug-21 01:03:45. You might need to tweet the end time to get the analemma to close up properly.

I noticed that you used the center of Mars. You need a point on the surface to get a proper analemma. Horizons provides several predefined points. If you choose Viking 1 / Chryse @499, you'll have to modify the start and end times so that the Sun is above the horizon. Add 12 hours to the start and end times shown above appears to work very nicely for Viking 1's location.

Below is what I get plotting the Sun's elevation vs azimuth as seen from the Viking 1 / Chryse location, with 711 intervals (712 data points) sampled over the period 2020-Aug-21 00:00:00 to 2022-Aug-21 13:03:35 UT.

Mars analemma using data retrieved from Horizons for the Viking 1 / Chryse location. The horizontal and vertical axes are azimuth and elevation, both in degrees

  • $\begingroup$ Thanks, it worked using 711 and suggested dates. I wanted to try that, but I was struggling in convincing Excel giving me the result of today+711 days... :-) But please note that Mars location was already right: I specified "CENTER='coord@499'" and used the triplet "0,51.48,0" (lon, lat, altitude) (SITE_COORD='0,51.48,0'). You can also check it in the output: Center geodetic : 360.000000,51.4800000,-8.38E-13 {W-lon(deg),Lat(deg),Alt(km)} Playing with Horizons urls and/or site is a mess, that's why I set up my own GUI: win98.altervista.org/space/exploration/NHUGUI.html $\endgroup$
    – jumpjack
    Aug 20, 2020 at 15:27
  • $\begingroup$ I did a test with martian year duration in sols (668) and it works fine too. Unfortunately I didn't have same luck with Venus, which has very peculiar data: 1,92 sols in a Venus year, 116 days in a sol. I tried with 2020/08/20 12:00 , 2082/02/21 12:00 and 192 steps but it does not work. $\endgroup$
    – jumpjack
    Aug 20, 2020 at 17:08
  • $\begingroup$ @jumpjack -- The concept of an analemma implicitly assumes a body that rotates about its own axis much more quickly than it orbits the Sun. For a body that does rotate quickly, the position of the Sun in the sky will be but slightly different than it was exactly one solar day earlier. The progression over the course of one orbit will result in a large number of points that form a nice curve that is easily discernible to the eye. But if the planet rotates very slowly, the jump from one day to the next will be large and you will not get this nice, easily-discernible curve. $\endgroup$ Aug 20, 2020 at 22:58
  • $\begingroup$ Yes but this site provides analemmas for all planets: pbarbier.com/eqtime/eqtime.html $\endgroup$
    – jumpjack
    Aug 21, 2020 at 8:14

Thanks to the help from @DavidHammen, here it is an example of correct URL/query to get Mars analemma.

In readable format:

  • https://ssd.jpl.nasa.gov/horizons_batch.cgi?batch=1
  • COMMAND='10' (Target = Sun; do not confuse with "0", Solar System baricenter)
  • CENTER='coord@499' (Observer on Mars surface)
  • OBJ_DATA='yes'
  • MAKE_EPHEM='yes'
  • SITE_COORD='0,90,0' (Mars location on surface; Longitude, Latitude, Altitude)
  • START_TIME='2020-08-20 12:00:00'
  • STEP_SIZE='668' (Number of segments the start-stop interval is split into. This number determines the length of the day; the martian solar day (*) lasts 88775 seconds, or 1479 minutes and 35 seconds, but Horizons does not allow specifying step in seconds neither in fractional minutes. And specifying 1479 or 1480 would result in a wrong analemma curve. But Horizons accepts a dimensionless parameter, which means "number of steps between given dates". Hence, you will put here the number of Sols between start and stop date. One martian year last 668.6 sols. Both 668 or 669 will give right results, just a shorter or longer curve, as long as same value is used to calculate STOP_TIME.)
  • STOP_TIME='2022-07-07 20:44' ("Stop time" minus "start time", expressed in seconds, must be multiple of 88775 seconds, the duration of Martian solar day (*). In a spreadhseet, you would add to the start date: (88775 * NumberOfSols) / 86400 )
  • QUANTITIES='4' (Output=Altitude/Azimuth)
  • REF_SYSTEM='J2000'
  • VECT_TABLE='3'
  • SKIP_DAYLT='no'
  • EXTRA_PREC='yes'
  • CSV_FORMAT='yes'
  • VEC_LABELS='yes'
  • ELM_LABELS='yes'
  • R_T_S_ONLY='NO'

Possibly not all parameters are mandatory, this URl is automatically generated by NHUGUI.

Highlighted are the parameters specific for the analemma.

Picture below show analemmas generated for Time 12:00 at longitude 0° and latitudes 0°, 45° and 90°.

Mars analemmas

This image shows how to setup a spreadsheet to automatically calculate stop date, given start date, year duration in sols and sol duration in earth-seconds: Spreadhseet setup

(*) NOT sidereal day; by definition, solar day is relative to Sun rather than stars, and analemma is a curve relative to Sun. A Mars solar day is named "Sol" and lasts 88775.245 Earth-seconds


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .