Spaces:
Build error
Build error
import streamlit as st | |
from einops import repeat | |
import numpy as np | |
import pandas as pd | |
import altair as alt | |
MAXDIP = 60. | |
XMAX = 30 | |
YMAX = XMAX*np.tan(np.deg2rad(MAXDIP)) | |
def fig_1(dip=26.6): | |
''' | |
AVO: Amplitude Versus Offset | |
AVA: Amplitude Versus Angle | |
compute AVA at the WB for a range of values, | |
then plot using altair | |
''' | |
X = np.array([0,XMAX]) | |
dipping_reflector = np.array([0,np.abs(X[0]-X[1])*np.tan(np.deg2rad(dip))]) | |
df = pd.DataFrame({"x":X, | |
"z":dipping_reflector | |
} | |
) | |
lines = alt.Chart(df).mark_line().encode( | |
alt.X(field="x", type="quantitative", axis = alt.Axis(orient="top"), | |
scale=alt.Scale(domain=[0,XMAX])), | |
alt.Y(field="z", type="quantitative", scale=alt.Scale(domain=[0,YMAX], | |
reverse=True)) | |
).properties( | |
width=YMAX*10, | |
height=XMAX*10 | |
) | |
return lines | |
refector_dip = st.slider("Set reflector dip in degrees", min_value=0.1, max_value=MAXDIP, value=26.6) | |
# st.write("Poisson's ratio is:", p) | |
st.altair_chart(fig_1(refector_dip)) | |