def load_wells():
    base_dir = "./data/McMurray_data"

    # # load well data
    """Need to add a method for the user to point to the directory or add additional las files later"""
    fpath = Path(base_dir+"/las/*.LAS")
    return Project.from_las(str(fpath))
Exemple #2
0
def test_project():
    """
    Test basic stuff.
    """
    project = Project.from_las('tests/1.las')
    assert len(project) == 1

    w = Well.from_las('tests/2.las')
    project += w
    assert w in project
    assert len(project) == 2

    project += project

    assert project.uwis[0] == '1'

    s = "<table>"
    s += "<tr><th>Index</th><th>UWI</th><th>Data</th><th>Curves</th></tr>"
    s += "<tr><td>0</td><td><strong>1</strong></td>"
    assert s in project._repr_html_()

    # Check __getitem__.
    assert project[1] == w
    assert len(project[:2]) == 2
    l = [0, 1]
    assert len(project[l]) == 2

    assert len(project.get_mnemonics(['DT'])) == 4

    html = project.curve_table_html()
    assert '<table><tr><th>Idx</th><th>UWI</th><th>Data</th><th>Passing</th>' in html
    assert "<th>DPHI_SAN</th>" in html
    s = """<td style="background-color:#CCEECC; line-height:80%; padding:5px 4px 2px 4px;">DTS"""
    assert s in html
def test_project():
    """
    Test basic stuff.
    """
    project = Project.from_las('tests/1.las')
    assert len(project) == 1

    w = Well.from_las('tests/2.las')
    project += w
    assert w in project
    assert len(project) == 2

    project += project

    assert project.uwis[0] == 1

    s = "<table><tr><th>UWI</th><th>Data</th><th>Curves</th></tr><tr><td>1</td>"
    assert s in project._repr_html_()

    # Check __getitem__.
    assert project[1] == w
    assert len(project[:2]) == 2
    l = [0, 1]
    assert len(project[l]) == 2

    assert len(project.get_mnemonics(['DT'])) == 4

    html = project.curve_table_html()
    assert '<table><tr><th>Idx</th><th>UWI</th><th>Data</th><th>Quality</th>' in html
    assert "<th>DPHI_SAN</th>" in html
    s =  """<td style="background-color:#CCEECC; line-height:80%; padding:5px 4px 2px 4px;">DTS"""
    assert s in html
Exemple #4
0
def test_project():
    """
    Test basic stuff.
    """
    project = Project.from_las('tests/1.las')
    assert len(project) == 1

    w = Well.from_las('tests/2.las')
    project += w
    assert w in project
    assert len(project) == 2

    project += project

    assert project.uwis[0] == 1

    s = "<table><tr><th>UWI</th><th>Data</th><th>Curves</th></tr><tr><td>1</td>"
    assert s in project._repr_html_()

    # Check __getitem__.
    assert project[1] == w
    assert len(project[:2]) == 2
    l = [0, 1]
    assert len(project[l]) == 2

    assert len(project.get_mnemonics(['DT'])) == 4

    html = project.curve_table_html()
    assert "<table><tr><th>UWI</th><th>Data</th>" in html
    assert "<th>DPHI_SAN</th>" in html
    s = """<td style="background-color:#CCEECC; line-height:80%; padding:5px 4px 2px 4px;">DTS<div style="font-size:80%; float:right; padding:4px 0px 4px 6px; color:#CCCCCC;"></div><br /><span style="font-size:70%; color:#33AA33">us/ft</span></td>"""
    assert s in html
Exemple #5
0
def test_project():
    """
    Test basic stuff.
    """
    project = Project.from_las('tests/1.las')
    assert len(project) == 1

    w = Well.from_las('tests/2.las')
    project += w
    assert w in project
    assert len(project) == 2

    project += project

    assert project.uwis[0] == 1

    s = "<table><tr><th>UWI</th><th>Data</th><th>Curves</th></tr><tr><td>1</td>"
    assert s in project._repr_html_()

    # Check __getitem__.
    assert project[1] == w
    assert len(project[:2]) == 2
    l = [0, 1]
    assert len(project[l]) == 2

    assert len(project.get_mnemonics(['DT'])) == 4

    html = project.curve_table_html()
    assert "<table><tr><th>UWI</th><th>Data</th>" in html
    assert "<th>DPHI_SAN</th>" in html
    s =  """<td style="background-color:#CCEECC; line-height:80%; padding:5px 4px 2px 4px;">DTS<div style="font-size:80%; float:right; padding:4px 0px 4px 6px; color:#CCCCCC;"></div><br /><span style="font-size:70%; color:#33AA33">us/ft</span></td>"""
    assert s in html
def test_data_as_matrix():
    alias = {'Sonic': ['DT', 'foo']}
    project = Project.from_las('tests/*.las')
    X_train, y_train = project.data_as_matrix(X_keys=['DEPT', 'HCAL', 'Sonic'],
                                              y_key='CALI',
                                              alias=alias,
                                              window_length=1,
                                              remove_zeros=True,
                                              )
    assert X_train.shape[0] == y_train.size
Exemple #7
0
def test_data_as_matrix():
    alias = {'Sonic': ['DT', 'foo']}
    project = Project.from_las('tests/*.las')
    X_train, y_train = project.data_as_matrix(
        X_keys=['DEPT', 'HCAL', 'Sonic'],
        y_key='CALI',
        alias=alias,
        window_length=1,
        remove_zeros=True,
    )
    assert X_train.shape[0] == y_train.size
import streamlit as st
import json
import random
import pandas as pd

import plotly.graph_objects as go
from welly import Project
from pathlib import Path

import helper2

base_dir = "./data/McMurray_data"
fpath = Path(base_dir+"/las/*.LAS")
p = Project.from_las(str(fpath))


#get the first well. this need to be updated with the well list
df = p[0].df()

def app():
    st.title('Correlation Panel')
    st.write('well logs displayed below')



# first argument takes the titleof the selectionbox
# second argument takes options

    f = open('/home/user/github_repo/t21-hack-SwellCorr/log_dict.json',)

    log_inp = json.load(f)
Exemple #9
0
def test_data_as_matrix():
    alias = {'Sonic': ['DT', 'foo']}
    project = Project.from_las('tests/*.las')
import json
import numpy as np
import pandas as pd
from pathlib import Path
import numpy as np

import helper

app = Dash(__name__)
# Create server variable with Flask server object for use with gunicorn
server = app.server

# # load well data
"""Need to add a method for the user to point to the directory or add additional las files later"""
#w = Well.from_las(str(Path("data/las/PoseidonNorth1Decim.LAS"))) #original example
p = Project.from_las(str(Path("data/McMurray_data/las/*.LAS")))
well_uwi = [w.uwi for w in p
            ]  ##gets the well uwi data for use in the well-selector tool

df = p[0].df()  ##gets data from the first well in the Welly Project
curve_list = df.columns.tolist(
)  ##gets the column names for later use in the curve-selector tool
curve = curve_list[
    0]  ##gets the first curve name to be used as the first curve displayed in the plotly figure

## Load well top data
surface_picks_df = pd.read_table(Path('./data/McMurray_data/PICKS.TXT'),
                                 usecols=['UWI', 'PICK', 'MD'])

#well dropdown selector
well_dropdown_options = [{
Exemple #11
0
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
# Create server variable with Flask server object for use with gunicorn
server = app.server

# Get las files
path = 'data/Poseidon_data/las/'  # direct link to specific data
lasfiles = glob(path + '*.LAS')

# Get striplog files
path2 = 'data/Poseidon_data/tops/'  # direct link to specific data
stripfiles = glob(path2 + '*.csv')

legend = Legend.from_csv(filename='data/Poseidon_data/tops_legend.csv'
                         )  # direct link to specific data

p = Project.from_las(
    'data/Poseidon_data/las/*.LAS')  # direct link to specific data
well_uwi = [w.uwi for w in p
            ]  ##gets the well uwi data for use in the well-selector tool

# Add striplogs to Project
# Striplog must have the same name as LAS file.
# e.g. Torosa-1.LAS and Torosa-1.csv
for w in p:
    name = Path(w.fname).stem
    strip = Striplog.from_csv(
        f'data/Poseidon_data/tops/{name}.csv')  # direct link to specific data
    w.data['tops'] = strip

well = p[0]  ##gets data from the first well in the Welly Project
curve_list = get_curves(
    p)  ##gets the column names for later use in the curve-selector tool
Exemple #12
0
from welly import Project

from alaska import Alias, get_data_path

path = str(get_data_path("testcase1.las"))

# initialize aliaser
a = Alias()
# the parameters can also be customized as such:
# a = Alias(dictionary=True, keyword_extractor=True,
#                          model=True, prob_cutoff=.5)

# the parse function returns two dictionaries, one for parsed
# and another one for mnemonics not found using the aliaser
parsed, not_found = a.parse(path)

# print aliased mnemonics to screen
print("*" * 10, "Aliased dictionary", "*" * 10)
for i in parsed:
    print("{}: {}".format(i, parsed[i]))
print("Not parsed with Aliaser:", not_found)

# feed parsed dictionary into welly, and leave the not aliased
# ones alone
p = Project.from_las(path)
data = p.df(keys=list(parsed.keys()), alias=parsed)
print(data)

# print the heatmap of the aliased mnemonics to visualize results
a.heatmap()
for fname in lasfiles:
    print(' '*5, fname)
print('\n')


# Get striplog files
path2 = 'data/Poseidon_data/tops/'
print('\n STRIP PATH:', path2, '\n')
stripfiles = glob(path2 + '*.csv')
for fname in stripfiles:
    print(' '*5, fname)
print('\n')

tops_legend = Legend.from_csv(filename='data/Poseidon_data/tops_legend.csv')

p = Project.from_las('data/Poseidon_data/las/*.LAS')
well_uwi = [w.uwi for w in p] ##gets the well uwi data for use in the well-selector tool

# Add striplogs to Project
# Striplog must have the same name as LAS file.
# e.g. Torosa-1.LAS and Torosa-1.csv
for w in p:
    name = Path(w.fname).name.split('.')[0]
    new_path = f'data/Poseidon_data/tops/{name}.csv'
    print(name, new_path)
    strip = Striplog.from_csv(f'data/Poseidon_data/tops/{name}.csv')
    w.data['tops'] = strip


# Make the well correlation panel
def encode_xsection(p):
Exemple #14
0
import json
import numpy as np
import pandas as pd
from pathlib import Path

import helper


app = Dash(__name__)
# Create server variable with Flask server object for use with gunicorn
server = app.server

# # load well data
"""Need to add a method for the user to point to the directory or add additional las files later"""
#w = Well.from_las(str(Path("well_picks/data/las/PoseidonNorth1Decim.LAS"))) #original example
p = Project.from_las(str(Path("well_picks/data/las/*.LAS")))
well_uwi = [w.uwi for w in p] ##gets the well uwi data for use in the well-selector tool

df = p[0].df() ##gets data from the first well in the Welly Project
curve_list = df.columns.tolist() ##gets the column names for later use in the curve-selector tool
curve = curve_list[0] ##gets the first curve name to be used as the first curve displayed in the plotly figure

## Load well top data
"""sample pick data, this will eventually need to load data from file or other source into the current dict"""
surface_picks = {"Sea Bed": 520.4, "Montara Formation": 4620, "Plover Formation (Top Volcanics)": 4703.2, "Plover Formation (Top Reservoir)": 4798.4, "Nome Formation": 5079}



#well dropdown selector
well_dropdown_options = [{'label': k, 'value': k} for k in well_uwi] ##list of wells to the dropdown
#tops dropdown options
Exemple #15
0
from welly import Project

from alaska import Alias, get_data_path

PATH = str(get_data_path("722436A.las"))

# initialize aliaser
a = Alias()
# the parameters can also be customized as such:
# a = Alias(dictionary=True, keyword_extractor=True,
#                          model=True, prob_cutoff=.5)

# the parse function returns two dictionaries, one for parsed
# and another one for mnemonics not found using the aliaser
parsed, not_found = a.parse(PATH)

# print aliased mnemonics to screen
print("*" * 10, "Aliased dictionary", "*" * 10)
for i in parsed:
    print("{}: {}".format(i, parsed[i]))
print("Not parsed with Aliaser:", not_found)

# feed parsed dictionary into welly, and leave the not aliased
# ones alone
p = Project.from_las(PATH)
data = p.df(keys=list(parsed.keys()), alias=parsed)
print(data)

# print the heatmap of the aliased mnemonics to visualize results
a.heatmap()
from welly import Well, Project
from glob import glob

# # load well data
"""Need to add a method for the user to point to the directory or add additional las files later"""
#w = Well.from_las(str(Path("well_picks/data/las/PoseidonNorth1Decim.LAS"))) #original example

# Get las files
path = 'las/'
print('\n LAS PATH:', path, '\n')
lasfiles = glob(path + '*.LAS')
for fname in lasfiles:
    print(' ' * 5, fname)
print('\n')

# Get striplog files
path2 = 'tops/'
print('\n STRIP PATH:', path2, '\n')
stripfiles = glob(path2 + '*.csv')
for fname in stripfiles:
    print(' ' * 5, fname)
print('\n')

p = Project.from_las("las/*.LAS")
well_uwi = [w.uwi for w in p
            ]  ##gets the well uwi data for use in the well-selector tool

print(p)