Beispiel #1
0
def update_figure(picks, curve, active_well):
    """redraw the plot when the data in tops-storage is updated"""
    w = p.get_well(active_well)  ##selects the correct welly.Well object
    picks_df = pd.read_json(picks)
    picks_selected = picks_df[picks_df['UWI'] == active_well.replace(' ', '-')]

    # regenerate figure with the new horizontal line
    fig = helper.make_log_plot(w=w, ymin=ymin)
    fig.update_layout(uirevision=active_well)
    helper.update_picks_on_plot(fig, picks_selected)

    return fig
def update_figure(surface_picks, curve, active_well):
    """redraw the plot when the data in tops-storage is updated"""
    surface_picks = pd.read_json(surface_picks)
    surface_picks = surface_picks[surface_picks['UWI'] == active_well]

    w = p.get_well(active_well)  ##selects the correct welly.Well object
    df = w.df()  ##reloads the correct dataframe for the display

    # regenerate figure with the new horizontal line
    fig = helper.make_log_plot(df)
    helper.update_picks_on_plot(fig, surface_picks)

    return fig
def update_figure(picks, curve, active_well):
    """redraw the plot when the data in tops-storage is updated"""
    w = p.get_well(active_well)  ##selects the correct welly.Well object
    picks_df = pd.read_json(picks)
    for i, row in picks_df.iterrows():
        print(row.UWI, row.PICK, row.MD)
    print('***Active Well', active_well)
    picks_selected = picks_df[picks_df['UWI'] == active_well.replace(' ', '-')]
    print('***\n***\n***', picks_selected)

    # regenerate figure with the new horizontal line
    fig = helper.make_log_plot(df)
    helper.update_picks_on_plot(fig, picks_selected)

    return fig
well_uwi = [w.uwi for w in p]
well_uwi = st.sidebar.selectbox("Well Names", well_uwi)

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_dropdown_options = [{
    'label': k,
    'value': k
} for k in sorted(curve_list)]  ##list of well log curves to the dropdown

curve = st.sidebar.selectbox(
    "Well Names", [item['value'] for item in curve_dropdown_options])

# draw the initial plot
fig_well_1 = helper.make_log_plot(df)

surface_picks_df = get_tops_df(p)

tops_storage = surface_picks_df.to_json()
wells_tops = pd.read_json(tops_storage)
well_tops = wells_tops[wells_tops.UWI == well_uwi]
csv_txt = df_to_csvtxt(well_tops)
p.get_well(well_uwi).data['tops'] = Striplog.from_csv(text=csv_txt)

fig = section_plot(p)

col1, col2 = st.beta_columns((1, 2))

fig_well_1 = update_figure(tops_storage, curve, well_uwi)
Beispiel #5
0
"""we need to have a stratigraphic column at some point"""
tops_dropdown_options = [{
    'label': k,
    'value': k
} for k in list(surface_picks_df['PICK'].unique())
                         ]  ##list of tops to the dropdown
##well log curve dropdown options
curve_dropdown_options = [{
    'label': k,
    'value': k
} for k in sorted(curve_list)]  ##list of well log curves to the dropdown

# draw the initial plot
#plotting only GR and RD in a subplot
ymin, ymax = 3000, 5500  # make dynamic later
fig_well_1 = helper.make_log_plot(w=well, ymin=ymin)

app.title = "SwellCorr"

controls = dbc.Card(children=[
    dbc.FormGroup([
        dbc.Label("Select Well"),
        dcc.Dropdown(
            id='well-selector',
            options=well_dropdown_options,
            value=p[0].uwi,
        ),
    ]),
    dbc.FormGroup([
        dbc.Label("Select a Pick to Edit"),
        dcc.Dropdown(id='top-selector',