split_by_grid function

Split data with a grid