Syntax error in metadata with sen2cor v02.12.03 with product version 15.0

Hello,

I am running into an error when processing product version 15.0 Sentinel-2 L1C data with sen2cor v.02.12.03. I have tested this with data from different dates before and after 23rd of July, to see if same error happens with previous product version and confirmed that it only happens with product version 15.0 and not 14.9. I tried processing both for 60m only and for all but same error happened in both cases. See below the error message,

...
Progress[%]: 93.46 : PID-1730976, L2A_Tables: band WVP exported, elapsed time[s]: 0.064, total: 0:01:57.800643
Progress[%]: 93.54 : PID-1730976, L2A_Tables: band PVI exported, elapsed time[s]: 0.099, total: 0:01:57.900077
Progress[%]: 93.76 : PID-1730976, L2A_Tables: band TCI exported, elapsed time[s]: 0.276, total: 0:01:58.175628
Progress[%]: 93.76 : PID-1730976, L2A_Tables: stop export, elapsed time[s]: 0.001, total: 0:01:58.176812
Syntax error in metadata, see report file for details.
Schema file: S2-PDGS-CS-DI-PSD-V15.0_Schema/S2_PDI_Level-2A_Tile_Metadata.xsd
Details: Element 'PVI_FILENAME': [facet 'pattern'] The value 'GRANULE/L2A_T34WDU_A047481_20240725T104023/QI_DATA/T34WDU_20240725T104021_PVI.tif' is not accepted by the pattern 'GRANULE/L2A_T[\w{Lu}_]{5}_A\d{6}_\d{8}T\d{6}/QI_DATA/T[\w{Lu}_]{5}_\d{8}T\d{6}_PVI.jp2'.
Progress[%]: 100.00 : Application terminated successfully.

Has anyone encountered the same problem? I saw some posts about “PVI.jp2 issues” but they are from few years ago and older versions and were fixed with sen2cor/product version updates. So I wanted to check if this is a me problem or a general issue to be addressed?

Best,
Burak.

Dear @ebursim,

The “Syntax error in metadata” message you encountered when processing product version 15.0 Sentinel-2 L1C data with sen2cor v.02.12.03 is likely due to the product format conformity check at the end of the processing.

According to the official Product Specification Document (PSD) 15.0, the PVI shall be in jp2 format, as the ones generated by the Production Services. However with the --tif option you seem to be using, this .jp2 format is not fulfilled for the PVI.

From your log, it seems the application terminated successfully, meaning there are no other issues with the L2A product you generated. The only issue is that its format is not fully compliant with the official PSD 15.0.

In summary, your processing was successful, despite the format discrepancy.

In a future version of Sen2Cor Toolbox, we plan to relax this filenaming requirement by replacing ‘PVI.jp2’ with ‘PVI.*’ in both item2A.xsd files, as described below.

In the meantime, if you would like to suppress this error message, you can manually adjust the filenaming rules in the following PSD files:

  • ./sen2cor/cfg/S2-PDGS-CS-DI-PSD-V15.0_Schema/DICO/EUP-V15/DataAccess/item/item2A.xsd:
    <xs:pattern value=“GRANULE/L2A_T[\w{Lu}]{5}A\d{6}\d{8}T\d{6}/QI_DATA/T[\w{Lu}]{5}\d{8}T\d{6}PVI.jp2"/> with
    <xs:pattern value="GRANULE/L2A_T[\w{Lu}
    ]{5}A\d{6}\d{8}T\d{6}/QI_DATA/T[\w{Lu}
    ]{5}_\d{8}T\d{6}_PVI.*”/>

  • ./sen2cor/cfg/S2-PDGS-CS-DI-PSD-V15.0_Schema/DICO/PDI-V15/DataAccess/item/item2A.xsd:
    <xs:pattern value=“GRANULE/L2A_T[\w{Lu}]{5}A\d{6}\d{8}T\d{6}/QI_DATA/T[\w{Lu} ]{5}\d{8}T\d{6}PVI.jp2”/> with
    <xs:pattern value="GRANULE/L2A_T[\w{Lu}
    ]{5}A\d{6}\d{8}T\d{6}/QI_DATA/T[\w{Lu}
    ]{5}_\d{8}T\d{6}_PVI.*"/>

We hope this clarifies your issue.

Cheers,
@Sen2cor_dev_team

Hi,

Thank you for quick and clear response!

So there is no issue with processing except some format discrepancy. That is fine for my purpose.

For the sake of suppressing the error message, I wanted to implement the change you mentioned but I cannot seem to find the Schema files where I can change the pattern. There is only the L2A_GIPP.xml file in the cfg folder.

I tried to find the schema files but I could not, am I missing something here?

Burak.

Best,
Burak.

Dear @ebursim,

The Schema files are located in the $SEN2COR_BIN (installation directory), e.g.

  • Windows:
    Sen2Cor-02.12.03-win64\Lib\site-packages\sen2cor\cfg\S2-PDGS-CS-DI-PSD-V15.0_Schema
  • Linux:
    Sen2Cor-02.12.03-Linux64/lib/python2.7/site-packages/sen2cor/cfg/S2-PDGS-CS-DI-PSD-V15.0_Schema

Cheers,
@Sen2cor_dev_team

Hi,

I have changed the line as you suggested in the file:

‘/sen2cor/cfg/S2-PDGS-CS-DI-PSD-V15.0_Schema/DICO/EUP-V15/DataAccess/item/item2A.xsd’

But there is no S2-PDGS-TAS-DI-PSD-V15.0_Schema folder, the S2-PDGS-TAS*Schema folders are only up to V14.9 but not the V15.0.

I still get the same error I reported in the first place. Do you have an idea why I might be missing the TAS Schema files for version 15.0?

Burak.

Dear @ebursim,

Sorry there was a typo in our first answer (that we edited by the way). The parent folder should also be S2-PDGS-CS for PDI-V15:

  • ./sen2cor/cfg/S2-PDGS-CS-DI-PSD-V15.0_Schema/DICO/PDI-V15/DataAccess/item/item2A.xsd:

Cheers,
@Sen2cor_dev_team

Thank you for your help!

Best,
Burak.