Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove/ignore SMDA wells that has undefined entries in trajectory #682

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from typing import List, Optional
import logging

import pandas as pd

from webviz_pkg.core_utils.perf_timer import PerfTimer
from ..types import WellboreTrajectory
from ._get_request import get

LOGGER = logging.getLogger(__name__)


async def get_field_wellbore_trajectories(
access_token: str,
Expand All @@ -22,20 +25,29 @@ async def get_field_wellbore_trajectories(
params["unique_wellbore_identifiers"] = ", ".join(unique_wellbore_identifiers)
timer = PerfTimer()
result = await get(access_token=access_token, endpoint=endpoint, params=params)
print(f"TIME SMDA fetch wellbore trajectories took {timer.lap_s():.2f} seconds")
LOGGER.debug(f"TIME SMDA fetch wellbore trajectories took {timer.lap_s():.2f} seconds")
resultdf = pd.DataFrame.from_dict(result)
print(f"TIME SMDA wellbore trajectories to dataframe{timer.lap_s():.2f} seconds")
LOGGER.debug(f"TIME SMDA wellbore trajectories to dataframe{timer.lap_s():.2f} seconds")
wellbore_trajectories: List[WellboreTrajectory] = []
for wellbore, df in resultdf.groupby("unique_wellbore_identifier"):
tvd_arr = df["tvd_msl"]
md_arr = df["md"]
easting_arr = df["easting"]
northing_arr = df["northing"]

if any(arr.isna().any() for arr in [tvd_arr, md_arr, easting_arr, northing_arr]):
LOGGER.warning(f"Invalid wellbore trajectory for wellbore {wellbore}. Skipping.")
continue

wellbore_trajectories.append(
WellboreTrajectory(
wellbore_uuid=df["wellbore_uuid"].iloc[0],
unique_wellbore_identifier=wellbore,
tvd_msl_arr=df["tvd_msl"].tolist(),
md_arr=df["md"].tolist(),
easting_arr=df["easting"].tolist(),
northing_arr=df["northing"].tolist(),
tvd_msl_arr=tvd_arr,
md_arr=md_arr,
easting_arr=easting_arr,
northing_arr=northing_arr,
)
)
print(f"TIME SMDA wellbore trajectories to list and validate {timer.lap_s():.2f} seconds")
LOGGER.debug(f"TIME SMDA wellbore trajectories to list and validate {timer.lap_s():.2f} seconds")
return wellbore_trajectories
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from typing import List
import logging

import pandas as pd

from webviz_pkg.core_utils.perf_timer import PerfTimer
from ..types import WellboreTrajectory
from ._get_request import get

LOGGER = logging.getLogger(__name__)


async def get_wellbore_trajectories(access_token: str, wellbore_uuids: List[str]) -> List[WellboreTrajectory]:
endpoint = "wellbore-survey-samples"
Expand All @@ -17,20 +20,29 @@ async def get_wellbore_trajectories(access_token: str, wellbore_uuids: List[str]

timer = PerfTimer()
result = await get(access_token=access_token, endpoint=endpoint, params=params)
print(f"TIME SMDA fetch wellbore trajectories took {timer.lap_s():.2f} seconds")
LOGGER.debug(f"TIME SMDA fetch wellbore trajectories took {timer.lap_s():.2f} seconds")
resultdf = pd.DataFrame.from_dict(result)
print(f"TIME SMDA wellbore trajectories to dataframe{timer.lap_s():.2f} seconds")
LOGGER.debug(f"TIME SMDA wellbore trajectories to dataframe{timer.lap_s():.2f} seconds")
wellbore_trajectories: List[WellboreTrajectory] = []
for wellbore, df in resultdf.groupby("unique_wellbore_identifier"):
tvd_arr = df["tvd_msl"]
md_arr = df["md"]
easting_arr = df["easting"]
northing_arr = df["northing"]

if any(arr.isna().any() for arr in [tvd_arr, md_arr, easting_arr, northing_arr]):
LOGGER.warning(f"Invalid wellbore trajectory for wellbore {wellbore}. Skipping.")
continue

wellbore_trajectories.append(
WellboreTrajectory(
wellbore_uuid=df["wellbore_uuid"].iloc[0],
unique_wellbore_identifier=wellbore,
tvd_msl_arr=df["tvd_msl"].tolist(),
md_arr=df["md"].tolist(),
easting_arr=df["easting"].tolist(),
northing_arr=df["northing"].tolist(),
tvd_msl_arr=tvd_arr,
md_arr=md_arr,
easting_arr=easting_arr,
northing_arr=northing_arr,
)
)
print(f"TIME SMDA wellbore trajectories to list and validate {timer.lap_s():.2f} seconds")
LOGGER.debug(f"TIME SMDA wellbore trajectories to list and validate {timer.lap_s():.2f} seconds")
return wellbore_trajectories
5 changes: 1 addition & 4 deletions frontend/src/modules/3DViewer/view/utils/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ export function makeWellsLayer(
fieldWellboreTrajectoriesData: WellboreTrajectory_api[],
selectedWellboreUuid: string | null
): WellsLayer {
const tempWorkingWellsData = fieldWellboreTrajectoriesData.filter(
(el) => el.uniqueWellboreIdentifier !== "NO 34/4-K-3 AH"
);
const wellLayerDataFeatures = tempWorkingWellsData.map((well) =>
const wellLayerDataFeatures = fieldWellboreTrajectoriesData.map((well) =>
wellTrajectoryToGeojson(well, selectedWellboreUuid)
);

Expand Down
Loading