Import Well Log Curve Data from file

First, say we have a new well CUG3. After writing the CUG3.well file, and save it to Wellinfo folder. We initialize the survey.

[2]:
survey = ppp.Survey(Path(SURVEY_FOLDER))
'No well named cug3'

A meassage shows “no well named cug3”, it’s because there is no data stored in well_data.h5 file. (In pyGeoPressure, well log data is stored in hdf5 file.)

But we can still get its information:

[38]:
survey.wells
[38]:
{u'CUG1': <pygeopressure.basic.well.Well at 0x11031588>,
 u'CUG3': <pygeopressure.basic.well.Well at 0x10a0a8d0>}
[5]:
cug3 = survey.wells['CUG3']

We provides two methods for importing well log curve data:

0. Read las/pseudo-las file

First, we need to read data from file. pyGeoPressure provides a class LasData for reading las file and pseudo-las file.

[7]:
las_data = ppp.LasData(las_file="C:/Users/yuhao/Desktop/CUG_depth/log_curves.las")

get las file type with:

[11]:
las_data.file_type
[11]:
'pseudo-las'

Read pseudo-las file with:

[12]:
las_data.read_pseudo_las()

1. at runtime

At runtime, well log curve data are stored in pandas dataframe. Each Well object has a dataframe attribute. To import well log curve to Well, users can directly set a new dataframe read by LasData to Well.dataframe.

[14]:
cug3 = survey.wells['CUG3']

Set the data_frame of LasData to Well:

[19]:
cug3.data_frame = las_data.data_frame
[20]:
cug3.logs
[20]:
[u'Shale_Volume',
 u'Density',
 u'Density_filter20_sm1500',
 u'Velocity',
 u'Velocity_filter20_sm1500',
 u'Overburden_Pressure',
 u'Porosity']

Or part of the read dataframe:

[25]:
cug3.data_frame = las_data.data_frame[['Depth(m)', 'Shale_Volume(Fraction)', 'Density(G/C3)']]
[26]:
cug3.logs
[26]:
[u'Shale_Volume', u'Density']

After importing logs, users should call ``save_well_logs()`` to save them to storage file.

2. edit .hd5 file

In pyGeoPressure, well log curve data is stored in hdf5 files (I call it storage file) on disk. To import well log curves, users can directly manage hdf5 file.

pyGeoPressure provides class WellStorage to manage hdf5 files.

[27]:
storage = ppp.WellStorage(hdf5_file='C:/Users/yuhao/Desktop/CUG_depth/Wellinfo/well_data.h5')
[28]:
storage.add_well(well_name='cug3', well_data_frame=las_data.data_frame)
[29]:
storage.wells
[29]:
['cug1', 'cug2', 'cug3']

When we reinitialize the survey, we will see that the data has been imported into Well CUG3.

[34]:
survey = ppp.Survey(Path(SURVEY_FOLDER))
[35]:
cug3 = survey.wells['CUG3']
[36]:
cug3.logs
[36]:
[u'Shale_Volume',
 u'Density',
 u'Density_filter20_sm1500',
 u'Velocity',
 u'Velocity_filter20_sm1500',
 u'Overburden_Pressure',
 u'Porosity']