diff --git a/geosyspy/geosys.py b/geosyspy/geosys.py index 478df6e..1595762 100644 --- a/geosyspy/geosys.py +++ b/geosyspy/geosys.py @@ -505,11 +505,11 @@ def get_mr_time_series( self, start_date: datetime, end_date: datetime, - indicator, + indicators, sensors_collection: Optional[list[SatelliteImageryCollection]] = [ SatelliteImageryCollection.SENTINEL_2, ], - aggregation: str = "Median", + aggregations: str = ["Median"], smoothing_method: str = "Whittaker", apply_denoiser: bool = True, apply_end_of_curve: bool = True, @@ -525,12 +525,12 @@ def get_mr_time_series( Args: start_date (datetime): The start date of the time range for satellite coverage. end_date (datetime): The end date of the time range for satellite coverage. - indicator (str): The indicator for which satellite imagery is requested. + indicators (List[str]): The list of indicator for which satellite imagery is requested. sensors_collection (Optional[List[SatelliteImageryCollection]], optional): A list of satellite imagery collections to consider. Defaults to [SatelliteImageryCollection.SENTINEL_2]. coverage_percent (int, optional): Minimum clear cover percentage. Defaults to 80. - aggregation (str, optional): Method to aggregate data. Defaults to "Median". + aggregations (List[str], optional): Method to aggregate data. Defaults to ["Median"]. smoothing_method (str, optional): Method to smooth data. Defaults to "Whittaker". apply_denoiser (bool, optional): Whether to apply denoiser. Defaults to True. apply_end_of_curve (bool, optional): Whether to apply end of curve. Defaults to True. @@ -552,10 +552,10 @@ def get_mr_time_series( polygon, start_date, end_date, - indicator, + indicators, sensors_collection, coverage_percent, - aggregation, + aggregations, smoothing_method, apply_denoiser, apply_end_of_curve, diff --git a/geosyspy/services/map_product_service.py b/geosyspy/services/map_product_service.py index d476b11..92e7b14 100644 --- a/geosyspy/services/map_product_service.py +++ b/geosyspy/services/map_product_service.py @@ -247,12 +247,12 @@ def get_mr_time_series( polygon: str, start_date: datetime, end_date: datetime, - indicator, + indicators, sensors_collection: Optional[list[SatelliteImageryCollection]] = [ SatelliteImageryCollection.SENTINEL_2, ], coverage_percent: int = 80, - aggregation: str = "Median", + aggregations: list[str] = ["Median"], smoothing_method: str = "Whittaker", apply_denoiser: bool = True, apply_end_of_curve: bool = True, @@ -267,7 +267,7 @@ def get_mr_time_series( polygon (str): The polygon geometry in WKT format. start_date (datetime): The start date of the time range for satellite coverage. end_date (datetime): The end date of the time range for satellite coverage. - indicator (str): The indicator for which satellite imagery is requested. + indicators (List[str]): The indicator for which satellite imagery is requested. sensors_collection (Optional[List[SatelliteImageryCollection]], optional): A list of satellite imagery collections to consider. Defaults to [SatelliteImageryCollection.SENTINEL_2]. @@ -300,8 +300,8 @@ def get_mr_time_series( body["endDate"] = end_date if sensors_collection is not None: body["sensors"] = [elem.value for elem in sensors_collection] - body["vegetationIndex"] = indicator - body["aggregation"] = aggregation + body["vegetationIndexes"] = indicators + body["aggregations"] = aggregations body["smoothingMethod"] = smoothing_method body["applyDenoiser"] = apply_denoiser body["applyEndOfCurve"] = apply_end_of_curve diff --git a/geosyspy/utils/constants.py b/geosyspy/utils/constants.py index e23894f..9a5db58 100644 --- a/geosyspy/utils/constants.py +++ b/geosyspy/utils/constants.py @@ -181,7 +181,7 @@ class GeosysApiEndpoints(Enum): FLM_REFLECTANCE_MAP = "field-level-maps/v5/maps/reflectance-map" FLM_DIFFERENCE_MAP = "field-level-maps/v5/maps/difference-map" FLM_CATALOG_IMAGERY_POST = "field-level-maps/v5/season-fields/catalog-imagery" - FLM_TIME_SERIES = "field-level-maps/v5/time-serie" + FLM_TIME_SERIES = "field-level-maps/v5/time-series" WEATHER_ENDPOINT = "Weather/v1/weather" ANALYTICS_FABRIC_ENDPOINT = "analytics/metrics" diff --git a/tests/test_int_geosys.py b/tests/test_int_geosys.py index 18a0108..42caca9 100644 --- a/tests/test_int_geosys.py +++ b/tests/test_int_geosys.py @@ -369,7 +369,7 @@ def test_get_mr_time_series(self): end_date = dt.datetime.strptime("2024-01-01", "%Y-%m-%d") POLYGON = "POLYGON ((-94.49272194 43.21256403, -94.48234182 43.21245482, -94.48257098 43.2174915, -94.48264176 43.21951919, -94.49074313 43.219511600000004, -94.49035218 43.21879097, -94.49026379 43.21852604, -94.48990869000001 43.21725052, -94.48984158 43.21664338, -94.49009374 43.21619873, -94.4906074 43.21586407, -94.49140384 43.215565930000004, -94.49227368 43.21530949, -94.49249125 43.21513659, -94.49262537 43.2149919, -94.49271655 43.2148082, -94.49272194 43.21256403))" df = self.client.get_mr_time_series( - start_date, end_date, polygon=POLYGON, indicator="Ndwi" + start_date, end_date, polygon=POLYGON, indicators=["Ndwi"] ) assert df is not None - assert df['smoothedData'] is not None + assert df["smoothedData"] is not None