code: def integrator(integrand,xmin,xmax,n_points,factor=2):
      '''
      Creating theoretical curve for 2D model functions
      integrator function
      '''
      integral_vector = np.empty([n_points+1])
      dx  = (xmax-xmin)/n_points
      # integrate
      for i in xrange(n_points+1):
          xnow = xmin + i * dx
          integral, error = integrate.quad(rotate(integrand,
                  xnow), xmin*factor, xmax*factor)
          integral_vector[i] = integral
      # normalize
      normalization = np.average(integral_vector)*(xmax-xmin)
      normalized_vector = integral_vector/normalization
      return normalized_vectof integrator(integrand,xmin,xmax,n_points,factor=2):
      '''
      Creating theoretical curve for 2D model functions
      integrator function
      '''
      integral_vector = np.empty([n_points+1])
      dx  = (xmax-xmin)/n_points
      # integrate
      for i in xrange(n_points+1):
          xnow = xmin + i * dx
          integral, error = integrate.quad(rotate(integrand,
                  xnow), xmin*factor, xmax*factor)
          integral_vector[i] = integral
      # normalize
      normalization = np.average(integral_vector)*(xmax-xmin)
      normalized_vector = integral_vector/normalization
      return normalized_vector
docs: Creating theoretical curve for 2D model functions
      integrator function