Skip to content

More robust way to detect sentinel-2 level-2 images between zip files and unzipped files #3

@LLeiSong

Description

@LLeiSong

As described in the title. The related code:

fnames_all = os.listdir(processed_path)
fnames_all = list(filter(lambda fname: os.path.isdir(join(processed_path, fname)), fnames_all))
if len(fnames_all) == 0:
fnames_all = os.listdir(processed_path)
fnames_all = list(filter(lambda fname: fname.endswith('zip'), fnames_all))
tile_ids = list(set(map(lambda fname: re.search("T[0-9]{2}[A-Z]{3}", fname).group(0), fnames_all)))

Thoughts:

  1. List all zip files and unzipped folders
  2. Compare their names
  3. If they are identical, pass
  4. If they are not identical, get the difference between them, give the user a warning, then pick up the ones with more files to use.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions