NAME:
  refgen
 PURPOSE:   (one line only)
  Generate a source/catalog cross-reference list
 DESCRIPTION:
 CATEGORY:
  Astrometry
 CALLING SEQUENCE:
  refgen,astinfo,fnsrc,catfile,ref
 INPUTS:
  astinfo - Anonymous structure that contains an astrometric description
               of a image-based coordinate system and its mapping to the
               celestial sphere.  (see mkastinfo for more information)
  fnsrc   - Name of source file to read (generated by findsrc.pro)
  catfile - Name of catalog sub-file to read (generated by refnet.pro)
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  MAGLIM    - Faint limit for the catalog.  Don't use anything fainter than
                this limit.  Default is 30.
  MAXERR    - Maximum allowed error on the instrumental magnitude
                (default=1 mag)
  NOROTSCAN - Flag, if set will suppress searching for a correlation
                at small rotations from nominal if the initial offset
                calculation fails.
 OUTPUTS:
  ref     - Anonymous structure with the cross-linked list (see rdref/wrref)
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  Written by Marc W. Buie, Southwest Research Institute, 2010/01/14
  2010/07/26, MWB, minor mod for new frmdxdy error codes
  2012/04/30, MWB, added NOROTSCAN (mostly as a debugging aid), added MAGLIM
  2012/05/01, MWB, added MAXERR keyword