OSOceanAcoustics / echoregions

Interfacing water column sonar data with annotations and labels
https://echoregions.readthedocs.io/
Apache License 2.0
6 stars 6 forks source link

Investigate Memory Expansion of regions2d.mask #141

Open ctuguinay opened 11 months ago

ctuguinay commented 11 months ago

The regions2d.mask function is a wrapper function around regionmask's mask_3D function. Originally, the function was a wrapper around regionmask's mask function which is a 2D mask creation function, so the current concern is the memory expansion that will result when there are many masks being computed in the current iteration of regions2d.mask.

Currently, I'm not too sure if regionmask .mask function uses mask_3D under the hood since the documentation is hard to read, but the 2d and 3d masking functions in that repository use the same underlying mask function.

In the near-future, if we do end up encountering memory issues, we can just iterate and use very few region_id values as input to the mask function.

@leewujung describes the problem here too: https://github.com/OSOceanAcoustics/echoregions/pull/139#pullrequestreview-1651100495