Skip to content

Commit

Permalink
use cloud variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lillythomas committed Nov 15, 2023
1 parent 7a902e5 commit 74ccc40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_week(year, month, day):
return f"{start_date_str}/{end_date_str}"


def get_conditions(year1, year2):
def get_conditions(year1, year2, cloud_cover_percentage):
"""
Get random conditions (date, year, month, day, cloud cover) within the specified year range.
Expand All @@ -93,7 +93,7 @@ def get_conditions(year1, year2):
YEAR = date.year
MONTH = date.month
DAY = date.day
CLOUD = 50
CLOUD = cloud_cover_percentage
return date, YEAR, MONTH, DAY, CLOUD


Expand Down Expand Up @@ -380,7 +380,7 @@ def process(year1, year2, aoi, resolution, cloud_cover_percentage, nodata_pixel_
- xr.DataArray: Merged xarray DataArray containing processed data.
"""

date, YEAR, MONTH, DAY, CLOUD = get_conditions(year1, year2)
date, YEAR, MONTH, DAY, CLOUD = get_conditions(year1, year2, cloud_cover_percentage)
week = get_week(YEAR, MONTH, DAY)

catalog, s2_items, BBOX, epsg = search_sentinel2(week, aoi, cloud_cover_percentage, nodata_pixel_percentage)
Expand Down

0 comments on commit 74ccc40

Please sign in to comment.