parameters: (data, model)
return_statement: return np.sum((data.ravel() - model.ravel())**2 / err) / len(data.ravel())
docstring: Returns the chi^2 for a data set and model pair
docstring_summary: Returns the chi^2 for a data set and model pair
docstring_tokens: Returns the chi^2 for a data set and model pair
function: def chi2(data, model):
      """ Returns the chi^2 for a data set and model pair """
      err = np.fabs(data.ravel())
      err[err<=0] = 1
      return np.sum((data.ravel() - model.ravel())**2 / err) / len(data.ravel())
function_tokens: def chi2 ( data , model ) : err = np . fabs ( data . ravel ( ) ) err [ err <= 0 ] = 1 return np . sum ( ( data . ravel ( ) - model . ravel ( ) ) ** 2 / err ) / len ( data . ravel ( ) )