I am trying to normalize the values in each band across images in the imageCollection I have filtered.

I tried running this here

var normalized_collection = l1c_collection
  .filterDate(start_scene1, end_scene1)
  .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 5))
    var normalized_image = ee.ImageCollection.fromImages(
         name = ee.String(name);
         var band = my_image.select(name);
         return band.expression(
           '(x * slope) + intercept', {
             'x': band,
             'slope': 0.0342,
             'intercept': 0.6494});
       return normalized_image;

However, the process returned an Error: User memory limit exceeded.

Is there a workaround to this?

1 Answer 1


There is no real need to first map across images, then across bands. Doing so can result in a large computational load on one node at Google Earth Engine's server-side.

It is better to use inbuilt functions which are innately parallelized on the server-side. In your case, you can use .multiply() and .add() since the slopes and intercepts are constant across images and bands.

This will look like the following:

var slope = 0.0342;
var intercept = 0.6494;
var normalized_collection = l1c_collection
  .filterDate(start_scene1, end_scene1)
  .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 5))
    return image.multiply(slope).add(intercept).copyProperties(image)

The above code does not run into memory errors.

Link to complete code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.