Converting Rectilinear Grid data type with spherical coordinates into Spherical representation

I am a new ParaView user and would like to understand how to get ParaView to represent the data file I am using in a spherical format. The background is as follows: I initially received a .FITS file containing data on the Sun’s magnetic field. A friend helped me to convert this into a .vtr file so I could view it using ParaView. The .vtr file I have is of type “Rectilinear Grid” and represents its coordinates as X, Y, Z, where each point/cell stores a magnetic field vector which represents the X,Y,Z components of the magnetic field magnitude at that point. When I view this data in ParaView as a Surface, it looks like a simple 3-D rectangular cube. However, the X,Y, and Z coordinates actually represent the radial, latitudinal, and longitudinal coordinates in relation to the Sun. Thus, when I view this data in ParaView, it would make more sense to see a 3-D sphere so each point can be plotted appropriately according its radius, latittude, and longitude. This is what I am not sure how to do. I am guessing the issue could be with the initial creation of the .vtr file. Perhaps instead of creating it as a “Rectilinear Grid” it should have been created as a “Curvilinear Grid”. If so, is there a way in Paraview to automatically convert a Rectilinear Grid to a Curvilinear Grid, or would I need to re-generate the .vtr file from scratch. If anyone has any helpful suggestions/resources, please let me know. By the way, I have reviewed the Paraview Guide to see if I could find an answer there, but did not see anything that directly answered by questions. Also, I tried to upload the file I am working with, but was not able to because I think its too large (96MB) for upload. Thanks so much.

IMO you need to regenerate your dataset correctly from the original file. There is no filter convert from X,Y,Z to spherical.

However, you can implement this conversion in a simple Programmable filter if you know all the parameters to compute it.

you will find some useful source code in this old blog article

Hi Mathieu,

Sorry for my slow reply on this. Thanks for your suggestions. I am new to using Programmable Filters and need to educate myself on how to use those effectively. Regarding your first suggestion that I need to regenerate the dataset correctly from the original file, does this mean that I need to convert the original dataset from Spherical (Radius, Theta, Phi) to Cartesian (X,Y,Z) using the standard equations for this (i.e. X = R sin (theta) cos (phi), etc.) and then load the Cartesian data into Paraview? Currently, I have loaded the Radius coordinate as Z, the Phi coordinate as X, and the Theta coordinate as Y, which is incorrect and is why the data looks like a cube when it should really look like a sphere.

Jean- thanks for sharing the blog post. I found it a bit confusing, but hopefully it will make more sense as I get more familiarity/practice with using programmable filters in the first place.

Yes, this was my suggestion.