Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LLeiSong opened this issue Dec 11, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@LLeiSong
Copy link
Owner

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.
@LLeiSong LLeiSong added the enhancement New feature or request label Dec 11, 2021
@LLeiSong LLeiSong self-assigned this Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant