I am working with Sentinel-2 data in GEE and I added NDVI and a specific SAVI as new bands to an Image. I had an error downloading 6 bands (RGBI, and VIs) because the data type is not the same:
Error: Exported bands must have compatible data types; found inconsistent types: UInt16 and Float32.
Then I selected only the VIs (because I have already downloaded the other bands) and the error is still there but with a new data type:
Error: Exported bands must have compatible data types; found inconsistent types: Float32 and Float64.
I used the normal difference function for NDVI and a edited operation for SAVI. After that I used a operator for NDVI as well (to have 'same' result type) but the error is the same.
Do you know how to manage it to obtain the same data format to export?
Code sample:
// Parameters for Vegetation Index (NDVI-SAVI).
var nir = scene.select('B8');
var red = scene.select('B4');
var L = 0.38
var L1 = 1.38
var ndviParams = {min: -1, max: 1, palette: ['red', 'yellow', 'green']};
//Calculating VIs
var ndvi = scene.normalizedDifference(['B8', 'B4']).rename('NDVI');
var savi = nir.subtract(red).divide(nir.add(red).add(L)).multiply(L1).rename('SAVI');
//Selecting to download
var download = ee.Image(sorted.first()).addBands(savi).addBands(ndvi).select(['B4', 'B3', 'B2','B8','NDVI','SAVI']);