Hi,
I an trying get a subset of some data Sentinel-2 Level 1 and 2 using Python, but get this error:
org.esa.snap.core.gpf.OperatorException: gridWidth >= 2
This is my function to get subset:
def snap_get_subset(product_snap, wkt_ext):
SubsetOp = jpy.get_type('org.esa.snap.core.gpf.common.SubsetOp')
geom = WKTReader().read(wkt_ext)
op = SubsetOp()
op.setSourceProduct(product_snap)
op.setGeoRegion(geom)
try:
sub_product = op.getTargetProduct()
except Exception as errorp:
print(errorp)
return sub_product
name_file='S2A_MSIL1C_20220201T012901_N0400_R074_T54SUG_20220201T031559.zip'
wkt_ext='POLYGON ((139.86975641284016 37.4929791239449, 139.86975641284016 37.51435851605785, 139.84280695431656 37.51435851605785, 139.84280695431656 37.4929791239449, 139.86975641284016 37.4929791239449))'
snap_product = ProductIO.readProduct(namefile)
snap_get_subset(snap_product, wkt_ext)
I use this polygon(EPSG:4326) : wkt_ext=‘POLYGON ((139.86975641284016 37.4929791239449, 139.86975641284016 37.51435851605785, 139.84280695431656 37.51435851605785, 139.84280695431656 37.4929791239449, 139.86975641284016 37.4929791239449))’
The Sentinel-2 Data is (Command URL to download, replace user_name:passwd with your credentials):
curl -o S2A_MSIL1C_20220201T012901_N0400_R074_T54SUG_20220201T031559.zip -k -u “user_name:passwd” --limit-rate 30048k “https://catalogue.onda-dias.eu/dias-catalogue/Products(f0fdbba2-c6af-4bd7-a0cd-385bbe689c67)/$value”
curl -o S2A_MSIL2A_20220201T012901_N0400_R074_T54SUG_20220201T034937.zip -k -u “user_name:passwd” --limit-rate 30048k “https://catalogue.onda-dias.eu/dias-catalogue/Products(6b991993-b101-49f2-b8ae-cad6707a5cf0)/$value”
With other data sentinel-2 work fine, but with S2A_MSIL2A_20220201T012901_N0400_R074_T54SUG_20220201T034937.zip and S2A_MSIL1C_20220201T012901_N0400_R074_T54SUG_20220201T031559.zip not working.
Please, help me.