Edited: Locate center of floating "islands"

Hi,

I am working with an array that is 150x150. Typical data for the array looks like image 1 (raw data).

However, if I select a subset of the original data set, you can see that there are these long gradual traces moving diagonally across (image 2).

And if I zoom in further you can see that the traces are made up of tiny “floating islands” with small discontinuities between them.

My question this is how to “find” each of these floating islands starting from the raw data and then group the points so that they are considered separate. Is there a way to take advantage of their discontinuities? Big goal would be to locate the center of each island as well as its boundary.

Update to my efforts:

Starting with a subset of my original data:

Using some built-in filters with Mathematica I’ve been able to “isolate” the islands more or less with the following code:

gswla = GradientFilter[swla, 1];

This gives me a gradient matrix of the initial square matrix I was using.

Next, I went through the matrix and put Null on anything above a threshold value that is known for this type of data.

Table[If[gswla[[i, j]] < thresh, gswla[[i, j]], Null], {i, 1, 
   Dimensions[gswla][[1]]}, {j, 1, Dimensions[gswla][[2]]}];

This then gives me a plot of all the “Islands” isolated by “no man’s land”

It is easier to see in MatrixForm:

So using this “isolated” data, how can I group these islands into their own distinguishable cluster? I figure I can use the matrix coordinates for each cluster in the gradient matrix to identify the counterpart in the original data set.

Thanks!!!

Have you tried the cluster analysis functionality in WL?

Yes.

I get the following result:

FindClusters::amtd: FindClusters is unable to automatically select an
appropriate dissimilarity function for the input data

Maybe a For loop or Table would be able to find the boundaries?

Hi Rohit,

Adding more feedback to your suggestion, I did try the FindClusters to the raw wavelength data and I got the following “clusters”:

You can see that the algorithm didn’t group by discrete wavelength islands or bands, but rather some version of descending steps. I don’t know enough about the algorithm to tell if that approach is suitable for this application.