def function(self,p):
return np.around(<EOL><NUM_LIT:0.5> +<EOL><NUM_LIT:0.5>*np.sin(pi*(p.duty_cycle-<NUM_LIT:0.5>)) +<EOL><NUM_LIT:0.5>*np.sin(p.frequency*<NUM_LIT:2>*pi*self.pattern_y + p.phase))<EOL>
Return a square-wave grating (alternating black and white bars).