Error opening S2 image : IllegalArgumentException: dataType out of range!

Hi,

I have an issue opening some Sentinel 2 images with SNAP.
For example, using image S2A_OPER_MTD_SAFL1C_PDMC_20150908T220320_R108_V20150908T104427_20150908T104427
when loading band 2, I get the error below.
However, I can read/manipulate all granules without problem using Image Viewer or gdal.
I’m using SNAP 2.0.2 on scientific linux 7 (64 bits).

java.lang.IllegalArgumentException: dataType out of range!
at it.geosolutions.imageio.plugins.tiff.TIFFTag.getSizeOfType(TIFFTag.java:326)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFIFD.initialize(TIFFIFD.java:285)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageMetadata.initializeFromStream(TIFFImageMetadata.java:147)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(TIFFImageReader.java:851)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:805)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:763)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.getWidth(TIFFImageReader.java:1020)
at org.esa.s2tbx.dataio.jp2.internal.JP2TileOpImage$ImageReader.getImageWidth(JP2TileOpImage.java:238)
at org.esa.s2tbx.dataio.jp2.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:132)
at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.opimage.TranslateIntOpImage.getTile(TranslateIntOpImage.java:132)
at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2343)
at javax.media.jai.PlanarImage.copyExtendedData(PlanarImage.java:2398)
at javax.media.jai.PlanarImage.getExtendedData(PlanarImage.java:2459)
at com.sun.media.jai.opimage.MosaicOpImage.computeTile(MosaicOpImage.java:432)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.opimage.CropOpImage.getTile(CropOpImage.java:122)
at javax.media.jai.RenderedOp.getTile(RenderedOp.java:2257)
at org.esa.snap.core.datamodel.StxFactory.accumulateTile(StxFactory.java:339)
at org.esa.snap.core.datamodel.StxFactory.accumulate(StxFactory.java:323)
at org.esa.snap.core.datamodel.StxFactory.accumulate(StxFactory.java:296)
at org.esa.snap.core.datamodel.StxFactory.create(StxFactory.java:200)
at org.esa.snap.core.datamodel.StxFactory.create(StxFactory.java:274)
at org.esa.snap.core.datamodel.RasterDataNode.computeStxImpl(RasterDataNode.java:2427)
at org.esa.snap.core.datamodel.Band.computeStxImpl(Band.java:504)
at org.esa.snap.core.datamodel.RasterDataNode.getStx(RasterDataNode.java:2394)
at org.esa.snap.core.datamodel.RasterDataNode.createDefaultImageInfo(RasterDataNode.java:1802)
at org.esa.snap.core.datamodel.Band.createDefaultImageInfo(Band.java:483)
at org.esa.snap.core.datamodel.RasterDataNode.getImageInfo(RasterDataNode.java:1784)
at org.esa.snap.core.datamodel.RasterDataNode.getImageInfo(RasterDataNode.java:1767)
at org.esa.snap.core.image.ImageManager.prepareImageInfos(ImageManager.java:834)
at org.esa.snap.core.image.ColoredBandImageMultiLevelSource.create(ColoredBandImageMultiLevelSource.java:51)
at org.esa.snap.core.image.ColoredBandImageMultiLevelSource.create(ColoredBandImageMultiLevelSource.java:47)
at org.esa.snap.core.image.ColoredBandImageMultiLevelSource.create(ColoredBandImageMultiLevelSource.java:41)
at org.esa.snap.ui.product.ProductSceneImage.(ProductSceneImage.java:69)
at org.esa.snap.rcp.actions.window.OpenImageViewAction.createProductSceneImage(OpenImageViewAction.java:181)
at org.esa.snap.rcp.actions.window.OpenImageViewAction.access$000(OpenImageViewAction.java:61)
at org.esa.snap.rcp.actions.window.OpenImageViewAction$1.doInBackground(OpenImageViewAction.java:129)
at org.esa.snap.rcp.actions.window.OpenImageViewAction$1.doInBackground(OpenImageViewAction.java:124)
at com.bc.ceres.swing.progress.ProgressMonitorSwingWorker.doInBackground(ProgressMonitorSwingWorker.java:55)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused: java.util.concurrent.ExecutionException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at javax.swing.SwingWorker.get(SwingWorker.java:602)
[catch] at org.esa.snap.rcp.actions.window.OpenImageViewAction$1.done(OpenImageViewAction.java:143)
at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:832)
at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:842)
at javax.swing.Timer.fireActionPerformed(Timer.java:313)
at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Thanks,

Amaury

We opened an issue in JIRA: SIITBX-187 and we’ll have a look ASAP. Thanks for reporting.

Hello.

From the stacktrace, I can see you have tried to open an individual band file for a granule (the *_B02.jp2 file).
I have tried with a similar product (S2A_OPER_PRD_MSIL1C_PDMC_20150918T162109_R108_V20150918T105018_20150918T105018) with SNAP 2.0.2 and everything worked as expected. Could you please share the product causing the problem, or at least the jp2 file that caused the exception? I cannot found it using SciHub.

Hi,

By opening the granules individually, I was able to find the defective granule. You can download it here :
https://filesender.renater.fr/?s=download&token=c981f4d5-c249-189e-4681-b09153a69120

The file might be corrupted, but I couldn’t find any clear difference with the other granules. And the jp2 files can be opened without problem with an image viewer so I guess this must be an error in one of the other files, probably the .xml?

Cheers,
Amaury

Hello Amaury,

I note you are using data from the PDGS processing baseline 01.03.

S2A_OPER_MSI_L1C_TL_MTI__20150908T203133_A001106_T31TGN_N01.03

I would recommend that you do not use this data. This is an interim baseline that has been superseded by v02.01 data (available from the SciHub).

Cheers

Jan

S2 MPC Operations Manager

Hello Amaury.

The granule is not defective, I have managed to open its band rasters without problem. Here’s the version of the SNAP + S2TBX I’m using:

Could you please provide me with more info on what you have installed? Maybe other toolboxes?

Regards,

Cosmin.

Hi,

kraftek, here’s the details on my version of SNAP. I also have S1, S3 and RS toolboxes installed.

Jan, I am aware that these are not the operational data and have to be used to caution, but they are the only one available for the period I’m interested in. Do you know if these data will be reprocessed in the future?

Cheers,

Amaury