Return a sine grating pattern (two-dimensional sine wave).

def function(self,p):
        """Return a sine grating pattern (two-dimensional sine wave)."""
        return 0.5 + 0.5*np.sin(p.frequency*2*pi*self.pattern_y + p.phase)