Problem with S2 subset

Post Reply
xavi_s
Posts: 7
Joined: Tue Feb 23, 2021 11:57 am
company / institution: Universitat de València
Location: Paterna

Problem with S2 subset

Post 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
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Problem with S2 subset

Post by fsteinmetz »

Hi,
Could you provide the error message and the script line where you are running the code ?
Thanks,
François
xavi_s
Posts: 7
Joined: Tue Feb 23, 2021 11:57 am
company / institution: Universitat de València
Location: Paterna

Re: Problem with S2 subset

Post 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"
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Problem with S2 subset

Post 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
Post Reply