Hi,
Conversion into NetCDF4-BEAM is very useful to save some memory when storing processed images.
I am able to convert (or export) into NetCDF4-BEAM or NetCDF4-CF from the snap gui.
I would like to do the same thing with gpt:
If I set oformat as NetCDF-CF or NetCDF-BEAM, it is working perfectly!
But, when oformat = NetCDF4-CF or NetCDF4-BEAM (enabling image compression), I do get img.nc, but it is unreadable:
ncdump -h img.nc
ncdump: img.nc: NetCDF: Unknown file format
Thanks for your reply.
After some tests on several machines, neither gdalinfo, ncinfo nor snap software can open the img.nc generated by gpt in netcdf4.
(img.nc generated via snap gui is all right)
It seems we found the issue and solved it. It will be deployed with the next SNAP update.
If bands already existed with the name ‘lat’ or ‘lon’ then the error happend.
So renaming those bands can help or excluding them by a subset after reprojection should help as a workaround.
Hi,
gpt is now producing the following error when asking for any NetCDF* format
(gpt Write -PformatName=NetCDF-CF -Pfile=$ofile -Ssource=$ifile):
org.esa.snap.core.gpf.OperatorException
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.NullPointerException
at org.esa.snap.dataio.netcdf.metadata.profiles.cf.CfGeocodingPart.encode(CfGeocodingPart.java:188)
at org.esa.snap.dataio.netcdf.NetCdfWriteProfile.writeProduct(NetCdfWriteProfile.java:52)
at org.esa.snap.dataio.netcdf.DefaultNetCdfWriter.writeProductNodesImpl(DefaultNetCdfWriter.java:62)
at org.esa.snap.core.dataio.AbstractProductWriter.writeProductNodes(AbstractProductWriter.java:109)
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: org.esa.snap.core.gpf.OperatorException
On the other hand, it is working perfectly for other formats (HDF5, GeoTIFF…)
Any idea?