Skip to content

Commit

Permalink
get_time_serie to get_time_series
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Papon authored and Julien Papon committed Jul 25, 2024
1 parent 583732e commit ebb85b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions geosyspy/geosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,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,
Expand All @@ -524,12 +524,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.
Expand All @@ -551,10 +551,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,
Expand Down
10 changes: 5 additions & 5 deletions geosyspy/services/map_product_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,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,
Expand All @@ -250,7 +250,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].
Expand Down Expand Up @@ -283,8 +283,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
Expand Down
2 changes: 1 addition & 1 deletion geosyspy/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class GeosysApiEndpoints(Enum):
FLM_BASE_REFERENCE_MAP_POST = "field-level-maps/v5/maps/base-reference-map"
FLM_REFLECTANCE_MAP = "field-level-maps/v5/maps/reflectance-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"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_int_geosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ebb85b3

Please sign in to comment.