Skip to content

Commit

Permalink
Update GPR_locate_rebars.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveYangFASTNDE authored Aug 23, 2024
1 parent 676cf66 commit 3e8d828
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,27 +349,27 @@ def dewow(df):

return dewowed_df

def bgr(ar, win=0):
def bgr(data, win=0):
'''
Horizontal background removal. It uses the moving average method to cancel out continuous horizontal signal along size of the window.
Parameters:
- ar: GPR B-scan Pandas dataframe.
- data: GPR B-scan Pandas dataframe.
- win: window for uniform_filter1d.
Returns:
- ar_copy: Dataframe after background removal.
- data_copy: Dataframe after background removal.
'''
# Make a copy of the input array
ar_copy = ar.copy()
data_copy = data.copy()

window = int(win)

# Perform background removal on the copied array
ar_copy -= uniform_filter1d(ar_copy, size=window, mode='nearest')
data_copy -= uniform_filter1d(data_copy, size=window, mode='nearest')

# Return the modified copy
return ar_copy
return data_copy

def Timezero_mean(df_1, rhf_position, rhf_range):
'''
Expand Down Expand Up @@ -739,4 +739,4 @@ def locate_rebar_consecutive_discrete(migrated_data, velocity, rhf_range, rh_nsa
# Convert back to numpy array
filtered_cluster_centers = np.array(filtered_cluster_centers)

return filtered_cluster_centers
return filtered_cluster_centers

0 comments on commit 3e8d828

Please sign in to comment.