Skip to content

Commit

Permalink
restructured lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPlayer3 committed Feb 28, 2024
1 parent 2ed5362 commit 45e55c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/asf_tools/watermasking/generate_worldcover_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ def tile_preprocessing(tile_dir, min_lat, max_lat):
"""

filenames = [f for f in os.listdir(tile_dir) if f.endswith('.tif')]
def get_lat(filename): int(filename.split('_')[5][1:3])
def filter(filename): (get_lat(filename) >= min_lat) and (get_lat(filename) <= max_lat)
filenames_filtered = [f for f in filenames if filter(f)]
def filename_filter(filename):
latitude = int(filename.split('_')[5][1:3])
(latitude >= min_lat) and (latitude <= max_lat)
filenames_filtered = [f for f in filenames if filename_filter(f)]

index = 0
num_tiles = len(filenames_filtered)
Expand Down

0 comments on commit 45e55c9

Please sign in to comment.