NAME:
  mkhull2
 PURPOSE:   (one line only)
  Create a smoothed outline based on an occultation limb profile
 DESCRIPTION:
  This routine attempts to create a smooth outline that passes near a set
    of occultation limb points.  The points are converted to polar and
    straight lines between points are used in this coordinate system.  The
    line segments are smoothed by the use of a lowess call with the
    smoothing width set to ARES.  It is not meant to be a fit but can still
    be a useful tool rather than fitting strict mathematical shapes.
 CATEGORY:
  Occultations
 CALLING SEQUENCE:
  mkhull2,xi,eta,hxi,heta
 INPUTS:
  xi - Tangent plane coordinate of measured point on the limb
  eta - Tangent plane coordinate of measured point on the limb
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  NPTS - Number of points in the outline (default=100)
  ARES - angular resolution smoothing width (degrees), default=20
 OUTPUTS:
  hxi - coordinates on the smoothed outline
  heta - coordinates on the smoothed outline
 KEYWORD OUTPUT PARAMETERS:
  SORTIDX - vector of indicies into xi,eta that are sorted by angle
 CONFIGURATION:
 COMMON BLOCKS:
 SIDE EFFECTS:
 PROCEDURE:
  The Cartesian coordinates are converted to polar coordinates, sorted by
    angle, padded by 2pi before and after the data with a copy of the data,
    lowess fitted, then the principal value is converted back to Cartesian
    coordinates.
 RESTRICTIONS:
  This won't work if there aren't enough points but where, when, and how
    it will fail isn't easy to predict.
 MODIFICATION HISTORY:
  Written by Marc W. Buie, Southwest Research Institute, 2023/03/25
  2023/05/17, MWB, cloned from mkhull
  2024/06/05, MWB, added SORTIDX