NAME:
  hstmodtarg
 PURPOSE: (one line)
  Calculate chi-square value for point source target fit
 DESCRIPTION:
  Chi-sq function for Powell and Amoeba fitting and showmodel.
 CATEGORY:
  Astrometry
 CALLING SEQUENCE:
  hstmodtarg, vals
 INPUTS:
  vals - array of parameters to fit, It is a three element vector = [x,y,flux]
           The common block includes the fit keywords that controls which
           variables are included in vals.
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
 OUTPUTS:
  return the chisq for the model computed from vals
 COMMON BLOCKS:
  com_hsttargfit:   Used for communication of data
 SIDE EFFECTS:
  Uses HST PSF images (hstpsf.pro) which may cause the memory and disk PSF
     caches to be populated.

 RESTRICTIONS:
 PROCEDURE:

 MODIFICATION HISTORY:
  2011/03/24, MWB, cloned from hst15 routine of the same name.
  2011/05/07, MWB, internal restructuring to keep more intermediate
                      results including full arrays of everything
  2014/07/03, MWB, cloned from chimodplch
  2016/12/21, MWB, added option for flux input as a magnitude
  2020/06/23, MWB, generalized version