Error with view angle bands subsetting & resampling via GPT

The aim is to resample an S2 L2A data set and then to export a band subset, in this case the view angles. In the SNAP software this procedure works fine, since the bands “view_zenith_mean” and “view_azimuth_mean” are selectable in the Specify Product Subset dialog. However, when applying the generated xml graph read_res_subView_write.xml (2.2 KB) via GPT command line, I get the error message:

Error: [Node:Subset] Operator ‘SubsetOp’: Value for ‘Source Bands’ is invalid: ‘view_zenith_mean’

I found a GitHub entry by @marpet which I think is related to this (https://github.com/bcdev/s3tbx-c2rcc/issues/30), stating that the names of the view angles have changed in the newest SNAP version:
view_zenith -->view_zenith_mean
view_azimuth --> view_azimuth_mean

So I guess what happened is that this was not adapted in all tools? My workaround now is to change manually in the .xml file “view_zenith_mean” / “view_azimuth_mean” to “view_zenith” / “view_azimuth”. With this the program finishes, but I suggest this should be fixed.

Additionally, the generated output (view zenith & azimuth) don’t seem to be nearest neighbor resampled but bilinear resampled (or something similar). See the comparison of the SNAP view zenith output (left) and the GPT output (right) below. Put aside the fact that I want to use bilinear reampled view angles anyhow, it is irritating that the GPT output is ‘wrong’. Did I do something wrong / overlook something?

Thank you!
Sarah

I’m not sure what goes wrong here.
Actually the names are treated everywhere the same. So I don’t know why you get this error.
Maybe your SNAP installation is not clean or do you have two in parallel?
Regarding the resampling. Actually you can choose the type of resampling. And the default is Nearest Neighbour.
When I do the resampling in SNAP and gpt my result looks as follows:
The first is the original one (size 82x42), the one in the middle is resampled with SNAP and the last one was done with gpt.


As you see, all look similar. And nearest neighbour was used for resampling.

Dear Marco,
Following your suggestion, I uninstalled and re-installed SNAP, and now it works. The ‘view_zenith_mean’ error does not occur any more, and also the nearest neighbour resampling now works. Thanks for your help!