initial upload
This commit is contained in:
25
cookbook/tess2prism_flatten/plot.py
Executable file
25
cookbook/tess2prism_flatten/plot.py
Executable file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
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)*0.001
|
||||
lat = pylab.reshape(data[1], shape)*0.001
|
||||
xmin, xmax = lon.min(), lon.max()
|
||||
ymin, ymax = lat.min(), lat.max()
|
||||
for i, value in enumerate(data[3:]):
|
||||
value = pylab.reshape(value, shape)
|
||||
pylab.figure(figsize=(4, 3))
|
||||
pylab.title("Column %d" % (i + 4))
|
||||
pylab.axis('scaled')
|
||||
pylab.pcolor(lon, lat, value)
|
||||
pylab.colorbar()
|
||||
pylab.contour(lon, lat, value, 12, color='k')
|
||||
#pylab.xlabel("Longitude")
|
||||
#pylab.ylabel("Latitude")
|
||||
pylab.xlim(xmin, xmax)
|
||||
pylab.ylim(ymin, ymax)
|
||||
pylab.savefig('column%d.png' % (i + 4))
|
9
cookbook/tess2prism_flatten/sample-prism-model.txt
Executable file
9
cookbook/tess2prism_flatten/sample-prism-model.txt
Executable file
@@ -0,0 +1,9 @@
|
||||
# Prisms converted from tesseroid model with tess2prism 1.1dev
|
||||
# local time: Tue May 8 14:55:02 2012
|
||||
# tesseroids file: stdin
|
||||
# conversion type: flatten
|
||||
# format: x1 x2 y1 y2 z1 z2 density
|
||||
# Test tesseroid model file
|
||||
1111100 1666650 1111100 1666650 0 30000 487.534658568521
|
||||
-1111100 1111100 -1666650 -1111100 0 50000 198.175508383774
|
||||
-1777760 -1111100 -1666650 555550 0 30000 -291.9029748328
|
4
cookbook/tess2prism_flatten/tess-model.txt
Executable file
4
cookbook/tess2prism_flatten/tess-model.txt
Executable file
@@ -0,0 +1,4 @@
|
||||
# Test tesseroid model file
|
||||
10 15 10 15 0 -30000 500
|
||||
-15 -10 -10 10 0 -50000 200
|
||||
-15 5 -16 -10 0 -30000 -300
|
21
cookbook/tess2prism_flatten/tess2prism_flatten.bat
Executable file
21
cookbook/tess2prism_flatten/tess2prism_flatten.bat
Executable file
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
:: Generate a prism model from a tesseroid model by
|
||||
:: flattening the tesseroids (1 degree = 111.11 km).
|
||||
:: This way the converted prisms can be used
|
||||
:: with the prism* programs in Cartesian coordinates.
|
||||
|
||||
tess2prism --flatten < tess-model.txt > prism-model.txt
|
||||
|
||||
:: Generate a regular grid in Cartesian coordinates,
|
||||
:: pipe the grid to the computation programs,
|
||||
:: and dump the result on output.txt
|
||||
|
||||
tessgrd -r-3e06/3e06/-3e06/3e06 -b50/50 -z250e03 | ^
|
||||
prismpot prism-model.txt | ^
|
||||
prismgx prism-model.txt | ^
|
||||
prismgy prism-model.txt | ^
|
||||
prismgz prism-model.txt | ^
|
||||
prismgxx prism-model.txt | prismgxy prism-model.txt | ^
|
||||
prismgxz prism-model.txt | prismgyy prism-model.txt | ^
|
||||
prismgyz prism-model.txt | prismgzz prism-model.txt > output.txt
|
BIN
cookbook/tess2prism_flatten/tess2prism_flatten.png
Executable file
BIN
cookbook/tess2prism_flatten/tess2prism_flatten.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 575 KiB |
21
cookbook/tess2prism_flatten/tess2prism_flatten.sh
Executable file
21
cookbook/tess2prism_flatten/tess2prism_flatten.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Generate a prism model from a tesseroid model by
|
||||
# flattening the tesseroids (1 degree = 111.11 km).
|
||||
# This way the converted prisms can be used
|
||||
# with the prism* programs in Cartesian coordinates.
|
||||
|
||||
tess2prism --flatten < tess-model.txt > prism-model.txt
|
||||
|
||||
# Generate a regular grid in Cartesian coordinates,
|
||||
# pipe the grid to the computation programs,
|
||||
# and dump the result on output.txt
|
||||
|
||||
tessgrd -r-3e06/3e06/-3e06/3e06 -b50/50 -z250e03 | \
|
||||
prismpot prism-model.txt | \
|
||||
prismgx prism-model.txt | \
|
||||
prismgy prism-model.txt | \
|
||||
prismgz prism-model.txt | \
|
||||
prismgxx prism-model.txt | prismgxy prism-model.txt | \
|
||||
prismgxz prism-model.txt | prismgyy prism-model.txt | \
|
||||
prismgyz prism-model.txt | prismgzz prism-model.txt > output.txt
|
Reference in New Issue
Block a user