Dear All,<br><br>What i want to do is the following:<br><br>- I am reading volume data from a netCDF file <br>- I want to compute the isosurfaces<br><br>I am able to do both of them using a rectilinear grid, so as I have the isosurfaces on a rectilinear shape including the depth, <br>
but when I try to map these data on a sphere (using conversion from cartesian to spherical) using StructuredGrid and I visualise the result <br>seems that  the depth dissapear and I have as result a circle.<br><br>The code to map the latitude, longitude and depth to X,Y,Z for mapping to sphere is the following:<br>
<br><span lang="EN-GB">
<p># Convresion to spherical coordinates</p>
<p>E_Radius = 6370</p>
<p>gamma = 10</p>
<p>volume = empty(shape=(len(zc), len(xc), len(yc)), dtype=float32, order='C') </p>
<p>coordinates = array([0,0,0], dtype=int)</p>
<p>lats = xc.getValue()</p>
<p>longs = yc.getValue()</p>
<p>depths = zc.getValue()</p>
<div># I generate a vtk Points data structure where to put the coordinates</div>
<div>points = vtk.vtkPoints()</div>
<p>points.Allocate(10, len(xc)*len(yc)*len(zc))</p>
<div># I start the conversion of teh coordinates, the volume data are transfered in a 3-D array</div>
<div># the coordinates are in 1-D array with offset to relate the coordinate to the volume pixel. I did </div>
<div># also without this offset but the result si the same</div>
<div> </div>
<div>for k in range(len(zc)):</div>
<p>   kOffset = k * len(xc) * len(yc)</p>
<p>   for i in range(len(xc)):</p>
<p>     iOffset = i * len(yc)</p>
<p>     for j in range(len(yc)):</p>
<p>       coordinates[0] = (E_Radius + gamma*k) * cos(lats[i]) * cos(longs[j]) # x</p>
<p>       coordinates[1]= (E_Radius + gamma*k) * cos(lats[i]) * sin(longs[j]) # y</p>
<p>       coordinates[2] = (E_Radius + gamma*k) * sin(lats[i]) # z</p>
<p>       Offset = j + kOffset + iOffset</p>
<p>       points.InsertPoint(Offset,coordinates)</p>
<p>       volume[k,i,j] = var[0,k,i,j] # have also put the volume data in a 1-D array indexing                                         # thedata with the Offset but no way</p>
<p></p>
<p>array_data = nm_to_vtk_array(volume, float32) </p>
<p>result = vtk.vtkStructuredGrid()</p>
<p>result.SetDimensions(len(zc), len(xc), len(yc))</p>
<p>result.SetPoints(points)</p>
<p>result.GetPointData().SetScalars(array_data)</p>
<p>return result</p></span><br>i have no idea why not a sphere but a circle is coming out.<br>Any Help?<br><br>Thanks a lot,<br>Alessandro.<br>