how to average data points in column 3 based on values in columns 1 and 2
Show older comments
I have a bunch of single beam data points, about 50k points. I want to interpolate between them in a different bathymetric processing software. The data is a combination of two datasets (different surveys), meaning they were collected at different times, so the problem is the depth is not accurate. One survey is deeper than the other likely because of the tides, however the surveys cover the exact same area but at different approach angles (see picture). So when I plot them I have two sets of track lines that dont match up, when looking at my CSV file I have a lot of points that are very similar but not exact. Ive tried filtering unique values in excel and deleting duplicates, only 14/50000 were exactly the same. My question is how do I average these two surveys? Im honestly not sure where to start and there are probably numerous ways to do this so im getting lost in my research.
My goal is to bring these two surfaces to the same depth, and eventually smooth the lines enough to remove the bumpy surface before exporting the points to my other bathymetric program and finally export a geotiff to GIS. Thanks agian, any help is really appreciated!
I forgot to add an example of the data points:

As you can tell some of these points are extremely close together, what I want to do is find ordered pairs in columns 1 and 2 that are very similar and replace all the corresponding values in column 3 with their average. Hopefully any of this makes sense.
Overview of tracklines:

Zoomed in section showing the difference in depth:

Heres my code to visualize the data:
[D,S] = xlsread("BathyScriptTest.xlsx");
lat = D(:,1);
lon = D(:,2);
dep = D(:,3);
depS = smooth(dep);
figure
plot3(lat, lon, depS, '.')
grid on
view(35,60)
title('Bathy Lines')
2 Comments
Image Analyst
on 6 Mar 2024
You forgot to attach "BathyScriptTest.xlsx" so I didn't pay much attention after that. I'll check back later.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Bradley
on 6 Mar 2024
Accepted Answer
More Answers (0)
Categories
Find more on Univariate Discrete Distributions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


