Related Topics

Quick search

One of the most famous and reliable sources of astronomical almanacs is
the United States Naval Observatory. Ship captains were amongst the
earliest consumers of precision celestial data, since on the wide and
featureless expanses of the world’s oceans you can often deduce your
position only by comparing the altitude of the stars and Sun and Moon
against the time given by the ship’s clock.

If you want to compute rising and setting times that match the ones
given by the Navy in their Astronomical Almanac, then turn off
PyEphem’s native mechanism for computing atmospheric refraction near the
horizon. As explained above, you can do this simply by setting the
pressure of your observer to zero. Then, manually set
the horizon that you want to use to one that is exactly 34 arcminutes
lower than the normal horizon, to match the value by which the Navy
reckons that an object at the horizon is refracted:

To get the same results, we simply need to use the Navy’s longitude and
latitude for Atlanta (which their web page helpfully printed atop the
printout shown above) with the Observer that we constructed
above with the correct pressure and horizon settings:

As you can see, these values, given in Universal Time, match quite
precisely the USNO values given above in Eastern Daylight Time (which,
as you can see, runs four hours earlier). So, simply use these settings
whenever you want your results to match those of the Navy.

You will note that the Navy printout in the previous section contains
another kind of information, besides simple risings and settings: it
specifies the beginning and end of twilight, which is the time during
the morning and evening when there is light but the Sun is still below
the horizon.

To compute the beginning and end of twilight, ask when the Sun reaches a
position several degrees below the horizon. There are different horizon
values you should use depending on which twilight (civil, nautical, or
astronomical) you are interested in:

Civil twilight uses the value –6 degrees.

Nautical twilight uses the value –12 degrees.

Astronomical twilight uses the value –18 degrees.

Note, however, that these twilight definitions specify the position of
the center of the Sun, while the rising and setting functions normally
pay attention to the top edge of an object instead. To make them use
the Sun’s center, simply set the use_center parameter to True
when doing the calculation. For example, here is how you would use the
Observer created in the section above to calculate the civil
twilight in Atlanta: