NAME:
  onchip
 PURPOSE: (one line)
  Extract and optionally plot differential on-chip photometry.
 DESCRIPTION:
  This program will read an altlog photometry file as generated by
  basphote and extract one object from the file, compute differential
  photometry for the program object (Serial #0000) against the field
  stars.
 CATEGORY:
  Photometry
 CALLING SEQUENCE:
  onchip,logname,objname,filter,object,primary,others,jd,time,mag,err
 INPUTS:
  logname - Name of the altlog format photometry file to read.
  objname - String with the exact name of the object to extract.
  filter  - String containing the filter code to extract.
  object  - Serial number of the object to extract.
  primary - Serial number of the on-chip reference star to use as
                   the primary reference.
  others  - Serial number(s) of the other on-chip stars to use as a
            check of the primary reference.  Scalar or vector.
            If set to -1, no secondary references are used.
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
  BARS    - Flag, if true, extend major ticks across plot (default=false)
  MAGPRI  - Magnitude of primary reference star (default=0).
  NOPLOT  - When set will inhibit generating a plot to the current
            plot device. (same as /NOPOS and /NOPHOT together).
  NOPOS   - No plot of the positions.
  NOPHOT  - No plot of the photometry.
  COLORS  - Colors to use for the plot.
                colors(0) = axis, program object, (primary standard)
                              default = !d.n_colors-1
                colors(1) = primary standard, default = 1
                colors(2) = secondary standard 1, default = 2
                colors(3) = secondary standard 2, default = 2
                   and so on.  COLORS should have as many elements as
                   needed for the object, primary standard, and all
                   secondary standards.
  NOERRBAR - Flag, if set suppresses error bars on star check mag plot
  SHOWALL  - Flag, if set, prints out all the relevant mangitudes to
               allow seeing which mags are being used.
  TIMEUNIT - Select time units to plot on x-axis,
              0 - UT hours (default)
              1 - JD (decimal days)
  UPPERCASE - Flag, if true, forces object names and filter names to upper case.
 OUTPUTS:
  jd   - Julian date of observation.
  time - UT of observation, decimal hours. (or JD, depending on TIMEUNIT)
  mag  - reduced magnitude of program object.
  err  - Uncertainty of the magnitude.
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  2/4/93, Written by Marc W. Buie, Lowell Observatory.
  6/29/93, MWB, added filter argument.
  96 Mar, MWB, added MAGPRI keyword
  96/06/15, MWB, improved the plotting output for the photometry plot.
  96/08/24, MWB, added TIMEUNIT and BARS keywords
  96/10/31, MWB, added "bad" flag support from rdphalt
  97/09/20, MWB, added UPPERCASE flag.