base grating functionality to VisStim code