I have a 4 band composite image and a csv table consisting of regression coefficients. Each row in the table represents a regression specific to a day of year (doy). The 1st column in the table is doy and Band 2 of the composite is doy

What I would like to do is calculate a new band using the coefficients specific to the doy of each pixel.

The process should be something like this:

  1. Find doy value in pixel.
  2. Look-up the appropriate row in the coefficient table with matching pixel doy.
  3. Extract appropriate values from columns in coefficient table.
  4. Extract appropriate values from other bands in pixel.
  5. Plug values into equation to calculate new band.

The Equation can be something like:

Col2 + Col3*Band3 + Col6*Band3*Band1

How can I implement this in Google Earth Engine?

1 Answer 1


[Crossposted from GEE listserv]

I'm hoping this gets you most of the way. It's a simplified example, but you should be able to adapt it to your needs.


This example does the following:

  • Creates a dummy feature collection that has four records for DOYs 1-4 and two coefficients (B_0 and B_1) for each DOY.
  • Gets a sample image and creates a random DOY band (again 1-4) for each pixel
  • Creates two lookup tables (paired ee.Lists) that serve as input to the ee.Image.remap function
  • Creates two coefficient bands using the lookup between DOY and each of the two coefficients
  • Applies a sample expression using coefficient bands and the other bands in the image

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.