# Transfer Point Dataset to other Cell datatset

**URL:** https://discourse.paraview.org/t/transfer-point-dataset-to-other-cell-datatset/11677
**Category:** ParaView Support
**Created:** [March 22, 2023, 8:47pm UTC](https://discourse.paraview.org/t/transfer-point-dataset-to-other-cell-datatset/11677 "2023-03-22T20:47:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cyrille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cyrille/32/11214_2.png) [@cyrille](https://discourse.paraview.org/u/cyrille)
#### Post date: [March 22, 2023, 8:47pm UTC](https://discourse.paraview.org/t/transfer-point-dataset-to-other-cell-datatset/11677/1 "2023-03-22T20:47:04Z")

</div>

Hello,  
I have two datasets : the first one is a point data set and the second one is a dataset containing point data as well as cell data (UnStructuredGrid). It happens that the points of the first dataset are precisely the centroids of the cells of the second dataset.  
And I would like to pass the data of the first dataset (data at the cell centroids of the second dataset) as celldata to the second dataset. I tried different combinations of Resample with Dataset, PointDatatoCellData, etc… The most promising seems to be :

1. PointDatasetInterpolator (input = first dataset with the centroid data ; source = second dataset with the cells)
2. PointDatatoCellData

But still, it is not very satisfying, especially when the field data to transfer is not continuous.  
My problem is similar to that one ([https://discourse.paraview.org/t/transfer-data-from-structured-mesh-to-points/9712](https://discourse.paraview.org/t/transfer-data-from-structured-mesh-to-points/9712)), except that I want to do the exact opposite : transfer data from a point cloud to an Unstructured mesh.

Any hints on how to achieve this ?

Thanks

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [March 23, 2023, 7:45am UTC](https://discourse.paraview.org/t/transfer-point-dataset-to-other-cell-datatset/11677/2 "2023-03-23T07:45:38Z")

</div>

The attached Python scripts does exactly what you want.  
I have created an hexahedral grid, then I have extracted its cell centers. I have added random PointData to it for the purpose of the demonstration.  
That PointData array has a number of tuples equal to the number of cell centers. I can then attach it to the hexahedral grid’s CellData.  
[pvPointData2CellData.py](https://discourse.paraview.org/uploads/short-url/aGpMtVSZnF2Y4oD7q4VfdYqYGCV.py) (3.3 KB)

---

<div class="post-metadata">

### Author: ![cyrille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cyrille/32/11214_2.png) [@cyrille](https://discourse.paraview.org/u/cyrille)
#### Post date: [March 23, 2023, 1:52pm UTC](https://discourse.paraview.org/t/transfer-point-dataset-to-other-cell-datatset/11677/3 "2023-03-23T13:52:09Z")

</div>

Thank you very much ! It works great.
