Code Monkey home page Code Monkey logo

Comments (6)

AndrewAnnex avatar AndrewAnnex commented on May 18, 2024

@AlexanderJuestel I've implemented something like this using pyvista on the lithblock. I think there is a larger idea of making a generic pyvista compatible grid class that could take "any" pyvista object, using pyvista to manage the resulting solution as well

from gemgis.

AlexanderJuestel avatar AlexanderJuestel commented on May 18, 2024

Hey @AndrewAnnex,

Would you mind sharing that to have a look if it is practical for my needs?

Best regards
Alex

from gemgis.

AndrewAnnex avatar AndrewAnnex commented on May 18, 2024

hey @AlexanderJuestel, I'm pretty busy for the next two weeks but I think I could post some psuedo code, below I post a written pseudo method that should be easy to follow. My current bad approach involves building a huge regular grid (code was posted into a wip branch some time ago, I think the branch is still in my fork which is public) and then slicing the resulting grid object using pyvista, but this approach is actually very inefficient as you end up throwing away a lot of the data that was computed by the model.

My (better) suggestion would be to use pyvista to create the sliced "view" that you see in the figure you posted, and then use the .points numpy array of the object to create a new custom grid object in gempy. You would then use the solution object to get the scalar field values and lithology (aka formation) values to assign pyvista attributes to the pyvista mesh you made to start with (https://docs.pyvista.org/getting-started/what-is-a-mesh.html#what-are-attributes).

I think with a little effort, a new grid object for gempy could be made that would allow for "any" pyvista mesh object to be used directly within gempy for evaluating models, once that becomes stable, all the other grid objects (cross sections, topography, regular grids, etc) could be re-done using pyvista methods to simplify the API.

Alternatively the same approach could be done using cross sections, with a little numpy it should be easy to define cross sections using the model extent. The resulting solution objects are just 2d so they may be relatively easy to convert to pyvista meshes.

from gemgis.

AlexanderJuestel avatar AlexanderJuestel commented on May 18, 2024

Will be moved to GemGIS and integrated as part of the postprocessing

from gemgis.

AlexanderJuestel avatar AlexanderJuestel commented on May 18, 2024

This will be worked on in the coming days. The only thing that is missing is a way to translate the lith_block volume in PyVista to its true real world coordinates

from gemgis.

AlexanderJuestel avatar AlexanderJuestel commented on May 18, 2024

An introduction on how to slice the lith block of a GemPy model was added in tutorial 49 of the documentation. It also works nicely when defining a profile on a map (right image).

image

from gemgis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.