Get started with the CoFFee toolbox to explore your multibeam sonar raw data
This LinkedIn article is a modified version of this CoFFee tutorial on GitHub. Find other tutorials and more on the CoFFee wiki.
--
If you have multibeam sonar raw data in Kongsberg format (*.all or *.kmall) or Teledyne-Reson or Norbit (*.s7k) and a MATLAB license, you can start exploring and processing your data today with the free open-source MATLAB toolbox CoFFee.
This is a quick "Hello World" tutorial on how to use CoFFee to convert a raw data file to access the bathymetry and backscatter data in it.
1. Download and install CoFFee
See dependencies, install, and use information on the CoFFee home page for details, but in short:
coffeeFolder = 'C:\my\path\to\CoFFee';
addpath(genpath(coffeeFolder));
2. Convert raw data to the CoFFee format
Start with informing a folder of compatible raw data files. For this tutorial, I am using a short set of Kongsberg *.all files, acquired by Deakin University in 2014 off Warrnambool (Victoria, Australia) with a Kongsberg EM2040 C mounted on RV Yolla. You can download this test data here.
dataFolder = 'D:\data\test_data';
You can use the CoFFee function CFF_list_raw_files_in_dir to select files from a folder of raw data. This function takes for input a folder, and a range of options are possible to fine-tune our selection of files. With the following command, we simply get the first '.all' file in the folder:
rawFile = CFF_list_raw_files_in_dir(dataFolder, 'filesType', '.all', 'nFilesWanted', 1);
You can use the MATLAB command print to verify which file you selected, or use the CoFFee function CFF_print_raw_files, which is specially designed for list of raw files in CoFFee:
CFF_print_raw_files_list(rawFile);
Convert the raw data file with CoFFee function CFF_convert_raw_files. Here we are only interested in seafloor data (bathymetry and backscatter data) so use the 'seafloor' option for the 'conversionType' parameter to ignore any water-column data.
领英推荐
fData = CFF_convert_raw_files(rawFile,'conversionType','seafloor');
See this wiki page for more information on the function CFF_convert_raw_files and its options.
See this wiki page for information on converting more than one file at a time.
3. Access and display data
The converted output fData is a MATLAB structure array. Bathymetry and backscatter data are some of its fields, stored as 2D beams-per-ping arrays. For simplicity, you may save them as new variables with:
bathymetry = -fData.X8_BP_DepthZ; % in m
backscatter = fData.X8_BP_ReflectivityBS; % in dB
Notes:
Data is now ready to be displayed. Here is some example MATLAB code to do so:
figure;
ax(1) = subplot(211); %sub-plot for bathymetry
imagesc(bathymetry);
grid on; colorbar; colormap(ax(1),'jet');
xlabel('ping number'); ylabel('beam number'); title('bathymetry (m)');
ax(2) = subplot(212); % sub-plot for backscatter
imagesc(backscatter);
caxis([prctile(backscatter(:),10) prctile(backscatter(:),90)]); % enhance contrast
grid on; colorbar; colormap(ax(2),'gray');
xlabel('ping number'); ylabel('beam number'); title('backscatter (dB)')
rawFileName = CFF_file_name(char(rawFile));
sgtitle(rawFileName ,'Interpreter','none');
Below is a screenshot of the output you should obtain:
4. Conclusion
CoFFee is a MATLAB toolbox to explore and process multibeam sonar raw data. You may use it under the (very permissive) terms of the MIT license to explore your raw data and/or build your own processing pipelines, or software. This short article may have already given you ideas on what you can do with it, but to continue learning about other capabilities of CoFFee, see the tutorials in the CoFFee wiki, or the next articles in this series.
Semi - Retired Cartographer
3 个月Will it work with Octave as well as MatLab?
Marine Scientist | Researcher | Consultant | Project manager| Mentor ~ Spatial Ecology, Marine Spatial Planning, Conservation biology, MPAs & pro-Nature Based Solutions
3 个月Great job Alexandre C. G. Schimel, see this Amon Kimeli, Dr. rer. nat.
Geomatics Engineering | Ocean Mapping
3 个月It's interesting, I'd try to read the water column data someday. Appreciate it
Building Ocean Tech at Aquatic Labs | Oceanography, MRV for Ocean Carbon, Marine Sensing Technology
3 个月This is so cool! And kudos for making it open source!