Skip to content

Commit

Permalink
Fixing issue with df
Browse files Browse the repository at this point in the history
  • Loading branch information
andymcdgeo committed Dec 31, 2020
1 parent 6be2c5f commit 84ff8fc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
reference/
__pycache__/
__pycache__/
.vscode/launch.json
.vscode/settings.json
40 changes: 17 additions & 23 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@ def load_data(uploadedfile):
las_file = lasio.read(string)
return las_file

# Sidebar Options
las_file=None
st.sidebar.write('# LAS Data Explorer')
st.sidebar.write('To begin using the app, load your LAS file using the file upload option below.')

uploadedfile = st.sidebar.file_uploader(' ', type=['las'])
las_file = load_data(uploadedfile)

if las_file:
st.sidebar.success('File Uploaded Successfully')
st.sidebar.write(f'<b>Well Name</b>: {las_file.well.WELL.value}',unsafe_allow_html=True)

# Create the dataframe
well_data = las_file.df()

#Assign the dataframe index to a curve
well_data['DEPTH'] = well_data.index

def home():
pweb = """<a href='http://andymcdonald.scot' target="_blank">http://andymcdonald.scot</a>"""
sm_li = """<a href='https://www.linkedin.com/in/andymcdonaldgeo/' target="_blank"><img src='https://cdn.exclaimer.com/Handbook%20Images/linkedin-icon_32x32.png'></a>"""
Expand All @@ -58,16 +40,13 @@ def home():
st.write('**Data Visualisation:** Visualisation tools to view las file data on a log plot, crossplot and histogram.')
st.write('## Get in Touch')
st.write(f'\nIf you want to get in touch, you can find me on Social Media at the links below or visit my website at: {pweb}.', unsafe_allow_html=True)


st.write(f'{sm_li} {sm_med} {sm_tw}', unsafe_allow_html=True)

st.write('## Source Code, Bugs, Feature Requests')
githublink = """<a href='https://github.com/andymcdgeo/las_explorer' target="_blank">https://github.com/andymcdgeo/las_explorer</a>"""
st.write(f'\n\nCheck out the GitHub Repo at: {githublink}. If you find any bugs or have suggestions, please open a new issue and I will look into it.', unsafe_allow_html=True)



def header():
st.title('LAS File Header Info')
if not las_file:
Expand Down Expand Up @@ -133,7 +112,6 @@ def plot():
histogram.layout.template='seaborn'
col2_h.plotly_chart(histogram, use_container_width=True)


with st.beta_expander('Crossplot'):
col1, col2 = st.beta_columns(2)
col1.write('Options')
Expand Down Expand Up @@ -166,7 +144,23 @@ def missing_data():
missing = px.area(well_data, x='DEPTH', y='DT')
st.plotly_chart(missing)

# Sidebar Options
las_file=None
st.sidebar.write('# LAS Data Explorer')
st.sidebar.write('To begin using the app, load your LAS file using the file upload option below.')

uploadedfile = st.sidebar.file_uploader(' ', type=['las'])
las_file = load_data(uploadedfile)

if las_file:
st.sidebar.success('File Uploaded Successfully')
st.sidebar.write(f'<b>Well Name</b>: {las_file.well.WELL.value}',unsafe_allow_html=True)

# Create the dataframe
well_data = las_file.df()

#Assign the dataframe index to a curve
well_data['DEPTH'] = well_data.index

#Use the Multi App to create menu
app = MultiApp()
Expand All @@ -177,4 +171,4 @@ def missing_data():
app.add_app('Data Visualisation', plot)
# app.add_app('Data Coverage', missing_data)

app.run()
app.run()

0 comments on commit 84ff8fc

Please sign in to comment.