initial upload

This commit is contained in:
2021-05-05 10:58:03 +08:00
parent d6ffc7f33c
commit f1cf25db22
114 changed files with 83953 additions and 0 deletions

3
cookbook/simple_tess/model.txt Executable file
View File

@@ -0,0 +1,3 @@
# Test tesseroid model file
10 20 10 20 0 -50000 200
-20 -10 -20 -10 0 -30000 -500

29
cookbook/simple_tess/plot.py Executable file
View File

@@ -0,0 +1,29 @@
"""
Plot the columns of the output files
"""
import sys
from matplotlib import pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
# Set up a projection
bm = Basemap(projection='ortho', lon_0=0, lat_0=0,
resolution='l', area_thresh=10000)
# Load the data and make them into matrices
data = np.loadtxt(sys.argv[1], unpack=True)
shape = (int(sys.argv[2]), int(sys.argv[3]))
lon = data[0].reshape(shape)
lat = data[1].reshape(shape)
glon, glat = bm(lon, lat)
plt.figure(figsize=(14, 12))
for i, value in enumerate(data[3:]):
plt.subplot(3, 4, i + 1)
plt.title("Column %d" % (i + 4))
bm.drawcoastlines()
bm.drawmapboundary()
bm.contourf(glon, glat, value.reshape(shape), 15, cmap=plt.cm.RdBu_r)
plt.colorbar(orientation="horizontal", pad=0, aspect=30)
plt.tight_layout()
plt.savefig('output.png')

View File

@@ -0,0 +1,12 @@
:: Generate a regular grid, pipe it to all the computation programs,
:: and write the result to output.txt
tessgrd -r-45/45/-45/45 -b101/101 -z260e03 | ^
tesspot model.txt | ^
tessgx model.txt | tessgy model.txt | tessgz model.txt | ^
tessgxx model.txt | tessgxy model.txt | ^
tessgxz model.txt | tessgyy model.txt | ^
tessgyz model.txt | tessgzz model.txt -v -llog.txt > output.txt
:: Make a plot with the columns of output.txt
python plot.py output.txt 101 101

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Generate a regular grid, pipe it to all the computation programs,
# and write the result to output.txt
tessgrd -r-45/45/-45/45 -b101/101 -z260e03 | \
tesspot model.txt | \
tessgx model.txt | tessgy model.txt | tessgz model.txt | \
tessgxx model.txt | tessgxy model.txt | \
tessgxz model.txt | tessgyy model.txt | \
tessgyz model.txt | tessgzz model.txt -v -llog.txt > output.txt
# Make a plot with the columns of output.txt
python plot.py output.txt 101 101