forked from fatiando/fatiando
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
109 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Meshing: Make and plot a tesseroid mesh | ||
""" | ||
from fatiando import mesher | ||
from fatiando.vis import myv | ||
|
||
mesh = mesher.TesseroidMesh((-60, 60, -30, 30, 100000, -500000), (10, 10, 10)) | ||
|
||
myv.figure(zdown=False) | ||
myv.tesseroids(mesh) | ||
myv.earth(opacity=0.3) | ||
myv.continents() | ||
myv.meridians(range(-180, 180, 30)) | ||
myv.parallels(range(-90, 90, 30)) | ||
myv.show() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Meshing: Make and plot a tesseroid mesh with topography | ||
""" | ||
|
||
from fatiando import logger, gridder, utils, mesher | ||
from fatiando.vis import myv | ||
|
||
log = logger.get() | ||
log.info(logger.header()) | ||
log.info(__doc__) | ||
|
||
w, e = -2, 2 | ||
s, n = -2, 2 | ||
bounds = (w, e, s, n, 500000, 0) | ||
|
||
log.info("Generating synthetic topography") | ||
x, y = gridder.regular((w, e, s, n), (50, 50)) | ||
height = (250000 + | ||
-100000*utils.gaussian2d(x, y, 1, 5, x0=-1, y0=-1, angle=-60) + | ||
250000*utils.gaussian2d(x, y, 1, 1, x0=0.8, y0=1.7)) | ||
|
||
mesh = mesher.TesseroidMesh(bounds, (20, 50, 50)) | ||
mesh.carvetopo(x, y, height) | ||
|
||
scene = myv.figure(zdown=False) | ||
myv.tesseroids(mesh) | ||
myv.earth(opacity=0.3) | ||
myv.continents() | ||
scene.scene.camera.position = [21592740.078245595, 22628783.944262519, -28903782.916664094] | ||
scene.scene.camera.focal_point = [5405474.2152075395, -1711034.715136874, 2155879.3486608281] | ||
scene.scene.camera.view_angle = 1.6492674416639987 | ||
scene.scene.camera.view_up = [0.91713422625547714, -0.1284658947859818, 0.37730799740742887] | ||
scene.scene.camera.clipping_range = [20169510.286021926, 69721043.718536735] | ||
scene.scene.camera.compute_view_plane_normal() | ||
scene.scene.render() | ||
myv.show() |
This file contains 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