-
Notifications
You must be signed in to change notification settings - Fork 280
Add How to Guide page on moving mesh to survey area #1699
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
Conversation
Add a new page to the How to Guide that explains how to move a mesh to a given survey area. This is handy when working with real-world data, whose coordinates are going to be given in projected plain coordinates.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1699 +/- ##
==========================================
- Coverage 86.22% 86.22% -0.01%
==========================================
Files 433 433
Lines 56199 56199
Branches 5219 5219
==========================================
- Hits 48459 48457 -2
- Misses 6341 6342 +1
- Partials 1399 1400 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
As a corollary, how about moving survey to mesh? |
|
Do you mean moving sources and receivers to the default location of the mesh (around 0, 0, 0)? |
|
Yeah, or on a centered mesh with origin an ‘CCN’ |
|
That could be a good addition. I think the goal of this page is to address a common question that users have: "how to locate the mesh in the coordinates of the survey", from a more applied point of view. I'd recommend practitioners to move the mesh rather than the survey, so at least for now I think I'd prefer to keep only this guide, just to avoid any confusion of what is the preferred method. My point is having the mesh in the survey coordinates ultimately simplify workflows: mesh slices and plots will be already in survey coordinates, exported meshes (that sometimes are opened with other software like Geoscience ANALYST) are already in those coordinates. |
|
I am moving the mesh to the location of the survey by doing the following: Width of magnetic surveyx_width = np.max(x_ds) - np.min(x_ds) Midpoint of magnetic surveyx_midpoint = (np.max(x_ds) + np.min(x_ds)) / 2 Core cell sizecell_size_x, cell_size_y, cell_size_z = 50, 50, 50 Domain width in each directionspad_thk = 1 * width_max Calculate the number of core cells required to fill the domain in each directionn_cells_x = int(2np.round(np.log(domain_width / cell_size_x) / np.log(2))) hx = [(cell_size_x, n_cells_x)] Calculate domain effective widthdomain_eff_width_x = utils.unpack_widths(hx).sum() Define the mesh origin = mesh bottom-left-frontmost cornermesh_origin_x = int(np.round(x_midpoint - domain_eff_width_x / 2)) Create the base meshmesh = TreeMesh(h=[hx, hy, hz], origin=mesh_origin, diagonal_balance=True) Refine surface topographymesh.refine_surface(xyz=SRTM_DEM, level=-1, padding_cells_by_level=None, diagonal_balance=True, finalize=False) Refine around receiver locationsmesh.refine_points(points=xyz_TEM_ds, level=-1, padding_cells_by_level=[1], diagonal_balance=True, finalize=False) Refine region of interestx_core_min = np.min(x_ds) - 0 * cell_size_x meshgrid_x_core, meshgrid_y_core, meshgrid_z_core = np.meshgrid([x_core_min, x_core_max], [y_core_min, y_core_max], [z_core_min, z_core_max]) mesh.refine_bounding_box(points=xyz_core_edge_points, level=-1, padding_cells_by_level=None, diagonal_balance=True, finalize=False) mesh.finalize() |
Summary
Add a new page to the How to Guide that explains how to move a mesh to a given survey area. This is handy when working with real-world data, whose coordinates are going to be given in projected plain coordinates.
PR Checklist
expect style.
to a Pull Request
@simpeg/simpeg-developerswhen ready for review.Reference issue
What does this implement/fix?
Additional information