add option to crop the front and end of data arrays