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
import numpy as np | |
from scipy.integrate import odeint | |
import matplotlib.pyplot as plt | |
# Function that returns dz/dt = [dx/dt, dv/dt] | |
def model(z, t): | |
x = z[0] # "total displacement" -- quotes because this quantity doesn't | |
# really make physical sense. These should be strains, but there | |
# is no sense of strain in a 0-D model. | |
v = z[1] # velocity |
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
import numpy as np | |
from scipy.integrate import odeint | |
import matplotlib.pyplot as plt | |
# Function that returns dz/dt = [dx/dt, dv/dt] | |
def model(z, t): | |
x = z[0] | |
v = z[1] | |
xp = z[2] | |
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
import h5py | |
import numpy as np | |
from scipy.fft import fft2, ifft2, fftfreq, fftshift, ifftshift | |
datafile=h5py.File('/1-fnp/petasaur/p-wd15/rainier-10-14-2023-drive1/rainier/decimator_2023-08-23_19.28.00_UTC.h5') | |
data=np.array(datafile['/Acquisition/Raw[0]/RawData']) | |
datafile.close() | |
import matplotlib.pyplot as plt | |
plt.imshow(data,aspect='auto',vmin=-1,vmax=1) |
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
import numpy as np | |
import tensorflow as tf | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import LSTM, Dense | |
from sklearn.model_selection import train_test_split | |
# Generate example data (you should replace this with your data) | |
# Here, we create three input time series and one target time series. | |
# You should load your own data accordingly. | |
n_samples = 1000 |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
import datetime | |
import geopy.distance | |
T0 = datetime.datetime(2023,9,16,12,31,0).timestamp() # test origin time | |
v = 1 # surface wave speed | |
def G(lon,lat,m,vv): | |
#m = (x0,y0,t0) is the source parameter vector |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.fft import fftshift, fft2, fftfreq | |
g = 9.8 | |
H=100 | |
dt = 1 | |
plt.subplots(2,2,figsize=(16,9)) | |
dx_list = (10,20,40) |
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
import numpy as np | |
pp = np.logspace(-5,-1,100) | |
zz = np.linspace(0,100,101) | |
q,z=np.meshgrid(pp,zz) | |
g = 9.8 | |
H=1000 | |
p = np.sqrt(g*q*np.tanh(g*H)) |
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
import numpy as np | |
n = 10 | |
dt = 1 | |
alpha = 1e-6 * 3.15e7 | |
dx = 10 | |
c = dt * alpha / (dx)**2 | |
z = np.arange(0,n*dx,dx) | |
Q = 0 # change this | |
k = 1 # change this too |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
Lmax = 10.5e3 | |
mustar = 3e9 | |
tmax = 300 | |
D_list = np.logspace(-3,1,100) | |
H_list = np.logspace(-1,np.log10(400),50) |
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
import numpy as np | |
n_total = 20 | |
mu = 100 | |
sigma = 10 | |
thickness_true = np.random.default_rng().normal(mu, sigma, n_total) | |
thickness_estimates = np.random.default_rng().normal(mu, sigma, n_total) | |
# thickness_uncertainty_estimates = np.random.default_rng().normal(2*sigma, 3*sigma, n_total) | |
thickness_uncertainty_estimates = np.abs(thickness_true - thickness_estimates) |
NewerOlder