# Streamlines in spherical coordinates

**URL:** https://discourse.paraview.org/t/streamlines-in-spherical-coordinates/1427
**Category:** ParaView Support
**Created:** [March 8, 2019, 2:41pm UTC](https://discourse.paraview.org/t/streamlines-in-spherical-coordinates/1427 "2019-03-08T14:41:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Gherardo\_Valori](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gherardo_valori/32/3116_2.png) [@Gherardo\_Valori](https://discourse.paraview.org/u/Gherardo_Valori)
#### Post date: [March 8, 2019, 2:41pm UTC](https://discourse.paraview.org/t/streamlines-in-spherical-coordinates/1427/1 "2019-03-08T14:41:45Z")

</div>

Hi,  
I am trying to plot streamlines of a 3D vector field in spherical coordinates. I have the three components (Br,Bt,Bp) loaded as separate scalar fields from a netcdf file with standard CF convention (ie with latitude, longitude and radial coordinates). This seems to be recognized by Paraview, ie I get indeed a spherical grid. Next, in order to use the streamline filter, I need first to apply the “Cell to point data” filter, and then to combine the scalar components into a vector using the Calculator filter as  
iHat\*Br+jHat\*Bp+kHat\*Bt  
which does not result in the proper vector field (I know what the answer should look like). I guess the problem is that i/j/kHat are the unit vectors of the Cartesian reference system, not the one of the spherical coordinate system. Is there a straightforward way to build the vector field from the scalar components in spherical coordinates?  
Thanks  
Gherardo

---

<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: [March 11, 2019, 10:13am UTC](https://discourse.paraview.org/t/streamlines-in-spherical-coordinates/1427/2 "2019-03-11T10:13:58Z")

</div>

You will need to convert your field to cartesian coordinates first.

---

<div class="post-metadata">

### Author: ![Gherardo\_Valori](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gherardo_valori/32/3116_2.png) [@Gherardo\_Valori](https://discourse.paraview.org/u/Gherardo_Valori)
#### Post date: [March 12, 2019, 11:28am UTC](https://discourse.paraview.org/t/streamlines-in-spherical-coordinates/1427/3 "2019-03-12T11:28:05Z")

</div>

Hi Mathieu,  
thanks for your quick reply! Can you shortly elaborate on your suggestion? I am not sure that I understand that correctly: I have a spherical grid, properly recognized by paraview, and in order to visualize streamlines of a vector field given in spherical coordinates I need to convert that to Cartesian? If this is what you suggest, I did try it but the streamlines are still incorrect. I can imagine this is a common configuration, a reference to an example would be equally good.  
Thanks for your time  
Gherardo

---

<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: [March 12, 2019, 12:06pm UTC](https://discourse.paraview.org/t/streamlines-in-spherical-coordinates/1427/4 "2019-03-12T12:06:32Z")

</div>

There is no automatic way to do this yet.  
Some ressources :  
[https://www.paraview.org/pipermail/paraview/2010-August/018495.html](https://www.paraview.org/pipermail/paraview/2010-August/018495.html)

> [@vector transformation in spherical and Cartesian coordinates](https://discourse.paraview.org/t/vector-transformation-in-spherical-and-cartesian-coordinates/262/3):
>
> Hi Andy, I have typed the multiply symbol in the calculator filter. I think it is just in this forum the \* symbol is hidden automatically.

> **[Use Paraview to plot vector field in spherical geometry](https://phychai.wordpress.com/2013/08/01/paraview_vectorfield/)**
>
> It is easy to use paraview to draw vector fields in a cubic geometry. However, for spherical geometry, it is quite troublesome. This is because the utility glyph only recognize Cartesian coordinate…

> <https://stackoverflow.com/questions/17375777/cartesian-cylindrical-conversion-in-paraview>

---

<div class="post-metadata">

### Author: ![Gherardo\_Valori](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gherardo_valori/32/3116_2.png) [@Gherardo\_Valori](https://discourse.paraview.org/u/Gherardo_Valori)
#### Post date: [March 12, 2019, 2:58pm UTC](https://discourse.paraview.org/t/streamlines-in-spherical-coordinates/1427/5 "2019-03-12T14:58:15Z")

</div>

Thank you very much Mathieu, i will work my way through those. Have a nice day  
Gherardo
