def to_contour(grid_size=@npoints)
		m = Matrix.alloc(grid_size, grid_size)
		raise TypeError("Must be 3d data") unless @gridpoints.shape[1] == 2
# 			p @gridpoints.shape
# 			p @gridpoints
		xmax, xmin = @gridpoints.col(0).max, @gridpoints.col(0).min
		ymax, ymin = @gridpoints.col(1).max, @gridpoints.col(1).min
		p 'x', xmax, 'y', ymax
		xvec = GSL::Vector.alloc((0...grid_size).to_a) * (xmax - xmin) / (grid_size - 1.0).to_f + xmin
		yvec = GSL::Vector.alloc((0...grid_size).to_a) * (ymax - ymin) / (grid_size - 1.0).to_f + ymin	
		p 'x', xvec.max, 'y', yvec.max

		for i in 0...grid_size
			for j in 0...grid_size
# 					p xvec[i], yvec[j]
				m[i,j] = eval(xvec[i], yvec[j])
			end
		end
		p 'm', m.max
		Contour.alloc(xvec, yvec, m)
	end
def to_contour(grid_size=@npoints)
		m = Matrix.alloc(grid_size, grid_size)
		raise TypeError("Must be 3d data") unless @gridpoints.shape[1] == 2
# 			p @gridpoints.shape
# 			p @gridpoints
		xmax, xmin = @gridpoints.col(0).max, @gridpoints.col(0).min
		ymax, ymin = @gridpoints.col(1).max, @gridpoints.col(1).min
		p 'x', xmax, 'y', ymax
		xvec = GSL::Vector.alloc((0...grid_size).to_a) * (xmax - xmin) / (grid_size - 1.0).to_f + xmin
		yvec = GSL::Vector.alloc((0...grid_size).to_a) * (ymax - ymin) / (grid_size - 1.0).to_f + ymin	
		p 'x', xvec.max, 'y', yvec.max

		for i in 0...grid_size
			for j in 0...grid_size
# 					p xvec[i], yvec[j]
				m[i,j] = eval(xvec[i], yvec[j])
			end
		end
		p 'm', m.max
		Contour.alloc(xvec, yvec, m)
	end
Create a GSL::Contour object for making contours of the interpolated function. Only works for functions of 2 variables.