softwareunderground / subsurface

Core data exchange library for subsurface science and engineering
Apache License 2.0
60 stars 19 forks source link

Reading Well Data into Subsurface #70

Open archieskang opened 1 year ago

archieskang commented 1 year ago

I try this Tutorials,and the result is like this. 2023-11-24 233213 need help,plz.

AlexanderJuestel commented 1 year ago

Hello @archieskang, which tutorial have you been trying? What have you tried? What is your problem? What alternatives have you tried?

Please elaborate a little more on what your problem is.

Thanks

archieskang commented 1 year ago

Hello, I have tried the tutorial of how to reading well data into subsurface. I did not change any code, just follow the tutorial, , after I run: wts = WellyToSubsurfaceHelper(collar_df=collar, survey_df=survey, lith_df=lith) as the below screenshot shows, some data failed being processed. 2023-11-25 000649 at the end, the output image also look different compare to the tutorial, Really appreciate the help, thank you!

AlexanderJuestel commented 1 year ago

Could you provide us with the dataframes you are using?

archieskang commented 1 year ago

Yes, here they are: 2023-11-25 110809 2023-11-25 110859 2023-11-25 110922 2023-11-25 110945

AlexanderJuestel commented 1 year ago

@archieskang, could you provide us with the data? Not just screenshots.

archieskang commented 1 year ago

sorry,here is the code: base_url = "https://raw.githubusercontent.com/softwareunderground/subsurface/main/tests/data/borehole/"

data_hash = "a91445cb960526398e25d8c1d2ab3b3a32f7d35feaf33e18887629b242256ab6" raw_borehole_data_csv = pooch.retrieve(url=base_url + 'kim_ready.csv', known_hash=data_hash)

reading_collars = ReaderFilesHelper( file_or_buffer=raw_borehole_data_csv, # Path to file index_col="name", # Column used as index usecols=['x', 'y', 'altitude', "name"] # Specific columns for collar )

We can see the fields from the class easily converting it to a dict

asdict(reading_collars)

collar = read_collar(reading_collars) collar

survey = read_survey( ReaderFilesHelper( file_or_buffer=raw_borehole_data_csv, index_col="name", usecols=["name", "md"] ) ) survey

lith = read_lith( ReaderFilesHelper( file_or_buffer=raw_borehole_data_csv, usecols=['name', 'top', 'base', 'formation'], columns_map={'top': 'top', 'base': 'base', 'formation': 'component lith', } ) )

lith

wts = WellyToSubsurfaceHelper(collar_df=collar, survey_df=survey, lith_df=lith)

Japhiolite commented 1 year ago

The collar coordinates to not get parsed correctly through the WellyToSubsurfacehelper. Try adding the coordinates of the borehole collar to the wells in the welly project. So, if we assume that the collar dataframe has BHID, X, Y, Z columns, and the welly uwi = BHID it might work along the lines:

import subsurface as su

wts = su.reader.wells.WellyToSubsurfaceHelper(collar_df=collar, survey_df=survey, lith_df=lith)

for project in wts.p:
    name = project.uwi # get unique borehole name
    collar_coordinates = collar.query('BHID==@name').values
    project.location.position = project.location.position + collar_coordinates