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

issue reading tops from csv #2

Open
dunchay opened this issue Oct 17, 2018 · 1 comment
Open

issue reading tops from csv #2

dunchay opened this issue Oct 17, 2018 · 1 comment
Labels

Comments

@dunchay
Copy link

dunchay commented Oct 17, 2018

when I use...

lasfilepath = r'1044931248.las'
log = ptr.Log(lasfilepath)
tops_path = r'D:\Users\duncan.hay\Documents\python\petrophysics\tops.csv'
log.tops_from_csv(tops_path)
print (log.tops)

it returns an empty dictionary meaning i cant use any of the additional functionality. The tops.csv is the exact same format as the example you give.

csv format:
uwi,form,depth
1044931248,fm_1,800
1044931248,fm_2,2000.2
1044931248,fm_3,3000.5

Can you advise?
Thanks

@toddheitmann
Copy link
Owner

toddheitmann commented Nov 19, 2018

The tops_from_csv method creates a dataframe from the csv and adds the tops when the tops csv uwi matches the log uwi, source code found here.

Could you try this to debug?

lasfilepath = r'1044931248.las'
log = ptr.Log(lasfilepath)
# see the uwi of the log object
log_uwi = str(self.well['UWI'].value)
print(log_uwi)
tops_path = r'D:\Users\duncan.hay\Documents\python\petrophysics\tops.csv'
top_df = pd.read_csv(tops_path, dtype = {'uwi': str,'form': str, 'depth': float})
# see csv of tops
print(top_df.head())
# count matches from tops dataframe uwi to log uwi
# if this value is 0 then the uwi from the las file does not match the uwi in the csv
print((top_df.uwi == log_uwi).sum())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants