def METHOD_NAME(self, params, star, psf, logger=None):
    # modify star's fit values
    flux, du, dv = params
    star.fit.flux = flux
    star.fit.center = (du, dv)
    # draw star
    image_model = psf.drawStar(star).image
    # get chi
    image, weight, image_pos = star.data.getImage()
    chi = (np.sqrt(weight.array) * (image_model.array - image.array)).flatten()
    return chi