S2 Resampling on a subset not supported?

I’m trying to minimize processing time / memory / disk requirements by working on a subset, but S2 Resampling Processor doesn’t seem to like subsets. Similar issue was noted among many things in this post: Resampling, mosaicing and subsetting workflow for Sentinel-2

Steps for testing:

  1. Open any S2 MSI2LA product (S2B_MSIL2A_20190403T095029_N0211_R079_T34VFH_20190403T124934)
  2. Open any band and zoom-in to any part of the image
  3. Raster -> Subset. Leave all parameters unchanged (it will use extent of displayed product view by default)
  4. Optical -> Geometric -> S2 Resampling processor. Choose subset from previous step as an input. Do not change any other parameters and just hit Run.

Expected outcome:
A resampled version of S2 data subset.

Actual outcome:
„Invalid S2 source product“ error.

SNAP 7.0.3 with all mask loading enabled in S2 tbx settings.
Product Version = SNAP (Build 201609300101)
Operating System = Linux version 4.18.0-13-generic running on amd64
Java; VM; Vendor = 1.8.0_202; Java HotSpot™ 64-Bit Server VM 25.202-b08; Oracle Corporation
Runtime = Java™ SE Runtime Environment 1.8.0_202-b08

Have you tried saving the output of the subset first? Mostly, the subset is simply a logical product but not saved.

No, saving does not help. I even tested saving in default format, closing SNAP and then opening just .dim file of subset product — same outcome.

No rush, as Biophysical processor also doesn’t like subsets (all output values are 0).

What do you mean by default format?

What else have you selected at first try?

Is there any chance this could be added to a future development list?

Being able to subset before using S2 Resampling is quite useful as it can be a very intensive on computer resources compared to the original multi-sensor Resampling (at 10m I have exceeded 100gb ram). However the S2 Resampling does better for S2 compared to the original hence its addition to SNAP.

Subsetting of multi-size S2 products is already supported since SNAP 7.0

Sorry subsetting works fine but you cannot resample using “S2 Resample” after subsetting an S2 image.

sorry, I misunderstood your point then.

When I make a subset and try to resample it, I get this error:

Is this your issue?

Yes, exactly this (as described in the first post of this thread).

yes that’s the one :slight_smile: .
Is this software issue ie that order of operation can be added at a later data or a technical issue that you can never perform these operations in this order?

I don’t know what’s the cause, but maybe this can be added as a ticket for the developers

It seems strange that one can’t subset the data before further processing like resampling and atmospheric correction. These are large datasets, where processing time would be improved by not having to use the whole dataset

In GPT is working, I am always subsetting before resampling using the “Resample” operator.

Are you referring to the “Resample” operator which works fine or the “S2Resamping” operator (much better results for S2) mentioned above?

Ana was most likely referring to the generic Resample operator.
The S2Resampling operator can indeed not resample subsetted products which would be a good feature what you have already said.

I’ve created an issue for this.