Mosaicing to NetCDF4-CF bug

This bug is in rather a niche use case but when using the “mosaicing” tool to mosaic some S2 tiles (T30VVH, T30VVH, T30VWH) and output as NetCDF4-CF it runs fine and completes but the created file is corrupted and cannot be opened.

The inputs have already been through S2_Resample (20m) and then C2RCC_MSI (C2X) and saved after this step before mosaic.

The glitch only occurs when the pixel size is reduced to 20m it will run and open at 100m pixel size (maybe something to do with the increased pixel count/file size?).

It runs just fine if you change the output format to BEAM.DIM but equally you can then open that file and then save again as NetCDF4-CF and it will open just fine.

Snap 7.0
OS Ubuntu 20.04.1 LTS

Below parameters fails as NetCDF4-CF works fine in other formats BEAM.DIM, HDF5

etcparameters_mosaic.txt (1.4 KB)

I just tried almost the same. I have not computed C2RCC and I did it on windows:
I just resampled the s2 tiles and mosaicked them.

These are the parameters I used.
mosaic_params.xml (3.2 KB)

So in general it should work.
Do you have installed the latest SNAP updates (Help / Check for Updates)?

Can you upload the log file after you created the failed netcdf-mosaic?
You can find it by selecting from the menu Help / Show Log Directory. Make sure to reproduce the error first and then attach the messages.log file.
Maybe there something is visible why it is not working.

Have you tried to open the netcdf file with some other application?
Maybe the problem is the reading and not the writing.

Hi Marpet,

Thanks for trying I have done it another twice with SNAP 7.0.4 everything up to date with no success.

I have tried opening the output in python using the standard netCDF4 library for which it says there is no reader available.

When creating the mosaic there are no errors (balloons or boxes) SNAP does not register any problem it completes just fine. Will it still log anything in the error logs?

Yes, there could be something in the logs, but usually there is also a message box or similar displayed.

I now also tried on Linux (Ubuntu 20.04) and I used C2RCC output for mosaicking. I worked again.
Sorry, I don’t know what’s going wrong at your side. Do you have the change to try a different system?

Thank for putting in the time marpet I wiped that instance made a new one with a fresh SNAP now no problems. :+1:t2:

1 Like