geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
217 stars 232 forks source link

script to convert ASCII data to netcdf files #5818

Closed alarshi closed 3 weeks ago

alarshi commented 1 month ago

this PR adds a python script that can use an input ASCII file structured using ASPECT convention and then convert it to netcdf format, which is much smaller in size. We also account for differences in the output netcdf for visualization in paraview and the aspect input file, in case of spherical coordinate system.

Before your first pull request:

For all pull requests:

gassmoeller commented 1 month ago

/rebuild

alarshi commented 1 month ago

Thank you ! I addressed your suggestions in the latest commit and added a changelog entry.

tjhei commented 4 weeks ago

I am not sure how specifying dim=0 would work. When loading, depth profiles are dim=1, p-t tables are dim=2, etc.. The data columns clearly need to depend on the other variables. Is there a way for Python to grab the table headers from the ASCII file? If not, we can just ask the user to specify it if necessary.

Am I wrong?

tjhei commented 4 weeks ago

We can of course merge as is and improve later...