In the SAFE package for some collections, we get more than one data types. The script was setup to make sure the team is not missing out any file we got as part of the SAFE package.
To select only specific files the code snippets below has been
downloads = [item for sublist in downloads_all for item in sublist]
filter_files = ['.nc', '.dat','.bin'] # This will only download netcdf, data, and binary files, you can add/remove other data types as you see fit
def Filter(list1, list2):
return [n for n in list1 if
any(m in n for m in list2)]