semiautomaticgit / SemiAutomaticClassificationPlugin

https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
Other
140 stars 51 forks source link

Image conversion not working with Sentinel-2 L2A images #346

Closed claudioasn closed 6 months ago

claudioasn commented 8 months ago

I try to preprocess Sentinel-2 L2a images with the image conversion tool. When i the directory containing bands and select the metadata, nothing happens. No band is load on the table. To check, i tried to process the same scene with L1C, and it worked fine. Is there a different workflow for processing L2A images?

semiautomaticgit commented 8 months ago

Hello, the procedure for L1C is the same as L2A. Please enable "Records detailed events in a log file" and copy the log file as described here https://semiautomaticclassificationmanual.readthedocs.io/en/latest/faq.html#how-can-i-report-an-error

claudioasn commented 6 months ago

Hi @semiautomaticgit, I have the latest LTR QGIS and all dependencies installed and updated. Here is what I tried:

  1. SCP --> Preprocessing --> Image Conversion
  2. Selected the directory containing the Sentinel-2 L2A bands (D:\S2A_MSIL2A_20230819T131251_N0509_R138_T23LQF_20230819T181804.SAFE\GRANULE\L2A_T23LQF_A042606_20230819T131247\IMG_DATA). Here, no band was loaded. I tried to select only the 10m, 20m or 60m folder. Again, nothing happens.
  3. Tried to select the metadata file (here i tried D:\S2A_MSIL2A_20230819T131251_N0509_R138_T23LQF_20230819T181804.SAFE\MTD_MSIL2A.xml and also D:\S2A_MSIL2A_20230819T131251_N0509_R138_T23LQF_20230819T181804.SAFE\GRANULE\L2A_T23LQF_A042606_20230819T131247\MTD_TL.xml). Again, nothing is loaded.
  4. Tried to run. The only thing registered on log is the message below:

ERROR|2024-05-09T18:26:14.299|preprocess_products|perform_preprocess|573|unable to process files

I tried many things, but nothing works in L2A data.

I appreciate your help on this.

semiautomaticgit commented 6 months ago

Hello @claudioasn, the Image conversion tool requires that all the bands are in the same directory. You should move all the .jp2 files inside the same directory and rename the files with the band number in the ending of the name (e.g. from name_02_10m.jp2 to name_02.jp2) Then select this directory in Image conversion. Images are converted to reflectance.