NAME:
  frmdxdy
 PURPOSE:
  Given two lists of source on field, find the dx,dy offset between lists.
 DESCRIPTION:

 CATEGORY:
  Astrometry
 CALLING SEQUENCE:
  frmdxdy,x1,y1,x2,y2,xoff,yoff,error
 INPUTS:
  x1 - X coordinate from list 1, in pixels.
  y1 - Y coordinate from list 1, in pixels.
  x2 - X coordinate from list 2, in pixels.
  y2 - Y coordinate from list 2, in pixels.
 OPTIONAL INPUT PARAMETERS:

 KEYWORD INPUT PARAMETERS:
  NX - maximum extent in X to consider (default is max([x1,x2]))
  NY - maximum extent in Y to consider (default is max([y1,y2]))
  MAXERR - maximum error allowed in initial spread test of position.
              (default=3)

 OUTPUTS:
  xoff - X offset (2-1) between positions in each list.
  yoff - Y offset (2-1) between positions in each list.
  error - Flag, set if something went wrong in correlating the lists.
 KEYWORD OUTPUT PARAMETERS:
  FOM - Figure of merit, a number than can be used (differentially) to
           measure how good the spatial correlation is.  This number is
           approximately the fraction of objects in the shortest list that
           ended up spatially correlated.  A number close to 1 should be
           good.

 COMMON BLOCKS:

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
  99/03/22, Written by Marc W. Buie, Lowell Observatory
  2005/06/21, MWB, changed called to robomean to trap errors.
  2007/11/21, MWB, merged with alternate code buried in astrom.pro