throw error if coordinate dimensions don't match grid