Page 1 of 1

Problem with S2 subset

Posted: Wed May 26, 2021 12:10 pm
by xavi_s
Hello François,

I have tried to proces a SNAP subset following README file:

2.3.6 Subsetted products produced by SNAP

Level1_NETCDF can be used to read MERIS, OLCI or Sentinel2 products in
netCDF4 format, written by SNAP, in particular when used for subsetting.

I made the subset in SNAP with Raster>subset and export the subset in NetCDF4-BEAM, but I have problems with sensor detection, I used the following file names:
S2A_MSIL1C_20200609T105031_N0209_R051_T30TXK_20200609T112224.nc
Level1_NETCDF_S2A_MSIL1C_20200609T105031_N0209_R051_T30TXK_20200609T112224.nc
Level1_MSI_S2A_MSIL1C_20200609T105031_N0209_R051_T30TXK_20200609T112224.nc

Thanks

Re: Problem with S2 subset

Posted: Wed May 26, 2021 3:02 pm
by fsteinmetz
Hi,
Could you provide the error message and the script line where you are running the code ?
Thanks,
François

Re: Problem with S2 subset

Posted: Wed May 26, 2021 3:29 pm
by xavi_s
Yes.

(base) [root@localhost polymer-v4.13]# python polymer_cli.py /home/flexe/Escritorio/Combinada/Level1_MSI_S2A_MSIL1C_20200609T105031_N0209_R051_T30TXK_20200609T112224.nc S2A_MSI2A_20200609.nc
Traceback (most recent call last):
File "polymer_cli.py", line 34, in <module>
run_atm_corr(Level1(args.input_file, resolution='10'),
File "/home/flexe/Escritorio/Combinada/polymer-v4.13/polymer/level1.py", line 36, in __init__
self.autodetect()
File "/home/flexe/Escritorio/Combinada/polymer-v4.13/polymer/level1.py", line 61, in autodetect
raise Exception('Unable to detect sensor for file "{}"'.format(b))
Exception: Unable to detect sensor for file "Level1_MSI_S2A_MSIL1C_20200609T105031_N0209_R051_T30TXK_20200609T112224.nc"

Re: Problem with S2 subset

Posted: Tue Jun 01, 2021 1:26 pm
by fsteinmetz
Hi,
You should be able to read those files, but not with the command line interface because auto-detection is not implemented for those files. I'd recommend using the Leve1_NETCDF class in a python script like so (see example.py):

Code: Select all

run_atm_corr(Level1_NETCDF(<your netcdf file>), Level2_NETCDF())
I hope this helps,
Cheers,
François