# programmable filter rectilinear to unstructured

**URL:** https://discourse.paraview.org/t/programmable-filter-rectilinear-to-unstructured/13878
**Category:** ParaView Support
**Tags:** python
**Created:** [February 5, 2024, 11:40pm UTC](https://discourse.paraview.org/t/programmable-filter-rectilinear-to-unstructured/13878 "2024-02-05T23:40:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ronan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ronan/32/13583_2.png) [@Ronan](https://discourse.paraview.org/u/Ronan)
#### Post date: [February 5, 2024, 11:40pm UTC](https://discourse.paraview.org/t/programmable-filter-rectilinear-to-unstructured/13878/1 "2024-02-05T23:40:19Z")

</div>

I am trying to apply a filter to change altitude from a netcdf input file according to a 3d variable present in the file.  
I am followed this [example](https://www.kitware.com/scientific-visualization-of-weather-research-and-forecasting-model-output-in-paraview/)  
applying this code

```auto
import numpy as np 

# Obtenez l'entrée (le jeu de données sur lequel le filtre est appliqué)
input = self.GetInput()

numPoints = input.GetNumberOfPoints()
 
# Créer un nouvel objet pour stocker les nouvelles coordonnées
newPoints = vtk.vtkPoints()

# Supposons que 'variable' est le nom de la variable à utiliser pour ajuster l'altitude
altitudeVariable = input.GetPointData().GetArray('altitude')

print(numPoints)

for i in range(numPoints):
    x, y, z = input.GetPoint(i)
    # Ajustez l'altitude basée sur la valeur de la variable
    newZ = altitudeVariable.GetValue(i)
    newPoints.InsertPoint(i, x, y, z)
    
print(newPoints)

# Mettez à jour les points dans l'objet de sortie
output = self.GetOutput()
output.ShallowCopy(input)
output.SetPoints(newPoints)

```

to get the code not crashing I set output as StructruredGrid (or Unstructured), but it looks like this is giving me an empty domain. I cannot plot points or extract contour from it.
