Add Shapely Geometry Properties to Fault Objects#8
Merged
lispandfound merged 2 commits intomainfrom Sep 30, 2024
Merged
Conversation
AndrewRidden-Harper
approved these changes
Sep 23, 2024
joelridden
reviewed
Sep 23, 2024
| """float: The dip angle of the fault.""" | ||
| return np.degrees(np.arcsin(np.abs(self.bottom_m - self.top_m) / self.width_m)) | ||
|
|
||
| # TODO: change this to take width and dip rather than projected width. |
Contributor
There was a problem hiding this comment.
Is this still important?
Contributor
Author
There was a problem hiding this comment.
I decided to make it a GitHub Issue instead because it's easier to track that way.
Contributor
Author
There was a problem hiding this comment.
But yeah it should do that.
claudio525
approved these changes
Sep 24, 2024
joelridden
approved these changes
Sep 25, 2024
sungeunbae
approved these changes
Sep 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This PR Add
This PR adds the
geometryproperty to thePoint,Plane, andFaultclasses in thesourcesmodule. These properties return the shapely Geometry of the (projected) corners, sopoint.geometryreturns ashapely.Point, andplane.geometry,fault.geometryboth returnshapely.Polygon.Why Do We Need This Code
Shapely geometries have a couple of interesting use cases in the workflow and velocity modelling code:
velocity_modelling.bounding_box.minimum_area_bounding_box. But, it turns out, shapely can already do this for geometries using shapely.minimum_rotated_rectangle. So we can remove code from the bounding box class.workflow.scripts.generate_velocity_model_parametersstage, we have two pieces of code that I would like to swap out with shapely code: