Lunar4 Operation

main window

The main window appears first and is always visible. Initially, only the Body #1 button enabled. (In general, if a control is disabled the program wants you to do something else first.) By clicking the top four buttons in order, you open dialog boxes to select the celestial bodies and input the observer's position and time. Then the OK button is enabled.

Observed angles and limbs are entered in this window. Decimal values are OK in the degrees, minutes, and seconds boxes. For example, if the angle is decimal degrees, enter it in the degrees box and zero or nothing in the minutes and seconds boxes. An empty box is the same as zero. Do not enter negative numbers. This method of entering angles is legal throughout the program regardless of the units setting (D.d, DM.m, or DMS.s), which affects only the output.

The precision setting (above the OK button) affects the parts of the computation that are iterative; they stop when the requested accuracy is attained. It also affects the rounding of angles and times to an appropriate display resolution. Sometimes this is noticeable in the output, particularly for time, when Lunar4 seems to not use the exact value you entered. Actually it does. But the appropriate rounding unit for time is based on a 1 to 15 ratio. So, if .1 arcminute (= 6 arcsecond) precision is selected, times are rounded to the nearest 6/15 second. Other puzzling behavior can occur very near the top of a minute, when seconds may slightly exceed 60 instead of rolling over to the next minute (and you are not in a leap second). These minor anomalies are harmless when you understand the cause.

Immediately above the OK button is the "solve for time" check box. By default it is not checked, and Lunar4 just reports the positions of the two bodies you selected. If you entered any angles (it's not required), Lunar4 displays the difference between your angle and its computation. If the box is checked, the time solution mode depends on the data:

Note: in a classic lunar solution Body #1 must be the Moon. If another body is selected it is possible to check the "solve for time" box, but the solution will fail. To help avoid mistakes, the Moon is not available in the Body #2 dialog box.

The "dip correction" check box corrects the altitudes for dip of the sea horizon with a formula based on the optical principle of the refractive invariant. It's affected by air pressure and temperature at the observer. A temperature lapse rate of -0.009 °C per meter is assumed. This duplicates the Nautical Almanac dip table at 10 C and 1010 mb.

The Moon center of figure correction box applies the standard corrections of +.5″ and -.25″ to longitude and latitude "to help correct for the difference between the center of figure and the center of mass." (see Astronomical Almanac eclipse section.) This affects the geocentric and topocentric coordinates and the solution.

Body Select Dialog

body select dialog

The Body #1 and #2 buttons on the main form open this dialog box. To avoid confusion, only #1 has the Open Ephemeris button enabled. You cannot OK out of the #1 dialog until you open a JPL ephemeris because the computation of apparent place (even for a star) requires the position and velocity of the Earth and the position of the Sun, which come from the ephemeris.

Lunar4 accepts any JPL binary ephemeris. (But the full accuracy of pre-403 ephemerides will not be realized because the program assumes the ephemeris is referred to the ICRS.) The JPL download site offers alternate versions of some recent ephemerides because they have too many constants for legacy software. That's not an issue for Lunar4.

However, the Lunar4 binary ephemeris format is not compatible with previous software. This is actually due to the SofaJpl astronomy DLL, not Lunar4 itself. SofaJpl 2.0 eliminated some limitations in the JPL Fortran code, but to do that I had to use a new file format. See the SofaJpl 2.0 page for more.

All stars of third magnitude or brighter are in the program's internal catalog. (Data are from the Hipparcos catalog new reduction.) Enter a designation in the box and click Search. Generally, if a star has a well known proper name, try that first, then the Beyer designation (with the Greek letter coding and constellation abbreviation in SIMBAD format), then the Flamsteed designation. Many stars have more than one entry. For example, either polaris or alf umi finds Polaris. (The search is not case sensitive.) A substring may be entered. For example, zuben will find Zubenelgenubi. In a few cases there is a suffix in the designation, such as alf02 CVn, so try adding 01 or 02 after the Greek letter if a search fails. Finally, the SIMBAD query by identifiers page may help you guess what identifier I used. Or, examine the lookup table with a text editor. It's in the same directory as the executable.

All search hits are listed in the "search results" box. Magnitude of each star is displayed to assist identification. Select one star and click OK.

Lunar4's star catalog is two separate XML files in the same directory as the executable. One converts a designation, such as "Polaris" or "alf UMi", to Hipparcos catalog number. The other converts Hipparcos catalog number to the catalog data (RA, declination, etc.). Despite their .vot filetype, these files can be viewed and modified with any text editor. Instructions are in the files.

A star not in the catalog may be input with the "Enter Star Data" button. More on that elsewhere.

Ephemeris Tools Dialog

ephemeris tools

This dialog box converts planetary ephemerides from the ASCII format at the JPL download site to the binary format the program needs. See the JPL Planetary and Lunar Ephemerides page for information on the available ephemides and a link to the anonymous FTP download site. For example, if you want the DE406 ephemeris for years +2000 through +2099, download ascp2000.406. (The "p2000" means +2000 vs. "m2000" for -2000.) Download the DE406 ASCII header file (header.406) too. The files may be put in any convenient location. Select the ASCII to binary option, then choose the input and output files with the buttons at the bottom of the window. For a binary file name I recommend the same name as the ASCII file, except "bin" instead of "asc". If the conversion is successful it runs silently and the dialog box disappears.

Some header files have two versions. One is for backward compatibility with old software. That's not an issue for this program, so either header is good. However, there are two important points:

1. When JPL provides two headers, they have different file extensions, e.g., header.430_229 and header.430_572. But the program requires the header file and ASCII ephemeris file to have the same extension, so you must rename the header to header.430.

2. When you attempt conversion from ASCII to binary, an error message may say the header has the wrong number of constants. That's caused by the strict error checking in the SofaJpl DLL. The fix is simple; see the Bugs section on the SofaJpl page.

If the read-only file property is true, two or more instances of Lunar4 can share the same binary ephemeris. The property must be controlled via Windows; you have no access to it from Lunar4.

This dialog box also has functions to merge two binary ephemerides into a third ephemeris, or extract a time subset of an ephemeris. In the merge function, the input files must abut or overlap in time.

Star Input Dialog

star data dialog

Star data may be entered manually in this dialog box. The coordinate system must be the ICRS. Default epoch, J1991.25, is that of the Hipparcos catalog. Right ascension may be entered in hours or degrees. All flavors of sexagesimal are legal, e.g., RA may be entered as a single decimal value with minutes and seconds boxes blank. Proper motion in RA may be milliseconds of arc or milliseconds of time per year, and expressed in coordinate units or great circle units. (The defaults are the most common in modern catalogs.) The minimum usable parallax is 0.1 nanosecond of arc; if the value is less (including zero or negative) the program automatically puts the star at 10 gigaparsecs to avoid numeric difficulty.

Radial velocity has practically no effect unless the star has very high proper motion (in which case you would not expect great accuracy anyway). In the preparation of the Hipparcos catalog, the only stars 6th magnitude or brighter whose radial velocity had to be taken into account were mu Cas, e Eri, omicron Eri, alpha Cen, 61 Cyg, and epsilon Ind.

Topocenter Dialog

topocenter dialog

Latitude and longitude may use any coordinate format. For example, you can enter integer degrees and decimal minutes. (Enter zero in unused boxes to avoid an error message.) The coordinate datum is assumed to be WGS84 or ITRS, which are practically identical.

The "above ellipsoid" label on the height box is not strictly correct. For the air data computations, the height you enter is assumed to be above the geoid (sea level).

Meteorological data are entered on the right side of the window. Standard temperature is the ICAO value for that height. Standard altimeter setting is 1013.25 mb (29.9213 inches Hg). Actual air pressure (station pressure) for the refraction correction is computed from height and the altimeter setting. Note that in the U.S., at least, "barometric pressure" is the altimeter setting.

If only station pressure is known, first run the program with the "standard altimeter setting" box checked. Observe the station pressure in the output, un-check the "standard altimeter setting" box, and adjust altimeter setting until station pressure is the desired value.

Typical variations in temperature generally have much greater effect on refraction than typical variations in pressure. For instance, 10° up or down from 60° F causes about 2% change in air density and refraction. To do that with air pressure would require about .60 inch Hg variation in the barometer.

Time Dialog

time dialog

Time is entered in this dialog box as a Gregorian or Julian calendar date, Julian Date, Besselian epoch, or Julian epoch. (The latter three are not very useful in this application. They are present because I took this dialog from another program.) BC years may be designated with the check box, or entered in algebraic form, where 0 = 1 BC, -1 = 2 BC etc. Don't use both methods simultaneously. The range of legal years somewhat exceeds 5 million BC to 5 million AD, but the full range isn't usable because the JPL ephemerides don't go that far. Nor is the precession nutation model accurate over such an extreme time span.

Time scales UTC, UT1, Terrestrial Time, Greewich apparent time, local apparent time, and local mean time are available. (The last three are mainly useful for analyzing historic observations.) Input is assumed to be in the selected time scale, and the output is in that scale too. The exceptions are the B and J buttons, which automatically select the correct scale and disable the others.

To enable UTC, you must first open a leap second file with the button. The installation instructions have a link to a suitable file. An error occurs if you use a UTC outside the range of the leap second file. That's a good thing. It reminds you that maybe the file needs updating, which is easily done with a text editor. Instructions are in the file itself.

Time resolution in any scale is better than one nanosecond anywhere in the legal date range. The seconds box isn't wide enough to show that many decimal places at once, but you can enter them. That's also true for the JD box: the string you enter is processed as separate integer and fractional parts to maintain full accuracy. The Besselian and Julian epochs have less accuracy: "only" about 15 significant digits.

The TT-UT1 difference ("delta T") is automatically provided by a model which linearly interpolates the table in section K of The Astronomical Almanac. Outside that range, I use the polynomial expressions for delta T available on the Web thanks to Fred Espenak at the Eclipse Home Page. The delta T model may be turned off for manual control.

If UTC is the time scale, the delta T controls are disabled and the UT1-UTC box enabled. There's no automatic option for this value since long term predictions are impossible. Predictions a year in advance are in IERS Bulletin A, and past values in Bulletin B.

Return to Lunar4 Main Page

(page last modified 2016-09-21)