Sen2Cor BOA correction in CMD for many scenes - problem

Hello,

I need help with SNAP, and basically with the Sen2Cor plug (v.2.8)

I need to do BOA correction for Sentinel-2 data from level 1C to 2A

I read that it is impossible to use Sen2Cor in SNAP in Graph builder to do it in Batch process for many scenes simultaneously,

You have to use Sen2Cor in the command-line interpreter (eg cmd in windows). Only then can you make corrections for all scenes in the directory.
Sen2Cor works for single scenes, no problem with this in my computer.

but it doesn’t work for many scenes, here comes my problem.
I’m using “for / d% i in (*) for L2A_Process.bat% i”

I have the data in a simple path, i.e. C: \ snap \ S2A_MSIL1C_20170531T100031_N0205_R122_T33TTG_20170531T100536.SAFE
but I get a message that “Product metadata file cannot be read”

please help, where could the problem be, any suggestions?

and I have a question, using Sen2Cor in SNAP, you can do correction for all resolutions simultaneously by selecting the Resolution: ALL option
From what I read, using Sen2Cor in CMD, I can only make corrections for one resolution at a time. It is suggested that you do for 60 first, then 20 and 10m. Is it true? Can’t you do it for everyone at once?

could it be that another file or folder (not ending with .SAFE) is in this directory which causes the error?

Try FORCE

Hi.

thanks for your interest and suggestions.

I had to search a little deeper on the net, and found a solution. There was some error in my formula,

correct is “for /d %s in (\S2A_MSIL1C *) do L2A_Process.bat %s”

it is important to use ‘%s’ and spaces accordingly. I had used “%i” before, I found that example from someone but i also found “%f”. I don’t know where the difference comes from. Important that with “%s” it works.

And in order to do for all the scenes in the directory without having to enter the file names you have to use “" at the end of the name "S2A_MSIL1C

I have a question, using Sen2Cor in SNAP, you can do correction for all resolutions simultaneously by selecting the Resolution: ALL option

Using Sen2Cor in CMD, I can only make corrections for one resolution at a time. It is suggested to do for 60m first, then 20m and 10m. Is it true?
If I do “–resolution=10”, will the correction be for all bands and resampling to 10m immediately?
Will the correction be performed only for 10m bands and the rest of the bands will be without correction?

Thanks for the help

according to my understanding, adding no resolution in the command will process all three levels:

adding no resolution will leave the bands resolution after correction as it was in level1C?

So setting --resolution = 10 will do correction and resampling to 10m of all bands?

all except for B10, I’d say

why except for band No. 10?

B1 B9 B10 have the same 60 m spatial resolution

Band 10 is used for Cirrus Correction and can therefore not be converted:

It’s explained in the sen2cor manual: https://step.esa.int/thirdparties/sen2cor/2.5.5/docs/S2-PDGS-MPC-L2A-SUM-V2.5.5_V2.pdf

OK thanks,

the last question,
it is better / more correct to:

  • do resampling at BOA stage, and then create indicators when all bands have the same resolution?
  • or in BOA stage leave the native resolution of bands, and do resampling at the stage of creating the indicator?

as the indicators probably use bands of different resolutions, it makes sense to me to resample before creating the indices

OK thanks

I decided to work on unchanged bands resolutions after correction
because I work only on vegetation indicators

thanks for your help and explanations