From 574b5c3ad92ba63dff028a14c2090310f92fd5e5 Mon Sep 17 00:00:00 2001 From: Sharon Fitzpatrick Date: Tue, 26 Sep 2023 15:54:26 -0700 Subject: [PATCH] fix output_to_gdf filter bug --- src/coastsat/SDS_tools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coastsat/SDS_tools.py b/src/coastsat/SDS_tools.py index abad982..7e92751 100644 --- a/src/coastsat/SDS_tools.py +++ b/src/coastsat/SDS_tools.py @@ -835,7 +835,7 @@ def create_gdf( shoreline: List[List[float]], date: datetime, satname: str, - geoaccuracy: float, + geoaccuracy: Union[float, str], cloud_cover: float, idx: int, geomtype: str, @@ -851,8 +851,8 @@ def create_gdf( Date associated with the shoreline. satname: str Satellite name. - geoaccuracy: float - Geo accuracy value. + geoaccuracy: float or string + Geo accuracy value, can be float for landsat or PASSED/FAILED for S2 cloud_cover: float Cloud cover value. idx: int @@ -917,7 +917,7 @@ def output_to_gdf( # we use filter(None,shoreline_gdf) to not include any empty shorelines which is indicated by create_gdf returning None gdf_list = list( filter( - None, + lambda gdf: not gdf.empty if gdf is not None else False, map( lambda idx: create_gdf( output["shorelines"][idx],