Exporting a vector field to a csv file

Hello,
I have a field with 500 vectors and I would like to export the (X,Y,Z) of the vectors to a csv file.
pic of the vectors:

When i do File-> Save Data -> “file.csv”, I get a csv file that looks like this:
image

One problem is that the file has 15470 rows.
But the main problem is that the (X,Y,Z) beggining and ending aren’t the same as the data is Paraview.
what can I do to get the real points? Or maybe I am reading the data wrong in the CSV file?

I am uploading the csv file so whoever wants to give it a try is welcome.

Thank you, Ohad

asd.csv (675.2 KB)

Are you exporting the results of the glyph filter ?
Can you share your original data ?

Yes the glyph filter.
The files are huge (over 1gb), I can try and send you them if you want

You want to export the output of the reader, not the glyph filter.

And how do I do that? I tried threw the python shell and it didn’t work

Please share a screenshot of ParaView (including the interface and pipeline browser) just before you export.

This is the paraview screen.

This is an error I get when i try to export.
When i saved the data i did save data, not export

‫בתאריך יום ד׳, 8 ביולי 2020 ב-14:24 מאת ‪Mathieu Westphal (Kitware) via ParaView‬‏ <‪noreply@discourse.paraview.org‬‏>:‬

  • Click on the extract subset filter in the pipeline browser
  • File -> SaveData -> .csv -> OK
  • You csv file should be ok.

I did it and I got a csv file with only 3 columns. How does this represent the vectors?

Hard to say. Please share you original file and what you are trying to achieve exactly.

The original files are over 2gb and it will be hard for me to share them with you.

I have a raw file (.raw) from an experiment I have done. I loaded it in Paraview with a python script (I’ll share here) and i can see the vectors (in the image I sent).
My goal is to have a csv file with (x, y, z) beginning and ending or with an angel and length.

glyphTrace.py (51.9 KB)

https://drive.google.com/drive/folders/1GfnFQNmBeK6KH7qiGwXNVXyY9HQ2aXid?usp=sharing

the files i import (the raw file) is here

‫בתאריך יום ד׳, 8 ביולי 2020 ב-14:50 מאת ‪Ohad Mishael‬‏ <‪ohad.mishael@mail.huji.ac.il‬‏>:‬

My goal is to have a csv file with (x, y, z) beginning and ending or with an angel and length.

So here what you need to do :

  • Open your file
  • Extract the subset your are interested in using ExtractSubset, apply
  • Add an AppendDataset filter, Apply
  • Add a calculator filter to compute the angle of the vector, Apply
  • Add a calculator filter to compute the length of the vector, Apply
  • Add a PassArray filter to remove the arrays you are not interested in
  • File → SaveData → csv

This should create the file you are looking for.

I’m not sure what you mean when you say how to compute angle and length of vector

This is for you to define what you mean by that in your original message.
It may be something like that : https://www.intmath.com/vectors/7-vectors-in-3d-space.php

In the File -> Save Data -> csv -> there is a Choose Arrays To Write option. Now, you get to output whatever you want. Thus, no need for the Pass Arrays filter.

1 Like