def METHOD_NAME(self, fits, extname):
    """Write the solution to a FITS binary table.
    Save the knn params and the locations and targets arrays
    :param fits:        An open fitsio.FITS object.
    :param extname:     The base name of the extension with the interp information.
    """
    dtypes = [('LOCATIONS', self.locations.dtype, self.locations.shape),
              ('TARGETS', self.targets.dtype, self.targets.shape),
              ('XPIXEL', self.Xpixel.dtype, self.Xpixel.shape),
              ('MISALIGNMENT', self.misalignment.dtype, self.misalignment.shape)]
    data = np.empty(1, dtype=dtypes)
    # assign
    data['LOCATIONS'] = self.locations
    data['TARGETS'] = self.targets
    data['XPIXEL'] = self.Xpixel
    data['MISALIGNMENT'] = self.misalignment
    # write to fits
    fits.write_table(data, extname=extname + '_solution')