home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / EFFO / pd8.lzh / DOC / ephem.doc
Text File  |  1990-04-13  |  60KB  |  1,533 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                             Ephem V4.13 - April 3, 1990
  8.  
  9.                     Copyright (c) 1990 by Elwood Charles Downey
  10.                                Chaska, Minnesota, USA
  11.  
  12.  
  13.                                  Table of Contents
  14.       1.  Introduction ...................................................  3
  15.       2.  Running Ephem ..................................................  3
  16.       2.1.  Command Line Format ..........................................  3
  17.       2.2.  Program Operation ............................................  4
  18.       3.  Screen Fields ..................................................  5
  19.       3.1.  Top Screen Fields ............................................  5
  20.       3.2.  Data format columns ..........................................  6
  21.       3.3.  RiseSet format columns .......................................  7
  22.       3.4.  Separation format fields .....................................  7
  23.       4.  Date and Time Formats ..........................................  8
  24.       5.  Configuration File .............................................  8
  25.       5.1.  Configuration File fields ....................................  9
  26.       5.2.  Example ephem.cfg ............................................ 10
  27.       6.  Menu options ................................................... 11
  28.       6.1.  Adaptive vs. Standard hzn .................................... 11
  29.       6.2.  Geocentric vs. Topocentric ................................... 11
  30.       7.  User Defined Objects: X and Y .................................. 11
  31.       7.1.  Controlling Object-X or Y Operation .......................... 11
  32.       7.1.1.  Fixed ...................................................... 12
  33.       7.1.2.  Elliptical ................................................. 12
  34.       7.1.3.  Parabolic .................................................. 13
  35.       7.1.4.  Lookup ..................................................... 13
  36.       7.1.5.  On or Off .................................................. 14
  37.       7.2.  Database File ................................................ 14
  38.       8.  Plotting ....................................................... 14
  39.       8.1.  Defining plot fields ......................................... 15
  40.       8.2.  Displaying a plot file ....................................... 15
  41.       8.3.  Cartesian or Polar coords .................................... 15
  42.       8.4.  Begin Plotting ............................................... 15
  43.       8.5.  Stopping Plotting ............................................ 15
  44.       9.  Watching ....................................................... 16
  45.       9.1.  Trails ....................................................... 16
  46.       9.2.  Sky .......................................................... 16
  47.       9.3.  Solar System ................................................. 16
  48.       10.  Searching ..................................................... 17
  49.       10.1.  Find extreme ................................................ 17
  50.       10.2.  Find 0 ...................................................... 17
  51.       10.3.  Binary ...................................................... 17
  52.       10.4.  Define a New function ....................................... 18
  53.       10.4.1.  Intrinsic functions ....................................... 18
  54.       10.4.2.  Field Specifiers .......................................... 18
  55.       10.4.3.  Constants ................................................. 19
  56.       10.4.4.  Operators ................................................. 19
  57.       10.5.  Specifying Search Accuracy .................................. 19
  58.       10.6.  Stop ........................................................ 20
  59.       10.7.  Example Searches ............................................ 20
  60.       10.8.  Another Example ............................................. 20
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                        - 2 -
  71.  
  72.  
  73.       10.9.  Caution ..................................................... 20
  74.       11.  Implementation Notes .......................................... 21
  75.       11.1.  Program limits .............................................. 22
  76.       12.  DOS Installation Procedure .................................... 22
  77.       12.1.  Setting TZ .................................................. 22
  78.       13.  Wish List ..................................................... 23
  79.       14.  Sample Screens ................................................ 24
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                        - 3 -
  137.  
  138.  
  139.      1.  Introduction
  140.  
  141.      Ephem is a program that displays ephemerides for all the planets plus any
  142.      two additional objects.  The additional objects may be fixed or specified
  143.      via heliocentric elliptical or parabolic orbital elements to accommodate
  144.      solar system objects such as comets or asteroids.
  145.  
  146.      Information displayed about each object includes RA and Dec precessed to
  147.      any epoch, heliocentric coordinates, local azimuth and altitude, distance
  148.      from sun and earth, solar elongation, angular size, visual magnitude,
  149.      illumination phase, local rise, transit and set times, length of time up,
  150.      and topocentric or geocentric angular separations between all combinations
  151.      of objects.
  152.  
  153.      Observing circumstance information includes UTC and local date and time,
  154.      local sidereal time, times of astronomical twilight, length of day and
  155.      night, local temperature, pressure and height above sea level for the
  156.      refraction model and a monthly calendar.
  157.  
  158.      RA/Dec calculations are geocentric and include the effects of light travel
  159.      time, nutation, aberration and precession.  Alt/az and rise/set/transit
  160.      and, optionally, angular separation calculations are topocentric and
  161.      include the additional effects of parallax and refraction.
  162.  
  163.      A running plot file of selected field values may be generated as the
  164.      program runs.  Ephem includes a very crude quick-look facility to view
  165.      these plot files or they may be plotted by other programs.
  166.  
  167.      One may watch the sky or the solar system with a simple screen-oriented
  168.      display.
  169.  
  170.      Ephem may be asked to search for interesting conditions automatically,
  171.      using several algorithms. Most fields displayed on the screen may be used
  172.      as terms in an arbitrary arithmetic expression that can be solved for zero
  173.      or minimized or maximized, or the time of state change of any boolean
  174.      expression can be found.
  175.  
  176.      The program is written in C for unix or DOS. It uses only a very simple
  177.      set of io routines and should be easily ported to any ASCII display.
  178.  
  179.      The planetary data and correction algorithms are taken, with permission,
  180.      from "Astronomy With Your Personal Computer", by Peter Duffett-Smith,
  181.      Cambridge University Press, 1985.
  182.  
  183.      2.  Running Ephem
  184.  
  185.  
  186.      2.1.  Command Line Format
  187.  
  188.      To run ephem, just type "ephem".  You may also specify an alternate
  189.      configuration file, an alternate database file, and specify initial values
  190.      for several screen fields.  The command line syntax can be summarized as
  191.      follows:
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                        - 4 -
  203.  
  204.  
  205.          ephem [-c <config_file>] [-d <database_file>] [field=value  ...]
  206.  
  207.  
  208.      2.2.  Program Operation
  209.  
  210.      When ephem starts, it first displays a disclaimer banner.  Then, after any
  211.      key is pressed, it reads a configuration file to set the initial values of
  212.      several fields.  If OBJX or OBJY is set then a database file is also
  213.      accessed.  The default configuration file name is ephem.cfg (or .ephemrc
  214.      if the HOME environment variable directory if set).  The default database
  215.      file name is ephem.db.  The exact format of these files is described
  216.      below.  Then ephem processes any additional command line arguments exactly
  217.      as if they too came from the configuration file.  (See the later section
  218.      on this manual for a description of the possible entries.) It then draws
  219.      all fields on the screen with their initial values.  The program then
  220.      loops advancing time each step, by some amount you may control, and
  221.      updating all fields each loop.
  222.  
  223.      There are two fields that control this looping behavior: NStep and StpSz.
  224.      These control the number of steps and the amount of time to add each step,
  225.      respectively. When the number of steps, NStep, goes to 0 or any key is
  226.      pressed, the looping stops and you enter a command mode.
  227.  
  228.      Command mode allows you to modify most of the fields.  The idea is that
  229.      you move to each field on the screen you wish to change and change it.
  230.      When you have changed everything you want to, type "q" to resume screen
  231.      updates.
  232.  
  233.      To change a field:
  234.  
  235.          1) move the cursor to the field (see below);
  236.          2) type RETURN;
  237.          3) type in the new value along the command line at the top according
  238.             to the format indicated in the prompt. To accept the new value
  239.             type RETURN, or to leave it unchanged after all type "q".
  240.  
  241.  
  242.      A few fields don't require you to type anything; just typing RETURN does
  243.      all the work.  If you can't move to it, you can't change it.
  244.  
  245.      The arrow keys on most systems move the cursor around.  If these do not
  246.      function or function incorrectly, the h/j/k/l keys also move the cursor
  247.      left/down/up/right, respectively.  Motions off any edge of the screen will
  248.      wrap around.  You may also move the cursor immediately to a planet row by
  249.      typing one of the characters SMevmjsunpxy.  To avoid conflict with j,
  250.      jupiter's row must actually be typed as control-j.  "x" and "y" are for
  251.      the user-defined objects X and y on the bottom rows.  Also, the characters
  252.      d, o and z move you to the UT Date, Epoch and StpSz fields immediately, if
  253.      appropriate.
  254.  
  255.      When you have changed a field that would invalidate any of the other
  256.      fields the message NEW CIRCUMSTANCES appears in the top center of the
  257.      screen.  This will remain until you type "q" to allow at least one screen
  258.      update loop to occur.  If you change any field that causes new
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                        - 5 -
  269.  
  270.  
  271.      circumstances, the StpSz value is not added to the first loop.  Note also
  272.      that after a series of loops, NStep is automatically reset to 1 so "q"
  273.      will do exactly one loop and return you to command mode.
  274.  
  275.      To quit the program, type control-d from command mode.  For a little more
  276.      help, type ?.  The entire screen may be erased and redrawn with control-l.
  277.  
  278.      3.  Screen Fields
  279.  
  280.      The screen is divided into two halves, top and bottom.  The top fields are
  281.      always present. They define the general observing circumstances and
  282.      control features.
  283.  
  284.      The planets and two additional objects are displayed in a table in the
  285.      bottom portion of the screen.  There is one object per row, and several
  286.      columns.  There are three forms of this portion selected by picking the
  287.      Menu selection.
  288.  
  289.      Some things may be turned off to reduce compute times.  Calculations for
  290.      each planet may be turned on and off by selecting the planet name field.
  291.      Calculations for Dawn/Dusk/NiteLn may be turned off by selecting any of
  292.      these fields.  Planet positions are only updated as often as necessary to
  293.      match the display precision of the screen unless plotting or searching is
  294.      on.  In these cases full precision is desired at all times and so
  295.      positions are always fully recalculated at each iteration.
  296.  
  297.      Follows is a list and description of each of the fields in each section.
  298.      Following each name a parenthetical "p" indicates the field may be
  299.      selected for plotting (see later). All fields may be selected for
  300.      changing.
  301.  
  302.  
  303.      3.1.  Top Screen Fields
  304.  
  305.      LTZ           the local timezone name.  The name field may be changed to
  306.                    any three-character mnemonic.
  307.      LT(p)
  308.      LD(p)         The local time and date are not labeled as such but are to
  309.                    the right of the local timezone name.  They are individually
  310.                    selectable.  Time and date fields may be changed as
  311.                    described in a later section.  Set to "n" to set to "now"
  312.                    from computer clock.
  313.      UT(p)
  314.      UD(p)         The universally coordinated time and date are not labeled as
  315.                    such but are to the right of the UTC label.  They are
  316.                    individually selectable.  Time and date fields may be
  317.                    changed as described in a later section.  Set to "n" to set
  318.                    to "now" from computer clock.
  319.      JulianDat(p)  the current Julian date, to about 1-second accuracy.
  320.      Watch         selects the sky or solar system displays; see complete
  321.                    discussion below.
  322.      Search        controls the automatic search feature of ephem. See the
  323.                    complete discussion below.
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                        - 6 -
  335.  
  336.  
  337.      Plot          controls plotting; see complete discussion below.
  338.      Menu          controls which menu is in the bottom half of the screen.
  339.                    See their complete discussion below.
  340.      LST(p)        the current local sidereal time.  set to "n" to set from
  341.                    computer clock.
  342.      Dawn(p)       local time when the sun is approximately 18 degrees below
  343.                    the horizon before sunrise.
  344.      Dusk(p)       local time when the sun is approximately 18 degrees below
  345.                    the horizon after sunset.
  346.      NiteLn(p)     length of astronomical night, ie, Dawn - Dusk.  If this line
  347.                    is shown as "-----", it means the sun is either always below
  348.                    or always above approximately -18 degrees altitude on this
  349.                    particular day.  This and the Dawn and Dusk lines are blank
  350.                    when their computation has been turned off.
  351.      NStep         The number of times the display with be updated (time
  352.                    advanced by StpSz each step) before entering command mode.
  353.      StpSz         the amount of time UTC (and its derivatives) is incremented
  354.                    each loop.  set this to "r" to use real-time based on the
  355.                    computer clock.  you may also set it in terms of days by
  356.                    appending a "d" after the number when you set it.
  357.      Lat(p)        location latitude, positive degrees north of equator.
  358.      Long(p)       location longitude, positive degrees west of Greenwich
  359.                    meridian.  set to "N" to set from computer clock.
  360.      Elev(p)       local elevation of the ground above sea level, in feet. (see
  361.                    implementation notes).
  362.      Temp(p)       local surface air temperature, in degrees F.
  363.      AtmPr(p)      local surface air pressure, in inches of mercury.
  364.      TZ(p)         hours local time is behind utc, ie, positive west or
  365.                    negative east of Greenwich.
  366.      Epoch         the epoch, to the nearest 0.1 years, to which the ra/dec
  367.                    fields are precessed.  This says (OfDate) when coordinates
  368.                    are not precessed, ie, are in the epoch of date. Set to "e"
  369.                    to set to epoch of date.
  370.      Also in the upper right of the screen is a calendar for the current local
  371.      month.  Dates of new and full moons are marked NM and FM, respectively.
  372.  
  373.      3.2.  Data format columns
  374.      Ob            name of object.  Select this to toggle the display and
  375.                    calculations on and off.
  376.      R.A.(p)       apparent geocentric right ascension of object, precessed to
  377.                    given epoch, in hours, minutes and decimal minutes.
  378.      Dec(p)        apparent geocentric declination of object, precessed to
  379.                    given epoch, in degrees and minutes.
  380.      Az(p)         degrees eastward of true north for object.
  381.      Alt(p)        degrees up from a horizontal plane Elev feet above sea
  382.                    level.
  383.      H Long(p)     true heliocentric longitude, in degrees.  Earth's is
  384.                    displayed on the sun's line.
  385.      H Lat(p)      true heliocentric latitude, in degrees.
  386.      Ea Dst(p)     true distance from earth center to object center, in AU,
  387.                    except distance to the moon is in miles.
  388.      Sn Dst(p)     true distance from sun center to object center, in AU.
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                                        - 7 -
  401.  
  402.  
  403.      Elong(p)      spherical angular separation between sun and given object,
  404.                    calculated from the their geocentric ecliptic coordinates.
  405.                    Note this is not just difference in ecliptic longitude. The
  406.                    sign, however, is simply sign(obj's longitude - sun's
  407.                    longitude), ie, degrees east.  thus, a positive elongation
  408.                    means the object rises after the sun.
  409.      Size(p)       angular size of object, in arc seconds.
  410.      VMag(p)       visual magnitude of object.
  411.      Phs(p)        percent of visible surface in sunlight. Note the moon phase
  412.                    is calculated simplistically as just abs(elongation)/180*100
  413.                    which can be a few degrees off... this means that because of
  414.                    how elongation is defined it doesn't say 0 during new moon
  415.                    (or 100 during full) except during close eclipses (maybe
  416.                    that's a "feature"?).
  417.      Also, some terminals scroll when a character is written to the lower right
  418.      character position. To avoid this, Object X's phase is left shifted by one
  419.      column. This can look particularly ugly when the phase is 100% because the
  420.      "100" is right next to visual magnitude number.
  421.  
  422.      3.3.  RiseSet format columns
  423.      Rise Time
  424.      Rise Az       The local time and azimuth when the upper limb of the object
  425.                    rises.
  426.      Transit Time
  427.      Transit Alt   The local time and altitude when the object crosses the
  428.                    meridian, ie, when its azimuth is true south or, if no
  429.                    precession, when the local sidereal time equals the object's
  430.                    right ascension.
  431.      Set Time
  432.      Set Az        The local time and azimuth when the upper limb of the object
  433.                    sets.
  434.      Hours Up      The number of hours the object is up on the local date.
  435.  
  436.      Horizon displacement may be calculated in either of two ways; see the
  437.      horizon discussion in the Menu selection section.
  438.  
  439.      Various oddball conditions are accounted for, including an object that is
  440.      up sometime during the day but that doesn't rise, transit or set as such
  441.      on that day, an object that is circumpolar or that is never up or one that
  442.      rises twice on the same day.  These are marked as "Never rises", "Never
  443.      transits", "Never sets", "Circumpolar", "Never up" or appended with a plus
  444.      "+" sign, respectively.
  445.  
  446.      3.4.  Separation format fields
  447.      This format is a table of angular separations between each pair of
  448.      objects.  These angles are based on the local altitude/azimuth, and so in
  449.      general differ somewhat from the elongations reported for the sun in the
  450.      Data menu.
  451.      Unfortunately, with the format "ddd:mm", there is not enough room for a
  452.      space between columns when the angle is at least 100 degrees.  To avoid
  453.      this, I drop the minutes portion if the (rounded) angle is at least 100
  454.      degrees.
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                                        - 8 -
  467.  
  468.  
  469.      4.  Date and Time Formats
  470.      Times are displayed and entered in h:m:s format.  If you pick a time field
  471.      to change it any of the h, m, and s components that are not specified are
  472.      left unchanged from their current value.  For example, 0:5:0 set hours to
  473.      0, minutes to 5, seconds to 0, whereas :5 sets minutes to 5 but leaves
  474.      hours and seconds unchanged.  A negative time is indicated by a minus sign
  475.      (-) anywhere before the first digit.
  476.  
  477.      Dates are displayed and entered in American month:day:year format.  As
  478.      with time, components omitted when entering a new value retain the current
  479.      value.  For example, if the current date is 10/20/1988 and you type 20/20
  480.      the new date will become 20/20/1988. Note you must type the full year
  481.      since the program is accurate over several centuries either side of 1900.
  482.      If you change the date, the time (ie, partial day) will not change.
  483.  
  484.      Two other ways to set the date are supported for compatibility with some
  485.      published comet ephemerides.  You may enter the day portion as a real
  486.      number.  When you set the day this way, the time will also change to
  487.      correspond to the fractional portion of the day.
  488.  
  489.      You may also enter a date as a decimal year, as in 1990.12345.  This is
  490.      also useful in interpreting plot files that include a date field, since
  491.      date fields are stored in plot files as decimal years.  If no decimal
  492.      point is included, the number is assumed to be a year unless it is in the
  493.      range 1-12, in which case it will be taken to mean that you are just
  494.      changing the month of the current date.  To actually specify the years 1 -
  495.      12, you must append a decimal point to distinguish them from months.
  496.  
  497.      As a matter of typing convenience, the program accepts most any character
  498.      as the separator; you don't have to type a perfect ":" or "/".
  499.  
  500.      5.  Configuration File
  501.      The ephem.cfg configuration file allows you to set the initial values of
  502.      many of the screen fields. You can still change any field while the
  503.      program is running too; this file just sets the initial conditions.  Note
  504.      that the order of entries in this file is important because they each take
  505.      effect immediately.  You should put them in the same order you wish them
  506.      to be processed, just as though you were changing the fields interactively
  507.      within ephem.
  508.  
  509.      You may have several different configuration files if you wish. By
  510.      default, ephem looks for one named ephem.cfg. You can tell it to use an
  511.      alternate file by using the -c switch as follows:
  512.  
  513.          ephem -c <config_file>
  514.  
  515.  
  516.      If your system supports the HOME environment variable then ephem also
  517.      looks for a configuration file there with the name .ephemrc.
  518.  
  519.      The format of the file uses the form KEYWORD=VALUE, where the possible
  520.      KEYWORDS and the types of VALUES for each are described below. Any
  521.      KEYWORDS not in the file will take on some sort of default. The separator
  522.      need not be an actual equals sign; any char will do because the VALUE is
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.                                        - 9 -
  533.  
  534.  
  535.      assumed to start one character after the KEYWORD, regardless.
  536.  
  537.      Blank lines and lines that begin with an asterisk (*) or whitespace (space
  538.      or tab) are ignored and may be used for comments.
  539.  
  540.      Note:  because of the way unspecified time and date components are left
  541.      unchanged (see section on Date and Time Formats) always specify the
  542.      complete time and date for all entries in the configuration file. For
  543.      example, to initialize the longitude to zero degrees, say 0:0:0, not just
  544.      0.
  545.  
  546.      5.1.  Configuration File fields
  547.      UD        initial UTC date, such as 10/20/1988, or "NOW" to use the
  548.                computer clock.
  549.      UT        initial UTC time, such as 12:0:0, or "NOW" to use the computer
  550.                clock.
  551.      TZONE     hours the local time is behind utc, such as 5:0:0.  you need not
  552.                set this if you use "NOW" for UT or UD.
  553.      TZNAME    name of the local time zone, such as CDT. 3 chars max.  you need
  554.                not set this if you use "NOW" for UT or UD.
  555.      LONG      longitude, in degrees west of Greenwich, in the form d:m:s.
  556.      LAT       latitude, in degrees north of the equator, in the form d:m:s.
  557.      HEIGHT    height above sea level, in feet, such as 800
  558.      TEMP      air temperature, in degrees F, such as 50
  559.      PRES      air pressure, in inches of Mercury, such as 29
  560.      STPSZ     the time increment between screen updates, such as "1" to give
  561.                one hour updates. this can be a specific amount or RTC to use
  562.                the system clock as a real-time source. You may also specify a
  563.                time in days, by appending a D (or d) after the number.
  564.      PROPTS    this selects what you want included initially in the display.
  565.                since IBM-PC math is not very fast, you can reduce the time to
  566.                update the screen by only printing those fields of interest. the
  567.                VALUE is a collection of letters to turn on each item from the
  568.                following set:
  569.  
  570.                        T       twilight (dawn-dusk)
  571.                        S       circumstances for the sun
  572.                        M       circumstances for the moon
  573.                        e       circumstances for mercury
  574.                        v       circumstances for venus
  575.                        m       circumstances for mars
  576.                        j       circumstances for jupiter
  577.                        s       circumstances for saturn
  578.                        u       circumstances for uranus
  579.                        n       circumstances for neptune
  580.                        p       circumstances for pluto
  581.                        x       circumstances for object X
  582.                        y       circumstances for object Y
  583.  
  584.                For example, to just track the sun and saturn, say PROPTS=Ss
  585.  
  586.                If the delimiter between PROPTS and the selection is a plus (+)
  587.                sign then the given planets are included IN ADDITION TO ones
  588.                already specified. Any other delimiter sets the selection to
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.                                        - 10 -
  599.  
  600.  
  601.                exactly the set specified. This feature was added so that the
  602.                command line version of using PROPTS could add to the set of
  603.                planets giving in the configuration file.
  604.      NSTEP     number of times program will loop before entering command mode.
  605.                see the discussion under Program Operation.
  606.      EPOCH     this sets the desired ra/dec precession epoch. you can put any
  607.                date here or EOD to use the current instant ("Epoch of Date").
  608.      OBJX
  609.      OBJY      These fields specify the optional objects "x" and "y" by naming
  610.                any item in the database file. The form is OBJX=xyz, where xyz
  611.                must be in the database file, case sensitive.  You may define
  612.                one object of each type for each of OBJX and OBJY; the last one
  613.                defined will be the "current" one when ephem gets going.
  614.  
  615.      5.2.  Example ephem.cfg
  616.  
  617.      This is the ephem.cfg file that was in effect when the sample screens (in
  618.      another section) were generated. You might run ephem with this
  619.      configuration file and compare with the samples as a check.
  620.  
  621.      UT=0:0:0
  622.      UD=3/21/1990
  623.      TZNAME=CST
  624.      TZONE=6:0;0
  625.      LONG=93:42:8
  626.      LAT=44:50:37
  627.      HEIGHT=800
  628.      TEMP=40
  629.      PRES=29.5
  630.      STPSZ=RTC
  631.      PROPTS=TSMevmjsunpxy
  632.      EPOCH=2000
  633.      NSTEP=1
  634.      OBJX=Austin
  635.      OBJY=Ceres
  636.  
  637.      As another common example, this ephem.cfg creates an essentially free-
  638.      running real-time screen based on the computer clock:
  639.  
  640.      UT=Now
  641.      LONG=90:10:8
  642.      LAT=40:50:20
  643.      HEIGHT=800
  644.      TEMP=50
  645.      PRES=29
  646.      STPSZ=RTC
  647.      PROPTS=TSMevmjsunp
  648.      NSTEP=9999999
  649.      EPOCH=Eod
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.                                        - 11 -
  665.  
  666.  
  667.      6.  Menu options
  668.  
  669.      When you select "Menu" you can change among the three styles of bottom
  670.      screens. There are also two options that can be set from the Menu quick-
  671.      choice menu. These options toggle when picked and retain their values so
  672.      they need only be changed when desired.
  673.  
  674.      6.1.  Adaptive vs. Standard hzn
  675.  
  676.      This selects the horizon refraction displacement algorithm used by the
  677.      Rise/Set menu.  "Adaptive" uses the local atmospheric conditions known to
  678.      ephem and matches the Planet Info times nicely. "Standard" uses the
  679.      "accepted nominal" horizon refraction value of 32 arc minutes and usually
  680.      agrees, to a minute or so, with published tables.
  681.  
  682.      6.2.  Geocentric vs. Topocentric
  683.  
  684.      This selects the vantage point for the Separation menu. "Geocentric"
  685.      ignores local conditions and gives the separation as seen from Earth
  686.      center. "Topocentric" uses the local conditions known to ephem.  They are
  687.      particularly critical for lunar occultations, but the effect can be
  688.      significant for the planets.
  689.  
  690.      Note that searching over a period that will include the rise or set times
  691.      of either object is generally better performed from the geocentric
  692.      viewpoint.  The refraction effect of the topocentric viewpoint causes many
  693.      arcminutes of rapid whiplash displacement as the objects rise and set that
  694.      overlays the smooth celestial motion of the objects.  This rapid position
  695.      variation can confuse the solver algorithms that expect fairly smooth
  696.      functions.
  697.  
  698.      7.  User Defined Objects: X and Y
  699.  
  700.      You may specify one or two extra objects for ephem to use. The objects may
  701.      be defined in three different ways:  fixed celestial sphere coordinates,
  702.      or heliocentric elliptical or parabolic orbital elements.  Elliptical
  703.      elements are typically useful for periodic comets or asteroids, and
  704.      parabolic elements are for nonrecurring solar system interlopers such as
  705.      aperiodic comets.
  706.  
  707.      The parameters for each type of object are stored separately, so you may
  708.      switch between types of objects without losing parameters.
  709.  
  710.      7.1.  Controlling Object-X or Y Operation
  711.  
  712.      To control the type and the corresponding details for object X or Y,
  713.      select the corresponding row near the bottom.  (Remember that typing the
  714.      character "x" or "y" is a shorthand way to move to the bottom rows.) It
  715.      will bring up a quick-choice menu as follows:
  716.  
  717.      Select: Fixed, Elliptical, Parabolic, Lookup, On
  718.  
  719.  
  720.      When you first enter the quick-choice menu the cursor will start out
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.                                        - 12 -
  731.  
  732.  
  733.      positioned at the field for the current type of object.  The first three
  734.      selections allow you to enter or review the various parameters required to
  735.      define an object's position of such type, one parameter at a time.
  736.  
  737.      You set the current object type and begin to view its parameters by
  738.      positioning the cursor over the type and pressing RETURN.  The prompt for
  739.      each item includes a short description, the units to use, and its current
  740.      setting is shown in parentheses. To leave the item unchanged and go to the
  741.      next item, type RETURN.  If you do not wish to change or see any more
  742.      items about the object then type "q" and you will return immediately to
  743.      the object-X quick-choice menu.
  744.  
  745.      You exit the quick-choice menu by typing "q" while over any field or
  746.      RETURN while over On or Off, as described in a later section.
  747.  
  748.      As with all dates throughout ephem, the dates for the epochs of perihelion
  749.      and reference epochs may be entered in month/day/year or decimal year
  750.      formats, and the day may be entered as a real number (see the section on
  751.      Date and Time Formats).  All dates given for comet parameters are always
  752.      in UT.
  753.  
  754.      7.1.1.  Fixed
  755.  
  756.      This selection will present a series of four prompts, one each for the RA,
  757.      Dec, magnitude and the reference epoch for the coordinates of a fixed
  758.      object.
  759.  
  760.      7.1.2.  Elliptical
  761.  
  762.      This will begin a series of eleven prompts asking for the parameters that
  763.      define a heliocentric elliptic orbit and the magnitude model coefficients.
  764.      These elements are the same ones often listed in the Astronomical Almanac.
  765.      The elements are, in order:
  766.  
  767.              i = inclination, degrees
  768.              O = longitude of ascending node, degrees
  769.              o = argument of perihelion, degrees
  770.              a = mean distance (aka semi-major axis), AU
  771.              n = daily motion, degrees per day
  772.              e = eccentricity,
  773.              M = mean anomaly (ie, degrees from perihelion),
  774.              E = epoch date (ie, time of M),
  775.              D = the equinox year (ie, time of i/O/o).
  776.              H = absolute magnitude
  777.              G = magnitude slope parameter.
  778.  
  779.  
  780.      You might have other parameters available that can be converted into
  781.      these.  For example, we have the following relationships:
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.                                        - 13 -
  797.  
  798.  
  799.              P = sqrt(a*a*a)
  800.              p = O + o
  801.              n = 360/days_per_year/P ~ 0.98563/P
  802.              T = E - M/n
  803.              q = a*(1-e)
  804.          where
  805.              P = the orbital period, years;
  806.              p = longitude of perihelion, degrees
  807.              n = daily motion, degrees per day;
  808.              T = epoch of perihelion (add multiples of P for desired range)
  809.              q = perihelion distance, AU
  810.  
  811.      Note that if you know T you can then set E = T and M = 0.
  812.  
  813.      7.1.3.  Parabolic
  814.  
  815.      This will begin a series of eight prompts asking for the parameters that
  816.      define a heliocentric elliptic orbit and the magnitude model coefficients.
  817.      These orbital parameters are, in order:
  818.  
  819.      epoch of perihelion,
  820.      inclination,
  821.      argument of perihelion,
  822.      perihelion distance,
  823.      longitude of the ascending node,
  824.      and the reference epoch of the parameters.
  825.      absolute magnitude, g
  826.      luminosity index coefficients, k
  827.  
  828.  
  829.      A simple magnitude model is used to estimate the brightness of comets.
  830.      This model requires two parameters to be specified.  One, the absolute
  831.      magnitude, is the visual magnitude of the comet if it were one AU from
  832.      both the sun and the earth, denoted g.  The other, the luminosity index,
  833.      characterizes the brightness change of the comet as a function of its
  834.      distance from the sun, denoted k.  The model may be expressed as:
  835.  
  836.          m = g + 5*log10(D) + 2.5*k*log10(r)
  837.        where:
  838.          m  is the resulting visual magnitude;
  839.          g  is the absolute visual magnitude;
  840.          D  is the comet-earth distance, in AU;
  841.          k  is the luminosity index; and
  842.          r  is the comet-sun distance.
  843.  
  844.      Note that this model does not take into account the phase angle of
  845.      sunlight on the comet.
  846.  
  847.      7.1.4.  Lookup
  848.  
  849.      This option lets you define an object from any of those listed in the
  850.      database file, described in a subsequent section.
  851.  
  852.      If successful, the cursor will move to the type of the new object and it
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.                                        - 14 -
  863.  
  864.  
  865.      becomes the current type.
  866.  
  867.      7.1.5.  On or Off
  868.  
  869.      The last selection on the right toggles the calculations for the object On
  870.      and Off.  It toggles when selected with RETURN and then immediately exits
  871.      the quick-choice menu back to the main menu.  If calculations become On,
  872.      then they will be performed for the current type of object; if they become
  873.      Off the object-X or Y row of information will be erased.
  874.  
  875.      7.2.  Database File
  876.  
  877.      You may save a list of objects in a file to be used for setting OBJX and
  878.      OBJY. The default name of this file is ephem.db. You may also set it from
  879.      the command line with the -d option, or set it with the EPHEMDB
  880.      environment variable.
  881.  
  882.      The file consists of one object per line. Lines that begin with an
  883.      asterisk (*) are ignored.  Each line contains several fields, each
  884.      separated by a comma.  The first field is the name of the object.  The
  885.      second field is the type of the object, that is, one of the strings
  886.      "fixed", "elliptical", or "parabolic"; actually, "f", "e" and "p" are
  887.      sufficient.  The remaining fields depend on the type of object.  They are
  888.      exactly the same parameters, and in the same order, as ephem asks for when
  889.      defining the object from the menu.
  890.  
  891.      8.  Plotting
  892.  
  893.      Each time a field is drawn on the screen during a full screen update cycle
  894.      (that as, during automatic looping or a manual "q" command character from
  895.      the main menu but not from a screen redraw from control-l or when an
  896.      individual planet is turned on or a single time field is changed) its
  897.      full-precision value may be written to a file.  This implies you may not
  898.      plot a field from other than the current menu at the time plotting is on.
  899.      You can append several plot runs together, however, if necessary.
  900.  
  901.      Each line in the file consists of a tag character followed by two or three
  902.      floating point variables, all separated by commas. If there are two
  903.      values, they should be interpreted to be x and y (or perhaps r and theta).
  904.      If there is a third, it is a z or trace value.
  905.  
  906.      For efficiency on systems that can compute a screen full faster than they
  907.      can display it, screen updates are suppressed while plotting is on and
  908.      NStep is greater than 1. This can greatly reduce the time to generate a
  909.      long plot file. Fields are still logged for plotting; they just are not
  910.      drawn on the screen.
  911.  
  912.      The Plot field controls plotting.  Whether plotting is currently active is
  913.      indicated by "on" or "off" immediately to its right.
  914.  
  915.      Picking "Plot" brings up a quick-choice menu, as follows:
  916.  
  917.      Select: Select fields, Display a plot file, Cartesian coords, Begin plotting
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.                                        - 15 -
  929.  
  930.  
  931.      8.1.  Defining plot fields
  932.  
  933.      Select the "Select fields" option.  You will be asked to move the cursor
  934.      to the field you want to use as the x coordinate (abscissa), then asked to
  935.      choose the y coordinate (ordinate), then asked to choose an optional z
  936.      trace variable and finally a tag character.  (X and Y may be for other
  937.      coordinate systems too but ephem's quicky plotter can only plot in
  938.      Cartesian coordinates.) If you type q for either x or y then no more
  939.      fields will be defined.  If you type q for the z field there will be no z
  940.      field.  You can not label a plot line with the letter "q" at this time.
  941.  
  942.      This then repeats so you may choose up to ten of these sets for any given
  943.      plot run.  Each set defines what will become a line on the final plot.
  944.      Note that you may select the "Search" field to indicate use of the current
  945.      search function; that function must be defined by the time plotting is
  946.      turned on.
  947.  
  948.      If you turn plotting off and back on the fields selected for plotting are
  949.      reactivated the same as they were last time. You may change them if
  950.      desired, of course, but there is no need to redefine them if you do not
  951.      wish to change them.
  952.  
  953.      8.2.  Displaying a plot file
  954.  
  955.      Select the "Display a plot file" option to generate a crude plot on the
  956.      screen of an existing plot file previously created by ephem.  The entries
  957.      in the file will be drawn on the screen using their tag characters; the
  958.      plot remains on the screen until you type any character.
  959.  
  960.      The plot may be made in polar or Cartesian coordinates, depending on the
  961.      setting of the plotting mode in the quick-choice (see next section).
  962.  
  963.      8.3.  Cartesian or Polar coords
  964.  
  965.      This toggles the plotting mode coordinate system.  The mode remains until
  966.      changed.  Polar coordinates assume the first numeric field in the plot
  967.      file is the radius, and the second is the angle counterclockwise from
  968.      right, in degrees.
  969.  
  970.      8.4.  Begin Plotting
  971.  
  972.      If plot field lines are defined then the third option, "Begin plotting"
  973.      will be available.  You will be asked for the name of the file to use and,
  974.      if it already exists, whether to overwrite it or append to it.  Once you
  975.      have chosen a file, plotting is on and the top menu plotting status field
  976.      changes to "on".  The default plot file name is ephem.plt.  The values are
  977.      written to the plot file each time they are updated on the screen until
  978.      you select "Plot" again and select the "Stop" option to turn plotting back
  979.      off.
  980.  
  981.      8.5.  Stopping Plotting
  982.  
  983.      If plotting is on, then selecting the Plot field in the top section will
  984.      turn plotting off. You may pick Plot again and resume with the same fields
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.                                        - 16 -
  995.  
  996.  
  997.      by selecting "Begin plotting" again.
  998.  
  999.      Note that due to internal buffering the plot file will not be completely
  1000.      written to disk until plotting is turned off.
  1001.  
  1002.      9.  Watching
  1003.  
  1004.      You may generate a simple drawing on the screen of the sky or the solar
  1005.      system by selecting "Watch".  It will bring up a quick-choice menu as
  1006.      follows:
  1007.  
  1008.      Select: Sky, Solar system, No trails
  1009.  
  1010.  
  1011.      9.1.  Trails
  1012.  
  1013.      You may either erase after each iteration or leave the tags up, referred
  1014.      to as "trails". Picking the right-most choice will toggle between "No
  1015.      trails" and "Leave trails"; you should set it as desired before you select
  1016.      the style of sky plot you wish.  Ephem will remember your selection.
  1017.  
  1018.      9.2.  Sky
  1019.  
  1020.      This selection draws the currently active planets as they would appear in
  1021.      the sky at the current time and date.  The coordinate system is such that
  1022.      0 degrees azimuth (north) through 360 degrees (north, once around) is
  1023.      mapped to the horizontal screen dimension, and 0 degrees altitude (level)
  1024.      through 90 degrees (the zenith) is mapped to the vertical dimension. Thus,
  1025.      the bottom row is the horizon and all across the top is the zenith.
  1026.  
  1027.      9.3.  Solar System
  1028.  
  1029.      This selection draws the currently active planets as they would appear
  1030.      looking "down from the top" of the ecliptic, with the sun at the center
  1031.      and zero hours right ascension towards the right.  The scale is adjusted
  1032.      to roughly fill the screen according to the outer-most active planet.  The
  1033.      screen transformation assumes a screen aspect width/height ratio of 4/3.
  1034.      Down the left column of the screen is the heliocentric altitude of the
  1035.      planet above or below the ecliptic, drawn to the same scale as the
  1036.      circular display.
  1037.  
  1038.      In either style of display, pressing RETURN advances the time by whatever
  1039.      amount StpSz is set to.  Pressing "h" advances the time by one hour, "d"
  1040.      advances by one day, and "w" advances by one week (seven days).  Pressing
  1041.      "q" returns to the tabular main screen.  Pressing any other key starts an
  1042.      automatic loop with each step advancing by StpSz; pressing any key stops
  1043.      the looping.
  1044.  
  1045.      As symbols are placed, collisions (overstrikes) are avoided by moving
  1046.      characters in such a way as to maintain increasing sorted order towards
  1047.      the right.  In the case of the heliocentric altitude display, for example,
  1048.      greater height is indicated towards the right on the same row; the S and E
  1049.      symbols are always at 0.
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.                                        - 17 -
  1061.  
  1062.  
  1063.      When you return to the main menu, the last watched time will be maintained
  1064.      as the current time.  The StpSz is not changed.
  1065.  
  1066.      10.  Searching
  1067.  
  1068.      Ephem can search for arbitrary conditions to exist among most displayed
  1069.      fields.  You first enter a function, then select from among three forms of
  1070.      equation solvers to iteratively solve for the next time when the function
  1071.      meets the requirements of the solver. The solver selects the next time for
  1072.      which it wants the function evaluated and sets StpSz so that the next
  1073.      iteration will occur at that time. The solvers continue to iterate until
  1074.      either they achieve their goal or NStep reaches 0.
  1075.  
  1076.      You may set NStep to be quite large and let ephem search unattended or set
  1077.      it to 1 and watch it converge one step at a time. You may also plot at the
  1078.      same time as search to record the exact steps ephem took to converge.
  1079.      (But recall that screen updates are suppressed if plotting is also on).
  1080.  
  1081.      The "Search" selection in the top half of the screen controls all
  1082.      searching.  Picking it brings up a quick-choice menu as follows:
  1083.  
  1084.      Select: Find extreme, Find 0, Binary, New function, Accuracy
  1085.  
  1086.  
  1087.      10.1.  Find extreme
  1088.  
  1089.      This search algorithm searches for a local maximum or a minimum in the
  1090.      search function, whichever it finds first. It begins by evaluating the
  1091.      search function at the current time then for two more times each separated
  1092.      by StpSz. It then fits these three points to a parabola and solves it for
  1093.      the time of its maximum (or minimum). StpSz is set so that the next
  1094.      iteration will evaluate at this point.  This parabolic fit solution keeps
  1095.      repeating until StpSz changes by less than the desired accuracy or until
  1096.      the curve becomes so flat that an extrema appears too broad to find.
  1097.  
  1098.      10.2.  Find 0
  1099.  
  1100.      This search algorithm uses the secant method to solve for the time at
  1101.      which the search function is zero. The function is evaluated at the
  1102.      current time and then again StpSz later to establish a slope for which the
  1103.      x-intercept is found as the next zero guess. This is used to set StpSz for
  1104.      the next desired time value and the slope hunting process repeats until
  1105.      StpSz changes by less than the desired accuracy.
  1106.  
  1107.      10.3.  Binary
  1108.  
  1109.      This search algorithm must be used with a search function that yields a
  1110.      boolean result, ie, a true or false value. The idea is that the function
  1111.      is assumed to be one truth value when evaluated at the present time, and
  1112.      the opposite truth value when it is evaluated StpSz later. The algorithm
  1113.      will then do a binary search for the time when the truth value changes.
  1114.  
  1115.      The binary algorithm does not begin until the state change is bounded in
  1116.      time.  Initially, as long as the truth value at StpSz is the same as the
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.                                        - 18 -
  1127.  
  1128.  
  1129.      previous value the algorithm will just keep moving in time by StpSz
  1130.      looking for when the state changes.  That is, a linear search is initiated
  1131.      to bound the state change, then the binary search proceeds.
  1132.  
  1133.      10.4.  Define a New function
  1134.  
  1135.      Select "New function" to display the current search function.  If you type
  1136.      "q" it will be left unchanged.  If you type RETURN it will be erased.  If
  1137.      you type anything else it will be compiled and, if there are no errors, it
  1138.      will become the new search function.  Once a valid function has been
  1139.      stored, it will remain unless changed.  If a search function is selected
  1140.      and there is as yet no valid search function defined, you will
  1141.      automatically be asked to enter one as though you had selected "New
  1142.      function."
  1143.  
  1144.      A search function consists of intrinsic functions, field-specifiers,
  1145.      constants and operators, and precedence may be overridden with
  1146.      parentheses.
  1147.  
  1148.  
  1149.      10.4.1.  Intrinsic functions
  1150.  
  1151.      In this release, the only intrinsic function available is abs(), which
  1152.      returns the absolute value of its argument.
  1153.  
  1154.      10.4.2.  Field Specifiers
  1155.  
  1156.      A field in the bottom half of the menu is specified in the form of
  1157.      "object_name.column_name". The object_name is enough of the planet name to
  1158.      be unique; use "x" or "y" for the user-specified object X or Y.  The
  1159.      column_name is from the following table, depending on which menu is up. In
  1160.      all cases additional characters may be entered but are ignored.
  1161.  
  1162.      Planet Data Menu        Rise/Set Menu               Separation Menu
  1163.      ------------------      --------------------        ---------------
  1164.      al      Alt             hr      Hrs Up, or          j       Jup
  1165.      az      Az              hu      Hrs Up              ma      Mars
  1166.      d       Dec             raz     Rise Az             me      Merc
  1167.      ed      Ea Dst          rt      Rise Time           mo      Moon
  1168.      el      Elong           saz     Set Az              n       Nep
  1169.      hla     Helio Lat       st      Set Time            pl      Pluto
  1170.      hlo     Helio Long      ta      Transit Alt         sa      Saturn
  1171.      ph      Phs             tt      Transit Time        su      Sun
  1172.      ra      R.A.                                        u       Uranus
  1173.      sd      Sn Dst                                      ve      Venus
  1174.      si      Size
  1175.      vm      VMag
  1176.  
  1177.  
  1178.      In addition, the following top-half fields may be used:
  1179.  
  1180.      da      Dawn
  1181.      du      Dusk
  1182.      n       NiteLn
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.                                        - 19 -
  1193.  
  1194.  
  1195.      Remember, searching may only involve fields being calculated for display
  1196.      at the time the solver is active.  While you can syntactically include any
  1197.      field in a search function it is useless to define a search that uses
  1198.      fields from other than the menu that is selected at the time the search is
  1199.      running.
  1200.  
  1201.      10.4.3.  Constants
  1202.  
  1203.      Constants may be integers or floating point numbers. The latter may be
  1204.      expressed in scientific notation if desired. Examples include 100, .9,
  1205.      1.234, 1e10 and 1.2e-4.  Any number may be preceded by - to make it
  1206.      negative.
  1207.  
  1208.      10.4.4.  Operators
  1209.  
  1210.      The collection of arithmetic, relational and boolean operators provided
  1211.      mimics those of C language as listed in the following table, in decreasing
  1212.      order of precedence.  Operators grouped together have the same precedence
  1213.      and all have left-to-right associativity. Parentheses may be used as
  1214.      desired.
  1215.  
  1216.      Symbol  Meaning                 Resulting type
  1217.      ------  --------------------    --------------
  1218.      *       multiply                arithmetic
  1219.      /       divide                  arithmetic
  1220.  
  1221.      +       add                     arithmetic
  1222.      -       subtract                arithmetic
  1223.  
  1224.      >       greater than            boolean
  1225.      >=      greater than or equal   boolean
  1226.      <       less than               boolean
  1227.      <=      less than or equal      boolean
  1228.  
  1229.      ==      equality                boolean
  1230.      !=      inequality              boolean
  1231.  
  1232.      &&      logical and             boolean
  1233.  
  1234.      ||      logical or              boolean
  1235.  
  1236.  
  1237.      10.5.  Specifying Search Accuracy
  1238.  
  1239.      Selecting "Accuracy" allows you to specify when the search will stop.  The
  1240.      search algorithms will stop when StpSz becomes equal to or less than this
  1241.      value. The default is one minute.  If ephem has not yet converged to the
  1242.      specified accuracy but NStep has decremented to 1, the searching will stop
  1243.      but the search status field will still indicate which search procedure is
  1244.      in effect. To try more iterations you may increase NStep and resume
  1245.      searching. If the accuracy was achieved, the search status field will
  1246.      switch to "off" with the number of "unused" steps remaining in NStep and
  1247.      the last step size in the StpSz fields.
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.                                        - 20 -
  1259.  
  1260.  
  1261.      10.6.  Stop
  1262.  
  1263.      If searching is on, this option will also appear on the quick-choice menu
  1264.      and may be selected to turn off the search.
  1265.  
  1266.      10.7.  Example Searches
  1267.  
  1268.      As an example, let's find when Pluto again becomes the furthest planet
  1269.      from Sol.  You may find when the difference in their sun distance is zero,
  1270.      or you might use a binary search on the condition that Pluto's sun
  1271.      distance is larger then Neptune's.
  1272.  
  1273.      To try the former approach select Search, select "Find 0", specify the
  1274.      search function to be:
  1275.  
  1276.      pl.sd - nep.sd
  1277.  
  1278.      set StpSz to something large like 10d, NStep to allow several iterations
  1279.      like 20, and then type "q" to start the search and watch ephem do the
  1280.      hunt.  Ephem will settle on about 21:02 1/10/1999 UT.
  1281.  
  1282.      To try a binary search, you first need to have some idea of when the event
  1283.      will occur so you can eliminate the initial linear search for the state
  1284.      change. We can start at, say, 1/1/1999, set StpSz to 30d, select Binary
  1285.      search, specify the search function to be:
  1286.  
  1287.      pl.sd > nep.sd
  1288.  
  1289.      and go. Once it brackets the state change note how StpSz keeps being cut
  1290.      in half but can go in either direction (sign) as it divides each interval
  1291.      in half.  Ephem will converge on the same answer.
  1292.  
  1293.      10.8.  Another Example
  1294.  
  1295.      To find the time of last quarter moon during December, 1989, use the "Find
  1296.      0" search algorithm to solve "moon.el + 90".  (At last quarter, the moon
  1297.      is 90 degrees west of the sun, or -90 east in ephem's elongation display.)
  1298.      Set the initial time to mid-month, 12/15/1989, StpSz to 1 day and NStep to
  1299.      10. Ephem takes only a few iterations to settle on 23:57 12/19 UT.
  1300.  
  1301.      10.9.  Caution
  1302.  
  1303.      Beware that most celestial phenomena are generally pseudo-periodic in
  1304.      nature.  In early search steps ephem can easily skip over a local maxima
  1305.      and find a later one, which, while correct, may not be what was desired.
  1306.      In general, the closer you can be when you start the search the better
  1307.      ephem can refine it; it is not as good with very broad searches that can
  1308.      go "wild". Set StpSz large enough to offer significant change in the
  1309.      function value, but small enough not to skip too far.
  1310.  
  1311.      For example, Saturn and Neptune had three close approaches during 1989.
  1312.      If you did not know this then just asking ephem to find a minimum would
  1313.      have produced different results depending on the starting conditions.
  1314.      When starting a search for a certain class of event it is a good idea to
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.                                        - 21 -
  1325.  
  1326.  
  1327.      first use the plotting or watching facility of ephem to get a broad
  1328.      picture of the general circumstances then use ephem's search facility to
  1329.      refine a given region (or create and inspect a plot file and do your own
  1330.      interpolation directly from it separately).
  1331.  
  1332.      Similarly, ephem's searching techniques are not good for eclipses because
  1333.      the moon and sun are close every month; the trick is sorting through the
  1334.      frequent conjunctions for ones that are particularly close. One needs a
  1335.      way of establishing an envelope fit to the local extrema of a cyclic
  1336.      function in order to find a more global extreme.
  1337.  
  1338.      11.  Implementation Notes
  1339.  
  1340.      Remember that everything is for the current local time. So, for example,
  1341.      the calendar marks moon events in local time; commercial calendars usually
  1342.      mark the UT date.  Similarly, the rise/set times are for the current local
  1343.      day.
  1344.  
  1345.      The program uses a horizontal plane tangent to the earth as the horizon
  1346.      for all altitude calculations, rise/set events, etc.  This is not the same
  1347.      as the angle up from the local horizon unless the observer is directly on
  1348.      the ground due to earth's curvature.  The effect can be found from:
  1349.  
  1350.              sin(a)**2 = (h**2 + 2Rh) / (R+h)**2
  1351.          where:
  1352.              R = radius of earth
  1353.              h = height above ground (same units as R)
  1354.              a = increase in altitude
  1355.  
  1356.      For example, the effect is more than two arc minutes at a height of 5
  1357.      feet.
  1358.  
  1359.      Visual magnitudes are not very accurate at all... I haven't bother to fix.
  1360.  
  1361.      The accuracy of ephem can not be specifically stated since the Duffett-
  1362.      Smith book does not warrant its planet position polynomials to any given
  1363.      degree. I know for sure that better accuracy could be achieved if ephem
  1364.      used TDT but I have not yet decided on a suitable algorithm.  Allowing for
  1365.      this manually, (see the Wish List section) comparisons with the
  1366.      Astronomical Almanac are often within a few arcseconds.
  1367.  
  1368.      The program uses double precision throughout. While this precision might
  1369.      seem a little ridiculous, it is actually more efficient for most
  1370.      traditional K&R C compilers and the search functions seem to be are far
  1371.      more stable.
  1372.  
  1373.      Searching and plotting always use full precision but if neither of these
  1374.      are turned on pure display and watching only recompute a given planets new
  1375.      location if the time has changed enough to effect the required display
  1376.      precision, based on the planets mean apparent orbital motion.
  1377.  
  1378.      The sun-moon distance is the solution for the third side of a planar
  1379.      triangle whose two other sides are the earth-moon distance and earth-sun
  1380.      distance separated by the angle of elongation.
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.                                        - 22 -
  1391.  
  1392.  
  1393.      Beware of specifying a year of 0, or of computing with the user-defined
  1394.      objects before they are properly defined. These conditions can cause ephem
  1395.      to blow.
  1396.  
  1397.      11.1.  Program limits
  1398.  
  1399.      The search function is limited to a maximum of 32 instructions (each
  1400.      constant, field spec, and operation is one instruction), with no more than
  1401.      a total of 16 constants and field specs. At run time, the function can not
  1402.      require more than 16 stacked values (due to operator precedence or
  1403.      explicit parenthetical expressions) to evaluate.
  1404.  
  1405.      No more than 32 different fields can be tracked simultaneously for
  1406.      plotting and/or searching.
  1407.  
  1408.      No more than 10 lines may be plotted at once.
  1409.  
  1410.      The maximum file name length is 14 characters.
  1411.  
  1412.      12.  DOS Installation Procedure
  1413.  
  1414.      You must be running DOS V2.0 or later, though somewhere between V2.0 and
  1415.      V3.21 the behavior of control-c to terminate the program was fixed.  An
  1416.      8087 floating point chip will be used if present.
  1417.  
  1418.      The distribution floppy contains five files:
  1419.      README describes last minute items and details of this release.
  1420.      MAN.TXT is this manual, hopefully formatted and printable on most any
  1421.      printer.
  1422.      EPHEM.EXE is the executable program.
  1423.      EPHEM.CFG is a sample configuration file.
  1424.      EPHEM.DB is a sample database.
  1425.      To run the program, make working copies of these files in a directory and
  1426.      run "ephem" from that directory.
  1427.  
  1428.      12.1.  Setting TZ
  1429.  
  1430.      Before running ephem, you should set a DOS environment variable, TZ.  It
  1431.      is is used to establish the timezone name and hours offset whenever the
  1432.      "Now" shorthand is used from ephem, either from the configuration startup
  1433.      file or whenever any time field is changed manually.  Set it in the
  1434.      following form:
  1435.  
  1436.           set TZ=SSSnDDD
  1437.  
  1438.      where
  1439.  
  1440.      SSS  is the 3-letter abbreviation for the local standard timezone;
  1441.  
  1442.      n    is a number between -23 to 24 indicating the number of hours that are
  1443.           subtracted from GMT to obtain local standard time;
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.                                        - 23 -
  1457.  
  1458.  
  1459.      DDD  is an optional 3-letter abbreviation for the local daylight savings
  1460.           time zone name. Leave it off if you do not have savings time in your
  1461.           area or it is not currently in effect. If the changeover dates differ
  1462.           from the internal algorithm, just use SSS and n directly.
  1463.  
  1464.      For example, in the midwestern United States with savings times set
  1465.      TZ=CST6CDT
  1466.  
  1467.      If for some reason your system does not change to savings time at the
  1468.      right time, then omit the DDD parameter and just set the SSS and n to
  1469.      exactly what you want.
  1470.  
  1471.      You can put this in your AUTOEXEC.BAT file so it gets set each time you
  1472.      boot DOS.
  1473.  
  1474.      13.  Wish List
  1475.  
  1476.      incorporate Terrestrial Dynamical Time (known as Ephemeris Time prior to
  1477.      1984).  TDT is about 57 seconds ahead of UT1 in 1990.
  1478.  
  1479.      add explicit searching for eclipses and occultations.
  1480.  
  1481.      work on a better precession algorithm. current one exhibits some
  1482.      hysteresis.
  1483.  
  1484.      add search criteria for database objects.
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.                                        - 24 -
  1523.  
  1524.  
  1525.      14.  Sample Screens
  1526.  
  1527.      Here are sample ephem screens. They are generated using the first sample
  1528.      ephem.cfg file (listed in the section describing the configuration file).
  1529.      There is one for each of the three possible screen formats.  The rise/set
  1530.      screen was done using the Adaptive option.  The separations screen was
  1531.      done using the Geocentric option.
  1532.  
  1533.