Skip to content

Commit

Permalink
expanded filter
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPlayer3 committed Feb 29, 2024
1 parent ed5f543 commit 7a6be8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/asf_tools/watermasking/generate_worldcover_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def tile_preprocessing(tile_dir, min_lat, max_lat, min_lon, max_lon):
def filename_filter(filename):
latitude = int(filename.split('_')[5][1:3])
longitude = int(filename.split('_')[5][4:7])
in_lat_range = (latitude >= min_lat) and (latitude <= max_lat)
in_lon_range = (longitude >= min_lon) and (longitude <= max_lon)
in_lat_range = (latitude >= min_lat - WORLDCOVER_TILE_SIZE) and (latitude <= max_lat + WORLDCOVER_TILE_SIZE)
in_lon_range = (longitude >= min_lon - WORLDCOVER_TILE_SIZE) and (longitude <= max_lon + WORLDCOVER_TILE_SIZE)
return in_lat_range and in_lon_range
filenames_filtered = [f for f in filenames if filename_filter(f)]

Expand Down

0 comments on commit 7a6be8b

Please sign in to comment.