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
# | |
# First, Convert the ground track to imagery coordinate system | |
# | |
from pyproj import Transformer | |
transformer = Transformer.from_crs("EPSG:4326", "EPSG:32617") | |
# | |
# Make a plot for the imagery | |
# |
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 subprocess | |
import s3fs | |
import h5py | |
import numpy as np | |
# Get Credentials | |
# See https://nsidc.org/support/how/how-do-i-programmatically-request-data-services#mac | |
inquiry = subprocess.run(['curl', "-b", "/home/ec2-user/.urs_cookies", \ | |
"-c", "/home/ec2-user/.urs_cookies", \ |
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
# First, check to see if you have a .ssh directory. | |
ls ~/.ssh | |
# If this doesn't return an error: continue to create a new SSH key. | |
# If this does return an error, make a .ssh directory: | |
mkdir ~/.ssh | |
# Create a new SSH key | |
ssh-keygen -t ed25519 -C "your_email@example.com" | |
# Default file location and name are fine. I prefer to not use a passcode, but that's up to you. | |
# To do both of those things, hit enter three times! |
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 pickle | |
import pandas as pd | |
import numpy as np | |
import os | |
from matplotlib import cm | |
import matplotlib.pyplot as plt | |
shelf_name = 'ronne' | |
datapath = '/data/fast1/arc/' |
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
dx_apparent = 14 # Known source-receiver distance | |
vtrue = 6e3 # Known p-wave speed | |
t0 = 380/48e3 # Measured travel time | |
dt = (5/48e3) # Measured travel time change | |
dx_true = t0 * vtrue # Actual propagation path >> source-receiver distance | |
print('True propagation path length: %f'%dx_true) | |
v1 = dx_true/t0 | |
v2 = dx_true/(t0-dt) |
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
''' | |
Code to calculate the dispersion relation of Flexural Gravity Waves | |
''' | |
import numpy as np | |
import matplotlib.pyplot as plt | |
g=9.81 # Gravity, m/s**2 | |
hw=100 # Water depth, m | |
hi = 300 # Ice thickness, m | |
rhow=1000 # Water density, kg/m**3 |
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 matplotlib.pyplot as plt | |
from firedrake import * | |
length = 1 | |
width = 0.2 | |
mesh = RectangleMesh(40, 20, length, width) | |
V = VectorFunctionSpace(mesh, "Lagrange", 1) | |
bc = DirichletBC(V, Constant([0, 0]), 1) | |
rho = Constant(0.01) |
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 | |
# Analytical solutions found in Zehnder | |
a = 10 | |
x1 = np.linspace(0,2*a,401) | |
x2 = np.linspace(0,1.5*a,201) | |
X1,X2 = np.meshgrid(x1,x2) | |
Z = X1 + 1j*X2 |
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 | |
cs=1500 | |
g=9.8 | |
h=100 | |
kappa = np.linspace(-0.08,0.08,100) | |
fig,ax=plt.subplots(1,4,figsize=(15,4)) | |
plt.subplot(141) |
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
# Motivated by this example: | |
# https://jorgensd.github.io/dolfinx-tutorial/chapter1/fundamentals.html | |
# ... but hopefully even simpler! | |
from mpi4py import MPI | |
from dolfinx import mesh | |
from dolfinx.fem import FunctionSpace | |
from dolfinx import fem | |
import numpy as np | |
import ufl |
OlderNewer