umr-lops / xsar

Synthetic Aperture Radar (SAR) Level-1 GRD python mapper for efficient xarray/dask based processing
https://cyclobs.ifremer.fr/static/sarwing_datarmor/xsar/
MIT License
25 stars 8 forks source link

set default mask (like 'ocean_mask') #28

Closed oarcher closed 2 years ago

oarcher commented 2 years ago

currently, the default mask is low resolution 'land_mask'.

It's possible to define another mask with xsar.Sentinel1Meta.set_mask_feature, but this has to be done for each openned product.

We should provide a classmethod to set the default mask at a class level, so the user can set a default mask.

For example, the default land mask doesn't mask lakes. A good ocean mask can be found here : https://osmdata.openstreetmap.de/download/water-polygons-split-4326.zip

oarcher commented 2 years ago

so, to set a new default ocean mask (lakes not included):

xsar.Sentinel1Meta.set_mask_feature('ocean', os.path.join(xsar.get_test_file('water-polygons-split-4326'), 'water_polygons.shp'))