centreborelli / s2p

Satellite Stereo Pipeline
GNU Affero General Public License v3.0
208 stars 67 forks source link

Avoid computing masked tiles #116

Closed daviddemeij closed 2 years ago

daviddemeij commented 2 years ago

When there are a lot of masked tiles you can save a lot of computing time by making sure that s2p doesn't try to generate a DSM for fully masked tiles. So if all values in the mask are False, is_this_tile_useful should return False, None.

I also added two lines to masking.py to avoid computing the border mask if all values in the raster mask are False already.

Results of my small test:

Before this change

Total elapsed time: 0:08:25.749199

After this change

Total elapsed time: 0:05:13.624001
gfacciol commented 2 years ago

Thanks @daviddemeij!