Fast `puddle drying' algorithm

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
stlaur
Posts: 30
Joined: Sun Jun 27, 2010 8:45 pm
Location: Old Dominion University

Fast `puddle drying' algorithm

#1 Unread post by stlaur »

When using realistic coastal topography and inundation (WET_DRY), it is not uncommon for wetdry_mask_rho to feature a few wet `puddles' that are disconnected from the main body of water, at least temporarily.
I'm looking for a fast `puddle drying' algorithm, i.e. one that is provided a logical mask of 1 and 0, and then discards all the 1 that aren't connected to the main body of water.
This is a very basic thing that's not specific to ROMS at all, so presumably someone, somewhere, has come up with a very efficient algorithm to do this.
Note that this isn't about adding a new functionality to ROMS, but about post-processing model outputs for visualization purposes.
I have my own puddle-drying Matlab function and it's reasonably fast, but not fast enough to my taste when I use it iteratively (in a loop) to e.g. create frames for a video.
If you have suggestions, I would appreciate if you would share them on the board. Thanks, Pierre

stlaur
Posts: 30
Joined: Sun Jun 27, 2010 8:45 pm
Location: Old Dominion University

Re: Fast `puddle drying' algorithm

#2 Unread post by stlaur »

A quick update on this---"artificial ponding" is the proper term for what I was referring to.
E.g., https://doi.org/10.1016/j.coastaleng.2022.104246
Since the initial post, I came up with a satisfyingly-fast function to handle the ponds in postprocessing.
Happy to share if someone is interested (psl@fastmail.net). Cheers

Post Reply