initial upload
This commit is contained in:
10
cookbook/custom_ratio/custom_ratio.bat
Executable file
10
cookbook/custom_ratio/custom_ratio.bat
Executable file
@@ -0,0 +1,10 @@
|
||||
:: Calculate effect of the model at a low height using difference distance-size
|
||||
:: ratios for the recursive division of tesseroids.
|
||||
:: WARNING: This is only an example. You should not use the -t option in
|
||||
:: practice
|
||||
|
||||
tessgrd -r-3/3/-3/3 -b50/50 -z4e03 | ^
|
||||
tessgzz model.txt -t0.0001 -lratio1.log | ^
|
||||
tessgzz model.txt -t0.5 -lratio2.log | ^
|
||||
tessgzz model.txt -t1 -lratio3.log | ^
|
||||
tessgzz model.txt -v -lratio-default.log > output.txt
|
11
cookbook/custom_ratio/custom_ratio.sh
Executable file
11
cookbook/custom_ratio/custom_ratio.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Calculate effect of the model at a low height using difference distance-size
|
||||
# ratios for the recursive division of tesseroids.
|
||||
# WARNING: This is only an example. You should not use the -t option in practice
|
||||
|
||||
tessgrd -r-3/3/-3/3 -b50/50 -z4e03 | \
|
||||
tessgzz model.txt -t0.0001 -lratio1.log | \
|
||||
tessgzz model.txt -t0.5 -lratio2.log | \
|
||||
tessgzz model.txt -t1 -lratio3.log | \
|
||||
tessgzz model.txt -v -lratio-default.log > output.txt
|
2
cookbook/custom_ratio/model.txt
Executable file
2
cookbook/custom_ratio/model.txt
Executable file
@@ -0,0 +1,2 @@
|
||||
# Test tesseroid model file
|
||||
-1.5 1.5 -1.5 1.5 0 -5000 200
|
18
cookbook/custom_ratio/plot.py
Executable file
18
cookbook/custom_ratio/plot.py
Executable file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
Plot the columns of the output files
|
||||
"""
|
||||
import sys
|
||||
from matplotlib import pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
data = np.loadtxt(sys.argv[1], unpack=True)
|
||||
shape = (int(sys.argv[2]), int(sys.argv[3]))
|
||||
lon = np.reshape(data[0], shape)
|
||||
lat = np.reshape(data[1], shape)
|
||||
for i, value in enumerate(data[3:]):
|
||||
value = np.reshape(value, shape)
|
||||
plt.figure(figsize=(4, 3))
|
||||
plt.title("Column %d" % (i + 4))
|
||||
plt.contourf(lon, lat, value, 50)
|
||||
plt.colorbar()
|
||||
plt.savefig('column%d.png' % (i + 4))
|
Reference in New Issue
Block a user