Skip to content

Commit

Permalink
Testing rectification with COG #120
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronBodine committed Jun 10, 2024
1 parent beee443 commit 237c531
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/class_rectObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ def _interpTrack(self,
'pix_m': self.pixM,
lons: x_interp[0],
lats: x_interp[1],
'dep_m': dfOrig['dep_m']}
'dep_m': dfOrig['dep_m'],
'instr_heading': dfOrig['instr_heading']
}

sDF = pd.DataFrame(smooth) # Convert dictionary to Pandas df

Expand Down Expand Up @@ -518,7 +520,11 @@ def _getRangeCoords(self,
rotate *= -1

# Calculate ping bearing and normalize to range 0-360
sDF[ping_bearing] = (sDF['cog']+rotate) % 360
cog = True
if cog:
sDF[ping_bearing] = (sDF['cog']+rotate) % 360
else:
sDF[ping_bearing] = (sDF['instr_heading']+rotate) % 360

############################################
# Calculate range (in meters) for each chunk
Expand Down Expand Up @@ -689,7 +695,7 @@ def _interpRangeCoords(self,
##################################################
# Join smoothed trackline to smoothed range extent
# sDF = sDF[['record_num', 'chunk_id', 'ping_cnt', 'time_s', 'pix_m', 'lons', 'lats', 'utm_es', 'utm_ns', 'cog', 'dep_m']].copy()
sDF = sDF[['record_num', 'chunk_id', 'ping_cnt', 'time_s', 'lons', 'lats', 'utm_es', 'utm_ns', 'cog', 'dep_m']].copy()
sDF = sDF[['record_num', 'chunk_id', 'ping_cnt', 'time_s', 'lons', 'lats', 'utm_es', 'utm_ns', 'instr_heading', 'cog', 'dep_m']].copy()
sDF.rename(columns={'lons': 'trk_lons', 'lats': 'trk_lats', 'utm_es': 'trk_utm_es', 'utm_ns': 'trk_utm_ns', 'cog': 'trk_cog'}, inplace=True)
rsDF.rename(columns={'cog': 'range_cog'}, inplace=True)
rsDF = rsDF[['record_num', 'range_lons', 'range_lats', 'range_cog']]
Expand Down

0 comments on commit 237c531

Please sign in to comment.