Merging two Sentinel-3 L2 images without losing the masks


I am trying to merge to images/dataset S3 L2 (marine product) that overlap. I wanna do the exact same operation as the mosaicing tool, but I want to keep the existing masks. Is there a way to do that?

Thank you.

That’s not well possible with the mosaic tool.
Because in overlapping regions the mask can be different and averaging masks is not possible.
But you could add the masks anyway to your variables. In the overlapping areas where the mask value are different you get values between 0 and 1. What you do with these values is then up to you.
But these results are not straightforward usable as mask. But from the created band you can generate a mask.
I can also imagine no other solution at the moment.