NetCDF-problems

Hi,
I have tried for a while to write to a netcdf file. First a tried pconvert, but after looking into the forum I see that I should use gpt Write. Still, I don’t manage. I have tried the variant NetCDF4 and the NetCDF, and both CF and the BEAM.
I have the version 7 (it didn’t work with the previous version either) and I have reinstalled version 7 several times and tried to delete old files to inhibit some conflicts there.

I hope you could help, it would be great to have my files in netcdf instead of dim-files.

Best regards,
Anna B

gpt Write -f NetCDF-BEAM -t “D:\Temp\nc\C2RCC_idepix_S2B_MSIL1C_20181023T105109_N0206_R051_T32VPN_20181023T130438.nc” “D:\Temp\dim\C2RCC_idepix_S2B_MSIL1C_20181023T105109_N0206_R051_T32VPN_20181023T130438.dim”

SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.core.operators.CloudBufferOp$Spi:Idepix.Cloudbuffer conflicts with org.esa.s3tbx.idepix.operators.CloudBufferOp$Spi:Idepix.Cloudbuffer
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.core.operators.IdepixPostProcessingOp$Spi:Idepix.Postprocess conflicts with org.esa.s3tbx.idepix.operators.IdepixPostProcessingOp$Spi:Idepix.Postprocess
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.meris.IdepixMerisLandClassificationOp$Spi:Idepix.Meris.Land conflicts with org.esa.s3tbx.idepix.algorithms.meris.MerisLandClassificationOp$Spi:Idepix.Meris.Land
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.meris.IdepixMerisWaterClassificationOp$Spi:Idepix.Meris.Water conflicts with org.esa.s3tbx.idepix.algorithms.meris.MerisWaterClassificationOp$Spi:Idepix.Meris.Water
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.meris.IdepixMerisMergeLandWaterOp$Spi:Idepix.Meris.Merge.Landwater conflicts with org.esa.s3tbx.idepix.algorithms.meris.MerisMergeLandWaterOp$Spi:Idepix.Meris.Merge.Landwater
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.meris.IdepixMerisPostProcessOp$Spi:Idepix.Meris.Postprocess conflicts with org.esa.s3tbx.idepix.algorithms.meris.MerisPostProcessOp$Spi:Idepix.Meris.Postprocess
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.modis.IdepixModisClassificationOp$Spi:Idepix.Modis.Classification conflicts with org.esa.s3tbx.idepix.algorithms.modis.ModisClassificationOp$Spi:Idepix.Modis.Classification
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.modis.IdepixModisPostProcessOp$Spi:Idepix.Modis.Postprocess conflicts with org.esa.s3tbx.idepix.algorithms.modis.ModisPostProcessOp$Spi:Idepix.Modis.Postprocess
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.olci.IdepixOlciClassificationOp$Spi:Idepix.Olci.Classification conflicts with org.esa.s3tbx.idepix.algorithms.olci.OlciClassificationOp$Spi:Idepix.Olci.Classification
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.olci.IdepixOlciPostProcessOp$Spi:Idepix.Olci.Postprocess conflicts with org.esa.s3tbx.idepix.algorithms.olci.OlciPostProcessOp$Spi:Idepix.Olci.Postprocess
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.s2msi.operators.S2IdepixCloudBufferOp$Spi:Idepix.S2Cloudbuffer conflicts with org.esa.s2tbx.s2msi.idepix.operators.S2IdepixCloudBufferOp$Spi:Idepix.S2Cloudbuffer
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.seawifs.SeaWifsClassificationOp$Spi:Idepix.SeaWifs.Classification conflicts with org.esa.s3tbx.idepix.algorithms.seawifs.SeaWifsClassificationOp$Spi:Idepix.SeaWifs.Classification
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.seawifs.SeaWifsPostProcessOp$Spi:Idepix.Seawifs.Postprocess conflicts with org.esa.s3tbx.idepix.algorithms.seawifs.SeaWifsPostProcessOp$Spi:Idepix.Seawifs.Postprocess
INFO: org.esa.snap.python.gpf.PyOperatorSpi: Python operator ‘py_sambuca_snap_op’ registered (Python module: ‘sambuca_snap_op’, class: ‘sambuca_snap_op’, root: ‘C:\Users\ABL\AppData\Roaming\SNAP\modules\org-esa-sen2coral-sen2coral-inversion.jar’)
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.hsqldb.persist.Logger: dataFileCache open start
org.esa.snap.core.gpf.OperatorException: [output] is null
at org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(OperatorExecutor.java:376)
at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTileScheduler.java:1646)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:921)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:247)
at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)
Caused by: java.lang.IllegalArgumentException: [output] is null
at org.esa.snap.core.util.Guardian.assertNotNull(Guardian.java:67)
at org.esa.snap.core.dataio.AbstractProductWriter.writeProductNodes(AbstractProductWriter.java:103)
at org.esa.snap.core.gpf.common.WriteOp.doExecute(WriteOp.java:304)
at org.esa.snap.core.gpf.internal.OperatorContext.executeOperator(OperatorContext.java:1243)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:65)
at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
… 3 more

Error: [output] is null

So I tried the ProductIO.writeProduct from snappy in python to get my files into NetCDF and I got these error messages.
Could it be something with my Java?
I do manage to export it to NetCDF in the snap gui, though.

Anna B

INFO: org.esa.snap.python.gpf.PyOperatorSpi: Python operator ‘py_sambuca_snap_op’ registered (Python module: ‘sambuca_snap_op’, class: ‘sambuca_snap_op’, root: ‘C:\Users\ABL\AppData\Roaming\SNAP\modules\org-esa-sen2coral-sen2coral-inversion.jar’)
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.core.operators.CloudBufferOp$Spi:Idepix.Cloudbuffer conflicts with org.esa.s3tbx.idepix.operators.CloudBufferOp$Spi:Idepix.Cloudbuffer
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.core.operators.IdepixPostProcessingOp$Spi:Idepix.Postprocess conflicts with org.esa.s3tbx.idepix.operators.IdepixPostProcessingOp$Spi:Idepix.Postprocess
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.meris.IdepixMerisLandClassificationOp$Spi:Idepix.Meris.Land conflicts with org.esa.s3tbx.idepix.algorithms.meris.MerisLandClassificationOp$Spi:Idepix.Meris.Land
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.meris.IdepixMerisWaterClassificationOp$Spi:Idepix.Meris.Water conflicts with org.esa.s3tbx.idepix.algorithms.meris.MerisWaterClassificationOp$Spi:Idepix.Meris.Water
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.meris.IdepixMerisMergeLandWaterOp$Spi:Idepix.Meris.Merge.Landwater conflicts with org.esa.s3tbx.idepix.algorithms.meris.MerisMergeLandWaterOp$Spi:Idepix.Meris.Merge.Landwater
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.meris.IdepixMerisPostProcessOp$Spi:Idepix.Meris.Postprocess conflicts with org.esa.s3tbx.idepix.algorithms.meris.MerisPostProcessOp$Spi:Idepix.Meris.Postprocess
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.modis.IdepixModisClassificationOp$Spi:Idepix.Modis.Classification conflicts with org.esa.s3tbx.idepix.algorithms.modis.ModisClassificationOp$Spi:Idepix.Modis.Classification
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.modis.IdepixModisPostProcessOp$Spi:Idepix.Modis.Postprocess conflicts with org.esa.s3tbx.idepix.algorithms.modis.ModisPostProcessOp$Spi:Idepix.Modis.Postprocess
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.olci.IdepixOlciClassificationOp$Spi:Idepix.Olci.Classification conflicts with org.esa.s3tbx.idepix.algorithms.olci.OlciClassificationOp$Spi:Idepix.Olci.Classification
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.olci.IdepixOlciPostProcessOp$Spi:Idepix.Olci.Postprocess conflicts with org.esa.s3tbx.idepix.algorithms.olci.OlciPostProcessOp$Spi:Idepix.Olci.Postprocess
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.s2msi.operators.S2IdepixCloudBufferOp$Spi:Idepix.S2Cloudbuffer conflicts with org.esa.s2tbx.s2msi.idepix.operators.S2IdepixCloudBufferOp$Spi:Idepix.S2Cloudbuffer
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.seawifs.SeaWifsClassificationOp$Spi:Idepix.SeaWifs.Classification conflicts with org.esa.s3tbx.idepix.algorithms.seawifs.SeaWifsClassificationOp$Spi:Idepix.SeaWifs.Classification
SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.snap.idepix.seawifs.SeaWifsPostProcessOp$Spi:Idepix.Seawifs.Postprocess conflicts with org.esa.s3tbx.idepix.algorithms.seawifs.SeaWifsPostProcessOp$Spi:Idepix.Seawifs.Postprocess
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Reading…
INFO: org.hsqldb.persist.Logger: dataFileCache open start
Writing…
Traceback (most recent call last):
File “d:/Prosjekt/satelitt/Kopi_import_MERIS_ftp/testRun.py”, line 37, in
ProductIO.writeProduct(product, r’K:\Avdeling\214-Oseanografi\ABL\Prosjekt\Satelitt_O17277_SATINN_Mdir\Temp\nc\test.nc’, ‘NetCDF-BEAM’)
RuntimeError: java.lang.NullPointerException

There seems to be a problem with the Idepix installation. It looks like you have a Idepix for SNAP 6 and one for SNAP 7. But this is not causing the write problem.

The problem with the gpt call is that you use the Write operator directly. In this case the Write operator needs to be configured directly too.

It should work if you change your cmd call to:
gpt Write -PformatName=NetCDF-BEAM -Pfile=“D:\Temp\nc\C2RCC_idepix_S2B_MSIL1C_20181023T105109_N0206_R051_T32VPN_20181023T130438.nc” “D:\Temp\dim\C2RCC_idepix_S2B_MSIL1C_20181023T105109_N0206_R051_T32VPN_20181023T130438.dim”

Regarding the python problem, I don’t know. Could be that the product you want to write wasn’t read correctly. Maybe you can show your script?