Spaces:
Build error
Build error
File size: 1,235 Bytes
208bc83 6a1b8b1 208bc83 6a1b8b1 208bc83 6a1b8b1 208bc83 6a1b8b1 208bc83 6a1b8b1 208bc83 6a1b8b1 208bc83 6a1b8b1 208bc83 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
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))
|