-
Notifications
You must be signed in to change notification settings - Fork 370
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
Landsat datasets don't support Level-1 products #492
Comments
It could be that the filename format of the files you downloaded is different than what the dataset class expects. What do the filenames look like? |
I have downloaded Landsat8 images from USGS, including Landsat 8OLI/TIRS C1 Level-1 products and Landsat 8-9 OLI/TIRS C2 L1 products. I don't know wheather they are suitable for torchgeo. |
Can you share one of the filenames? |
LC08_L1TP_020038_20211023_20211103_02_T1 |
Is there no file extension or spectral band in the filename? Are all bands in a single file? It looks like our from torchgeo.datasets import Landsat8
Landsat8.filename_regex = r"""
^L
(?P<sensor>[COTEM])
(?P<satellite>\d{2})
_(?P<processing_correction_level>[A-Z0-9]{4})
_(?P<wrs_path>\d{3})
(?P<wrs_row>\d{3})
_(?P<date>\d{8})
_(?P<processing_date>\d{8})
_(?P<collection_number>\d{2})
_(?P<collection_category>[A-Z0-9]{2})
"""
Landsat8.separate_files = False
landsat8 = Landsat8(root="...") Let me know if the above code works. I'll need to think about how to handle both level 1 and 2 products. We may need separate datasets for both. |
LC08_L1TP_020038_20211023_20211103_02_T1 is the name of folder and all relative files exist. All bands files in the folder. I don't change the format which is provided by USGS. |
What are the names of the files in this folder? TorchGeo doesn't look at folder names at all. |
Including LC08_L1TP_020038_20211023_20211103_02_T1_B1.TIF ,LC08_L1TP_020038_20211023_20211103_02_T1_B2.TIF and so on. And I try to fuse all bands to get a new tif file, but also can't be recognized. Therefore, I can make a concise conclusion that TorchGeo is only designed to handle level 2 surface reflectance products which need to include all bands? |
Ah thanks, this is much simpler to handle than I expected. At some point in the near future I'll submit a PR to fix this. In the meantime, the following should work: from torchgeo.datasets import Landsat8
Landsat8.filename_regex = Landsat8.filename_regex.replace("_SR", "")
landsat8 = Landsat8(root="...") |
Can you check to see if this is fixed by #504? With this PR, you should be able to simply say: Landsat8(root="...", bands=["B1", ..., "B11"]) and TorchGeo will pick up all Level-1 data for you. |
The part of Geospatial datasets tells me that if I have downloaded Landsat8 images,I can use the code :
landsat8 = Landsat8(root="...", bands=["B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9"])
.But when I run the code, the warning will appear:
FileNotFoundError: No Landsat data was found in ...
I make sure that my root is correct and I have downloaded Landsat8 image from USGS, but the warning also exist.
The text was updated successfully, but these errors were encountered: