Skip to content

Commit

Permalink
EditFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderJuestel committed May 4, 2024
1 parent c5278f7 commit 8f7fa3d
Show file tree
Hide file tree
Showing 7 changed files with 1,473 additions and 1,303 deletions.
14 changes: 10 additions & 4 deletions pyborehole/borehole.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,8 @@ def add_deviation(self,

def add_well_logs(self,
path: str,
nodata: Union[int, float] = -9999) -> Union[LASLogs, DLISLogs, LISLogs]:
nodata: Union[int, float] = -9999,
depth_scale_factor: Union[int, float] = 1) -> Union[LASLogs, DLISLogs, LISLogs]:
"""Add Well Logs to the Borehole Object.
Parameters
Expand All @@ -1548,6 +1549,8 @@ def add_well_logs(self,
Path to the well log file, e.g. ``path='Well_Logs.las'``.
nodata : Union[int, float], default: ``-9999``
Nodata value to be replaced by `np.NaN`, e.g. ``nodata=-9999``.
depth_scale_factor: Union[int, float], default: ``1``
Factor to scale the depth values, e.g. "depth_scale_factor=1".
Returns
_______
Expand Down Expand Up @@ -1610,7 +1613,8 @@ def add_well_logs(self,

# Creating well logs from LAS file
self.logs = LASLogs(self,
path=path)
path=path,
depth_scale_factor=depth_scale_factor)

# Opening DLIS file if provided
elif path.endswith('.dlis') or path.endswith('.DLIS'):
Expand All @@ -1622,14 +1626,16 @@ def add_well_logs(self,
# Creating well logs from DLIS file
self.logs = DLISLogs(self,
path=path,
nodata=nodata)
nodata=nodata,
depth_scale_factor=depth_scale_factor)

# Opening LIS file if provided
elif path.endswith('.lis') or path.endswith('.LIS'):
# Creating well logs from LIS file
self.logs = LISLogs(self,
path=path,
nodata=nodata)
nodata=nodata,
depth_scale_factor=depth_scale_factor)

else:
raise ValueError('Please provide a LAS, DLIS or LIS file')
Expand Down
5 changes: 3 additions & 2 deletions pyborehole/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def resample_log(log: Union[gpd.GeoDataFrame, LineString, pd.DataFrame],
raise TypeError('The start of the resampling interval must be provided as float or int')

# Checking that the resampling end is provided as float or int
if not isinstance(resampling_end, (float, int)):
if not isinstance(resampling_end, (float, int, type(None))):
raise TypeError('The end of the resampling interval must be provided as float or int')

# Checking that the drop first value is provided as bool
Expand Down Expand Up @@ -409,7 +409,7 @@ def resample_logs(logs: pd.DataFrame,
raise TypeError('The start of the resampling interval must be provided as float or int')

# Checking that the resampling end is provided as float or int
if not isinstance(resampling_end, (float, int)):
if not isinstance(resampling_end, (float, int, type(None))):
raise TypeError('The end of the resampling interval must be provided as float or int')

# Checking that the drop first value is provided as bool
Expand Down Expand Up @@ -515,3 +515,4 @@ def merge_logs(paths: List[str],
merged_df = merged_df.rename(columns={'Y': 'DEPTH'}).set_index('DEPTH')

return merged_df

Loading

0 comments on commit 8f7fa3d

Please sign in to comment.