How can I average irregularly sampled bathymetric cross section data across a number of observations in time?

1 vue (au cours des 30 derniers jours)
Hello,
This is my first time asking a question on MATLAB Answers but I'm already very grateful for the answers and community already available. Here's my situation:
I am analyzing oceanographic data taken from cruises through a bay, specifically dissolved oxygen. Monthly data are available for many years, however the number of samples on each cruise can vary. In total, there are 43 stations (I am using cross sectional station distance as my 'x' variable) and at each station samples are taken at 0-32 different depths (where depth is the 'y' variable). Some cruises do not sample all stations or all depths, so there is not a consistent total number of samples per monthly observation. In this case, dissolved oxygen saturation is the 'z' variable (color)
I am interested in taking an average of all observed oxygen saturation values by station and depth. The result should be an array where the number of columns is equal to the number of stations, the number of row under each column is equal to the number of unique depths that have been sampled at that station across all time (the maximum being 32 different depths at a single station and the minimum being 1 depth at a single station). The values in the array will be an average oxygen saturation at that depth.
In attempting this problem I have already tried creating a 3d array as described above, with the 3rd dimension being time (each array along the 3rd dimension is a new monthly observation). For stations where the number of depths sampled was less than 32, I filled the remainder of the row values with NaNs. However, the problem I have encountered is that I can't associate each oxygen value with a specific depth. The depths were not sampled uniformly between sites or time (so the first entries of each column aren't necessarily associated with the same depths), so some stations may have samples taken at 1m, 2m, and 3m, during one month while the next month a sample was taken only at 3m.
My question is:
How can I create a data structure to average across (or just take the average in general)? I want each oxygen value to be associated with 3 values: a station number (x), a depth (y), and a date (z). I've attached photos of some visualizations of the discrete data and a color plot where I created a regular array with columns as station number, and the same number of data points for each row by using interpolation for each station to get 32 depth values sampled between the maximum and minimum depth.
Thanks in advance!
Best,
Dante

Réponses (0)

Catégories

En savoir plus sur Oceanography and Hydrology dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by