# Remove points from a dataset knowing their exact location

**URL:** https://discourse.paraview.org/t/remove-points-from-a-dataset-knowing-their-exact-location/8683
**Category:** ParaView Support
**Created:** [December 22, 2021, 6:56pm UTC](https://discourse.paraview.org/t/remove-points-from-a-dataset-knowing-their-exact-location/8683 "2021-12-22T18:56:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Captain\_Convergence](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e19b73/32.png) [@Captain\_Convergence](https://discourse.paraview.org/u/Captain_Convergence)
#### Post date: [December 22, 2021, 6:56pm UTC](https://discourse.paraview.org/t/remove-points-from-a-dataset-knowing-their-exact-location/8683/1 "2021-12-22T18:56:45Z")

</div>

Dear all,

I am working with a MultiBlock mesh which gives me issues when I try to compute spatial gradients (Vorticity, Q-criterion etc…) due to the abrupt change in the [deltaX,deltaY] when the point that limits the block boundaries is exported from out solver (I cannot get rid of it from the solver since it was programmed like this).

I managed to obtain the exact location of these block boundary points with the filters that you observe in the image below:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/8/89018b634f8a2d9a981c4fec440e51916632758d.png)

Now I need to remove them from the original dataset. I have been trying to play with a programmable filter but I am facing two challenges:

1. When the CompositeDataSet is exported, it only contains 32 decimal points (float32) and since my spatial coordinates have +50 decimals, a float32 will not be sufficient. For instance, this are the kind of truncation problems that I have when I pass the variables to the python filter and bring them back to paraview:  

2. Neglecting the first problem (which is really critical only near the wall), I managed to extract the points in the filter as you can see below. The problem now is that I have the data deconstructed in flat arrays (coordinates and point data) that I need to bring back in unstructured grid format in order to be able to compute gradients and this is not as simple as I first expected. I have been reading in several vtk forums how to generate an unstructured grid but a connectivity matrix between cells is obviously needed that I am unable to reproduce for my case. One Idea that came to my mind is to copy the input format to the output like `output = dsa.WrapDataObject(inputs[0])` and then modify each attribute from this new `output` CompositeDataSet in order to match my needs. Then the output of the programmable filter will have the same exact format as the input but with another data. Unfortunately I am not able to modify the data from the CompositeDataSet (probably because it is not as simple as something like `input_0.PointData.ArrayNames = ['NewArray0','NewArray1']`)  

For all this I would like to ask for advice and to know if they way I am tackling this problem is the right one. Should I keep trying to manipulate the data via a python filter or is there any paraview filter that allows the user to substract the points of a filter by removing the points from another filter contained in the first one? I would appreciate any new ideas about how to remove these annoying points from the dataset.

Thank you in advance!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 27, 2021, 9:55am UTC](https://discourse.paraview.org/t/remove-points-from-a-dataset-knowing-their-exact-location/8683/2 "2021-12-27T09:55:22Z")

</div>

Do you have the Ids of the points you want to remove ? If so, removing them is trivial using a selection.

---

<div class="post-metadata">

### Author: ![Captain\_Convergence](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e19b73/32.png) [@Captain\_Convergence](https://discourse.paraview.org/u/Captain_Convergence)
#### Post date: [December 27, 2021, 4:12pm UTC](https://discourse.paraview.org/t/remove-points-from-a-dataset-knowing-their-exact-location/8683/3 "2021-12-27T16:12:05Z")

</div>

I can use `GenerateGlobalIds` at the very beginning so each point will have a variable assigned with its ID. Then I can program a python filter that feeds into the `ExtractSelection` the points that I want to keep.

However, I did a test where I extract a random set of points as you can observe below. The problem is that it seems that these points are extracted as isolated entities and they cannot be connected in a surface. I would need that all the points form a continuous surface where I can compute my gradients.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/6/602ad1f4afd38cd63dbed2234e8861a8315b58bc.png)

,

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 27, 2021, 4:25pm UTC](https://discourse.paraview.org/t/remove-points-from-a-dataset-knowing-their-exact-location/8683/4 "2021-12-27T16:25:42Z")

</div>

Then you want to extract cells, not points.

---

<div class="post-metadata">

### Author: ![Captain\_Convergence](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e19b73/32.png) [@Captain\_Convergence](https://discourse.paraview.org/u/Captain_Convergence)
#### Post date: [December 27, 2021, 4:31pm UTC](https://discourse.paraview.org/t/remove-points-from-a-dataset-knowing-their-exact-location/8683/5 "2021-12-27T16:31:14Z")

</div>

Yes, sorry I am used to work with point data. I can convert the point data to cell data and extract some cells, however if there are gaps between the extracted cells (I will have them becase I need to remove the extra cells between the blocks) it seems that this space will be left empty:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/8/865eeb5471d382fc4ab3f2ed8955648425fd6cde.png)
