Corrija o seguinte erro no script do google earth engine: o Erro: Line 35: Required…
- User
Corrija o seguinte erro no script do google earth engine: o Erro:
Line 35: Required argument (kernel) missing to function: Image.reduceNeighborhood(image, reducer, kernel, inputWeight, skipMasked, optimization)
Applies the given reducer to the neighborhood around each pixel, as determined by the given kernel. If the reducer has a single input, it will be applied separately to each band of the collection; otherwise it must have the same number of inputs as the input image has bands. The reducer output names determine the names of the output bands: reducers with multiple inputs will use the output names directly, while reducers with a single input will prefix the output name with the input band name (e.g., '10_mean', '20_mean'). Reducers with weighted inputs can have the input weight based on the input mask, the kernel value, or the smaller of those two.
Args:
image (Image): The input image. reducer (Reducer): The reducer to apply to pixels within the neighborhood. kernel (Kernel): The kernel defining the neighborhood. inputWeight (String, optional): One of 'mask', 'kernel', or 'min'. skipMasked (Boolean, optional): Mask output pixels if the corresponding input pixel is masked. optimization (String, optional): Optimization strategy. Options are 'boxcar' and 'window'. The 'boxcar' method is a fast method for computing count, sum or mean. It requires a homogeneous kernel, a single-input reducer and either MASK, KERNEL or no weighting. The 'window' method uses a running window, and has the same requirements as 'boxcar', but can use any single input reducer. Both methods require considerable additional memory.
O script:
// Function to mask clouds using the quality band of Landsat 8. var maskL8 = function (image) { // Bit 0 - Fill // Bit 1 - Dilated Cloud // Bit 2 - Unused // Bit 3 - Cloud // Bit 4 - Cloud Shadow var qaMask = image.select('QA_PIXEL') //.eq(21824) .bitwiseAnd(parseInt('11111', 2)).eq(0); var saturationMask = image.select('QA_RADSAT').eq(0);
// Apply the scaling factors to the appropriate bands. var opticalBands = image.select('B.')//.multiply(0.0000275).add(-0.2); //var thermalBand = image.select('ST_B.*').multiply(0.00341802).add(149.0);
// Replace the original bands with the scaled ones and apply the masks. return image.addBands(opticalBands, null, true) //.addBands(thermalBand, null, true) .updateMask(qaMask) .updateMask(saturationMask); }
var kernel = ee.Kernel.square({ radius: 90, units: 'meters' });
var pansharpen1 = function(scene, kernel) { // Compute the per-pixel means of the unsharpened bands. var bgr = scene.select(['B7', 'B5', 'B4']); var pan = scene.select('B8'); var bgr_mean = bgr.reduce('mean').rename('mean'); // Compute the aggregate mean of the unsharpened bands and the pan band. var mean_values = pan.addBands(bgr_mean).reduceNeighborhood({ reducer: ee.Reducer.mean(), kernel: kernel, }); var gain = mean_values.select('mean_mean').divide(mean_values.select('B8_mean')); return bgr.divide(bgr_mean).multiply(pan).multiply(gain); };
- Assistant
- User
corrija o erro: sharp1: Layer error: reduce.median: Error in map(ID=null): Image.select: Band pattern 'B8' did not match any bands. Available bands: [B7, B5, B4]
- Assistant