Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv xyz formatting and density #326

Closed
zoner72 opened this issue Dec 24, 2020 · 4 comments
Closed

csv xyz formatting and density #326

zoner72 opened this issue Dec 24, 2020 · 4 comments
Labels
mesh-creation Topics around creating a PyVista mesh

Comments

@zoner72
Copy link

zoner72 commented Dec 24, 2020

Hi

I hope you all are well and having a great festive season.

Ive been trying to find the best plugin/way to visualise bathymetry data sets, and have tried quite a couple.
I like the look and feel of pv and had some great results already. In addition, the demos are great teasers, really like them.
Just to let you know, I am probably considered an intermediate beginner with python.

Now that that is out of the way. I want to import bathymetry data for visualisation (and later on, perform underwater acoustic calculations on the imported bathy arrays).
my datasets can be of average size (200mb), or pretty big (~800mb) but the gist of it is, most of the time I first convert it to an x,y,z.csv

What I would really like is something like the Ruapehu demo. I downloaded the raw file but it was pretty much unreadable in text format. *edit, it is a *.vtk which looks like it is a binary file

I basically have two questions:
Is there a converter (or another easy way) for an x,y,z.csv to the Ruapehu format.
In addition, is there an easy way to reduce the grid density size without interpolation. For example only plot 50m x 50m instead of 1m x 1m.

kind regards

@zoner72
Copy link
Author

zoner72 commented Dec 28, 2020

This link just came by miraculous on my Google feed. https://vtk.org/Wiki/VTK/Writing_VTK_files_using_python

I guess I test this out

@banesullivan
Copy link
Member

banesullivan commented Dec 28, 2020

Your best bet is to use a library like pandas to read/parse your CSV file and create a PyVista mesh from those data arrays.

See:

You'll either make a pv.PolyData or pv.StructuredGrid mesh of your XYZ points. Hard to help any further without having the data file

In addition, is there an easy way to reduce the grid density size without interpolation. For example only plot 50m x 50m instead of 1m x 1m.

You'd need to subsample the grid. We have some helpers methods to do that with the pv.StructuredGrid class. If you upload your data, we can try to help create a simple example.

@banesullivan banesullivan added the mesh-creation Topics around creating a PyVista mesh label Dec 28, 2020
@zoner72
Copy link
Author

zoner72 commented Dec 28, 2020

Hi Bane

thanks for your reply. I did have some success with polydata and meshgrid but wasn't quite sure if this was the best option.
Ive included a link with the scripts and one of the bigger test files I've been using.
I have tried a lot of different modules (matlab etc) but could never find a good uniform way due to data size and post processing.
https://karsdorp.myqnapcloud.com/share.cgi?ssid=0WyPkj0

hope you can hep out.

@banesullivan
Copy link
Member

Apologies for the slow response, I am trying to go through and resolve stale issues.

The data link appears to have expired and you mention having success with polydata, so I am going to close this.

Please re-open/re-comment if you still have a question for this topic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mesh-creation Topics around creating a PyVista mesh
Projects
None yet
Development

No branches or pull requests

2 participants