EOA-team / eodal

Earth Observation Data Analysis Library
https://eodal.readthedocs.io/en/latest/
GNU General Public License v3.0
93 stars 15 forks source link

Patch EOdal v0.1.1 (2): Fixed Band.clip() method and added functionality to mask pixels outside geometry #25

Closed lukasValentin closed 1 year ago

lukasValentin commented 1 year ago

In EOdal 0.1.0 the clip method was introduced in the Band class and, hence, also the RasterCollection class.

The previous implementation, however, did only support clipping to a bounding box around the feature, i.e., in the case of a irregularly shaped feature, also pixels outside the feature (but within the bounding box) were returned. Obviously, this is not desired if one is only interested in obtaining the actual feature pixel values are statistics thereof.

Therefore, a new keyword was introduced (full_bounding_box_only) which set to False by default, meaning that pixel values outside the feature boundaries are masked (similar to the reading of raster data). If one is interested in analysing all pixel values within the bounding box, full_bounding_box_only must be set to True.

Further small changes include the introduction of a clip_scenes method as a wrapper around the Band.cip() method at the SceneCollection level and a small fix in the default SCL classes for Sentinel-2 in the Sentinel2.mask_clouds_and_shadows method (now everything but classes 4 and 5 are masked by default, i.e., vegetation and bare soil).

This pull request closes #22