initial upload
This commit is contained in:
BIN
cookbook/tesslayers/layers.png
Executable file
BIN
cookbook/tesslayers/layers.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
1683
cookbook/tesslayers/layers.txt
Executable file
1683
cookbook/tesslayers/layers.txt
Executable file
File diff suppressed because it is too large
Load Diff
34
cookbook/tesslayers/makelayers.py
Executable file
34
cookbook/tesslayers/makelayers.py
Executable file
@@ -0,0 +1,34 @@
|
||||
import numpy as np
|
||||
import fatiando as ft
|
||||
|
||||
shape = (41, 41)
|
||||
x, y = ft.grd.regular((-10, 10, 30, 50), shape)
|
||||
height = 800 - 1000*ft.utils.gaussian2d(x, y, 3, 1, x0=0, y0=37)
|
||||
rel = -7000*ft.utils.gaussian2d(x, y, 3, 5, x0=0, y0=40)
|
||||
thick = height - rel
|
||||
dens = 1900*np.ones_like(thick)
|
||||
data = np.transpose([x, y, height, thick, dens])
|
||||
with open('layers.txt', 'w') as f:
|
||||
f.write("# Synthetic layer model of sediments and topography\n")
|
||||
f.write("# Columns are:\n")
|
||||
f.write("# lon lat height thickness density\n")
|
||||
np.savetxt(f, data, fmt='%g')
|
||||
ft.vis.figure(figsize=(4, 3))
|
||||
ft.vis.title('Depth of sediments [m]')
|
||||
ft.vis.axis('scaled')
|
||||
ft.vis.pcolor(x, y, rel, shape)
|
||||
ft.vis.colorbar()
|
||||
ft.vis.savefig('depth.png')
|
||||
ft.vis.figure(figsize=(4, 3))
|
||||
ft.vis.title('Topography [m]')
|
||||
ft.vis.axis('scaled')
|
||||
ft.vis.pcolor(x, y, height, shape)
|
||||
ft.vis.colorbar()
|
||||
ft.vis.savefig('topography.png')
|
||||
ft.vis.figure(figsize=(4, 3))
|
||||
ft.vis.title('Thickness of sediment layer [m]')
|
||||
ft.vis.axis('scaled')
|
||||
ft.vis.pcolor(x, y, thick, shape)
|
||||
ft.vis.colorbar()
|
||||
ft.vis.savefig('thickness.png')
|
||||
ft.vis.show()
|
20
cookbook/tesslayers/plot.py
Executable file
20
cookbook/tesslayers/plot.py
Executable file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Plot the columns of the output files
|
||||
"""
|
||||
import sys
|
||||
import pylab
|
||||
|
||||
data = pylab.loadtxt(sys.argv[1], unpack=True)
|
||||
shape = (int(sys.argv[2]), int(sys.argv[3]))
|
||||
lon = pylab.reshape(data[0], shape)
|
||||
lat = pylab.reshape(data[1], shape)
|
||||
for i, value in enumerate(data[3:]):
|
||||
value = pylab.reshape(value, shape)
|
||||
pylab.figure(figsize=(4, 3))
|
||||
pylab.axis('scaled')
|
||||
pylab.title("Column %d" % (i + 4))
|
||||
pylab.pcolor(lon, lat, value)
|
||||
pylab.colorbar()
|
||||
pylab.xlim(lon.min(), lon.max())
|
||||
pylab.ylim(lat.min(), lat.max())
|
||||
pylab.savefig('column%d.png' % (i + 4))
|
1684
cookbook/tesslayers/sample-tessmodel.txt
Executable file
1684
cookbook/tesslayers/sample-tessmodel.txt
Executable file
File diff suppressed because it is too large
Load Diff
13
cookbook/tesslayers/tesslayers.bat
Executable file
13
cookbook/tesslayers/tesslayers.bat
Executable file
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
:: Convert the layer grids in layers.txt to tesseroids.
|
||||
:: The grid spacing passed to -s is used as the size of the tesseroids,
|
||||
:: so be careful!
|
||||
tesslayers.exe -s0.5/0.5 -v < layers.txt > tessmodel.txt
|
||||
|
||||
:: Now calculate the gz and tensor effect of this model at 100km height
|
||||
tessgrd -r-8/8/32/48 -b50/50 -z100000 | ^
|
||||
tessgz tessmodel.txt | ^
|
||||
tessgxx tessmodel.txt | tessgxy tessmodel.txt | ^
|
||||
tessgxz tessmodel.txt | tessgyy tessmodel.txt | ^
|
||||
tessgyz tessmodel.txt | tessgzz tessmodel.txt -v > output.txt
|
BIN
cookbook/tesslayers/tesslayers.png
Executable file
BIN
cookbook/tesslayers/tesslayers.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 154 KiB |
13
cookbook/tesslayers/tesslayers.sh
Executable file
13
cookbook/tesslayers/tesslayers.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Convert the layer grids in layers.txt to tesseroids.
|
||||
# The grid spacing passed to -s is used as the size of the tesseroids,
|
||||
# so be careful!
|
||||
tesslayers -s0.5/0.5 -v < layers.txt > tessmodel.txt
|
||||
|
||||
# Now calculate the gz and tensor effect of this model at 100km height
|
||||
tessgrd -r-8/8/32/48 -b50/50 -z100000 | \
|
||||
tessgz tessmodel.txt | \
|
||||
tessgxx tessmodel.txt | tessgxy tessmodel.txt | \
|
||||
tessgxz tessmodel.txt | tessgyy tessmodel.txt | \
|
||||
tessgyz tessmodel.txt | tessgzz tessmodel.txt -v > output.txt
|
Reference in New Issue
Block a user