Heave and Roll artifacts correction with python.
fToday I want to talk about the capabilities of the Python programming language in correcting the distortion of multibeam sonar data caused by uncompensated roll and heave. Of course, I am aware that such data are rejected and not suitable for further processing in most cases, as they will be out of tolerance. However, in view of sporting interest, I could not refrain from solving a similar problem, when a member of my network suggested that I try my hand.
The data has been distorted roll and heave quite badly, as can be seen on the X1m grid in the picture below:
But in the end, after several attempts, I got the following result:
Basic working conditions of this algorithm:
1. If there are coarse outliers, it is best to pre-clean the data;
2. It must be possible to export a text file of the following format: Easting, Northing, Depth, Ping Number (or Time), Beam Number;
3. A fairly flat topography without large man-made objects, otherwise the original script will produce significant distortions of the depths and seabed morphology;
4. You need spare time as it works quite slowly (a couple of hours per 90 mb file).
Step by step description of the algorithm
- Improts - in this blosk I load necessary libraries and define working folder as well as create list of files to process:
2. Start of loop through the working files - reads current file and defines important varibles:
3. Cleansing loop - necessary only if You have problems with the spikes which are badly affect the linear regression model:
Here You can use df.Bm>0; df.Bm.dZ<257; Slice_One.dZ<0.4 conditions to set which data to keep for farther processing.
4. Correction loop:
Here You can use (df_Clean.P<P+600)&(df_Clean.P>P-600 conditions to set windows size - it will define how many pings You will use to build the reference model. If You use just sevral pings - most probable this model will be affected by the Roll and Heave as well, If You take to many - Your data will be too smoothed.Conditions (df_Clean.Bm>5)&(df_Clean.Bm<251 are for selection which beams You want to use for farther processing.
Basicaly , this alghorithm in each cycle it takes one ping swath and build the linear regression model from it using beam number as the X values:
Blue line is the current ping swath, orange is the current swath linear regression model.
Also it builds similar model but from the set of pings around current one (which we are going to correct in this cycle). This set of pings should be enough to average Heave and Roll periodic variations. And when we calculate model it can predict trend line as for current ping but not affected by Roll and Heave variations:
Blue line is the current ping swath, orange is the current swath linear regression model, green - the model from slice of the pings arround current.
After that it calculates corrections for each beam number as difference between "Big" and "Small" models values. Those corrections are adding to the raw Z values. That allows to correct periodical variations of the roll and heave keeping the relief minimaly distarbed.
Conclusion
This approach opens up a wide range of possibilities in correcting multibeam echo sounder data. By combining different models (multiple linear regression, spline etc.) and adjusting the window width, it is possible to achieve sound speed error compensation and optimally adapt the algorithm to the current conditions. However, bottom morphology distortions are almost unavoidable and there is as yet no method to estimate the accuracy of the final result. As I was provided with only two files with no overlap I did not check how well they match with each other.
Personal thanks to the Petter Irewole Komolafe who provided the data set files and inspired me to do this work!
God
3 个月Hallo Mikhail, wonderful article. Most processing software dont do this. Could you please share the script? Alternatively do have a GitHub I can accces it from? Thanks in advance.
Geophysicist at XOCEAN
1 年Hi Mikhail Morozov, thanks for sharing your amazing work. Can you kindly share the script?
Machine Learning Engineer | AI | Deep Learning | Robotics | IoT | Embedded Systems
1 年Can I get your script file to solve this problem? I understand Python very well.
Party Chief | Geophysicist | Data Processor | Online Surveyor
3 年Hi Mikhail, recently came across your article and could you explain the beam number a little better, is it the count?