Int to double change in output type


When we upgraded to SNAP 8, the output type of our processing changed from int to double. The operations we run are just Reproject and Subset. Is this expected?


Probably, yes.
I guess the output data format you are using is GeoTiff, right? As input, you use Sentinel-3, OLCI or SLSTR?

Have you changed the geo-coding setting for the data?

If you have switched to pixel-based geo-coding then the latitude/longitude bands are copied. These bands are of type double. You can exclude them in sour subset step.

If this is not the case, then let us know the data you are using, the output format and also the settings of your processing steps.

Just OLCI with geotiffs. We haven’t changed geocoding, and subsetting just the data bands does not help.

I just did the processing and the output type is float32.
Here shown in QGIS:

I have used this graph.
myGraph.xml (3.0 KB)

Now I notice that you say the data type was int before. I wonder how this could be. If you ould have used the spectral bands it should have always be float32. Only the quality_flags, detector_index and frame_offset bands could be written as int.

Here is the “graph.xml” that we use for Sentinel-3 processing.

<graph id="Graph">
  <node id="Read">
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
  <node id="Reproject">
      <sourceProduct refid="Read"/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
  <node id="Convert-Datatype">
      <sourceProduct refid="Reproject"/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
  <node id="Write">
      <sourceProduct refid="Convert-Datatype"/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
  <applicationData id="Presentation">
    <node id="Read">
      <displayPosition x="20.0" y="134.0"/>
    <node id="Reproject">
      <displayPosition x="201.0" y="110.0"/>
    <node id="Convert-Datatype">
      <displayPosition x="330.0" y="112.0"/>
    <node id="Write">
      <displayPosition x="512.0" y="99.0"/>

Okay, I found the reason for this.
After the Convert-Datatype operator, the product has on more band compared to SNAP7. It is the quality_flags band.
This was introduced by resolving this issue: [SNAP-1232] Masks not correctly copied by ProductUtils.copyProductNodes method

The Convert-Datatype operator uses the ProductUtils.copyProductNodes method. That’s why it was affected by this. And this is actually good.
This band caused the BIGGeoTiff writer to switch to double. The flag band unsigned int32 and to handle this data properly we had to use the double data type. Exact reasons I can’t remember anymore. And right now, I’m questioning this.

This means for your graph that you need to add a subset operator after the conversion operation to include only the bands you like to have.

With the graph attached you should get the expected results.
updatedGraph.xml (2.7 KB)

Btw., why do you use Bicubic resampling and the change the datatype to integer? It seems you don’t need the accuracy. You could switch to Nearest or Bilinear. This could save you processing time.

Thank you, this makes sense. You must have made the data type change because geotiffs cannot handle multiple datatypes in a single file.

Why do you think the accuracy of Bicubic resampling is not needed?

Also yes, it’s pretty strange to put quality flags into a floating-point band. But if you needed uint32, then all output band would need that type, which would blow up the file size. Other dataset providers usually create multiple QA bands in such cases.

I saw some reference to a new format that will replace BEAM soon. How can I monitor its progress? We need to rewrite our entire S3 pipeline anyway.

You can install an early alpha version as plugin.

There is also a github repoitory for the development: bcdev/snap-zarr: Prototype implementation of a SNAP reader/writer using Zarr for storing the data (
This will be moved to snap-engine when done.
This snap-zarr implementation makes use of:
bcdev/jzarr: A Java implementation of the API offered by the Python zarr package (
BEAM-DIMAP will be still supported for a while. The capability to read the data will not be disabled. Only the writing of new data, will be disabled at some point in time.

1 Like

Yes, zarr is a better solution. Do you happen to have an estimate when the plugin will be out of alpha?

It is planned to have a version ready for the next release. This shall be feature complete. This will not yet replace BEAM-DIMAP. This might happen in the version afterwards.
The next release is scheduled for some time at Mid 2021.