[Paraview] [EXTERNAL] Importing Vector (i.e., CSV text) files

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Feb 26 08:28:50 EST 2016


Can you attach a sample file that "does not work"? I tried spaces,
multiple spaces, commas as separators and all worked just fine for me.
I set the "Field Delimiter Characters" as a space (or comma) and also
checked "Merge Consecutive Delimiters". Likewise, the sample file Alan
included also loads for me.

Note, a CSV file will simply be read in as a Table. If you want
ParaView to interpret the x-coord, y-coord arrays as point
coordinates, you have to apply the "Table to Points" filter and select
which columns correspond to the coordinates. Similar to combine
multiple columns into a vector, you have to apply the "Calculator"
filter and use a function such as "iHat * scalar0 + jHat * scalar1".

Attached state file and csv demonstrates how a file with 4 columns can
be processed to read points and velocity vectors.

Utkarsh



On Fri, Feb 26, 2016 at 6:37 AM, Zach <zachnap at gmail.com> wrote:
> I think there may be two spaces, but whitespace is whitespace. Not even
> Excel gets confused by the spacing. I've tried the sample case above, but PV
> still did not recognize the delimit.
>
> I have 4 columns:
>
> x-coord y-coord u-velocity v-velocity
>
> The x, y, z, scalar doesn't achieve what I want.
>
> I need something of the form:
>
> x-coord y-coord vector-direction scalar
>
> Thanks
>
> On Thu, Feb 25, 2016 at 9:55 PM, Scott, W Alan <wascott at sandia.gov> wrote:
>>
>> Just guessing here – you may have more spaces in the file than you think?
>> Or, PV may be looking for a space, and you have two?  That’s the reason I
>> recommend commas.
>>
>>
>>
>> Try this little toy problem that I use all the time:
>>
>>
>>
>> x-coord y-coord z-coord scalar
>>
>> 0 0 0 0
>>
>> 1 0 0 1
>>
>> 0 1 0 2
>>
>> 1 1 0 2
>>
>> -0.5 -0.5 1 4
>>
>> -0.5 -0.5 1 5
>>
>> -0.5 -0.5 1 6
>>
>> -0.5 -0.5 1 7
>>
>>
>>
>>
>>
>>
>>
>> From: Zach [mailto:zachnap at gmail.com]
>> Sent: Thursday, February 25, 2016 7:53 PM
>> To: Scott, W Alan
>> Cc: paraview at paraview.org
>>
>>
>> Subject: Re: [EXTERNAL] [Paraview] Importing Vector (i.e., CSV text) files
>>
>>
>>
>> Alan,
>>
>>
>> I have tried the " ", and it didn't have the effect I had hoped for.
>>
>> Yes, table to point makes points at the coordinates. I have vectors at
>> certain pixel coordinates - processed PIV images. I have (x,y) location with
>> a vector of velocity components (Ux, Uy) at those coordinates. The table to
>> point seems to be wanting a scalar value at the location.
>>
>> Thanks
>>
>>
>>
>> Zach
>>
>>
>>
>> On Thu, Feb 25, 2016 at 7:02 PM, Scott, W Alan <wascott at sandia.gov> wrote:
>>
>> Zach,
>>
>>
>>
>> Please keep this reply on list, so we all get to learn (and I get to be
>> corrected when I mess up).
>>
>>
>>
>> Try changing the Field Delimiter Characters string to be “ “
>>
>>
>>
>> Table to point makes points (or dots).  I don’t understand your comment
>> about vectors.
>>
>>
>>
>> Alan
>>
>>
>>
>> From: Zach [mailto:zachnap at gmail.com]
>> Sent: Thursday, February 25, 2016 4:26 PM
>> To: Scott, W Alan
>> Subject: Re: [EXTERNAL] [Paraview] Importing Vector (i.e., CSV text) files
>>
>>
>>
>> I saw the comma separation, but very inconvenient not to have whitespace
>> delimit. That means I have to go through 30,000 files and change the format
>> - sure it only requires writing a script to change, but white space delimit
>> is a fairly basic standard.
>>
>> I have used the table to point filter, but I have vector data, the filter
>> reads an X, Y, and Z value. I have x and y location and then Ux, and Uy. So,
>> i have only been able to get dots at the x,y locations so far but no
>> vectors.
>>
>> Thanks for the help.
>>
>> Zach
>>
>>
>>
>> On Tue, Feb 23, 2016 at 9:57 PM, Scott, W Alan <wascott at sandia.gov> wrote:
>>
>> I’m not sure if white space works – but comma’s do work.
>>
>>
>>
>> For instance, X, Y, Z, Var does work.
>>
>>
>>
>> Then, use the Table to Point filter.
>>
>>
>>
>> There is more information here:  http://www.paraview.org/Wiki/Data_formats
>>
>>
>>
>> Does that answer the question?
>>
>>
>>
>> Alan
>>
>>
>>
>> From: ParaView [mailto:paraview-bounces at paraview.org] On Behalf Of Zach
>> Sent: Tuesday, February 23, 2016 7:47 PM
>> To: paraview at paraview.org
>> Subject: [EXTERNAL] [Paraview] Importing Vector (i.e., CSV text) files
>>
>>
>>
>> Hello:
>>
>> I am trying to import vector files into Paraview which are really just csv
>> text files delimited by whitespace. I am able to open the files, but they
>> read in as a single column and I am unable to find the "delimit options" in
>> any of the manuals or online materials.
>>
>> Do vector files need to be formatted with a particular scheme in order for
>> Paraview to properly read them? Thanks
>>
>> Regards,
>>
>> Zach
>>
>>
>>
>>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CSVAsPoints.pvsm
Type: application/octet-stream
Size: 226368 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160226/8868a2ec/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.csv
Type: text/csv
Size: 60 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160226/8868a2ec/attachment-0001.csv>


More information about the ParaView mailing list