r-earthengine / ee_extra

A ninja python package that unifies the Google Earth Engine ecosystem.
https://ee-extra.readthedocs.io/
Other
58 stars 10 forks source link

Tasseled Cap Transformations #5

Closed aazuspan closed 2 years ago

aazuspan commented 2 years ago

See the original feature request on eemont.

This would add an ee_extra.Transformations module with a tasseledCap function to calculate tasseled cap brightness, wetness, and greenness bands from an input ee.Image from the MODIS, Landsat 5/7/8, or Sentinel-2 platforms.

A couple design questions:

Feel free to assign me, thanks!

davemlz commented 2 years ago

Awesome to see you here, @aazuspan! :confetti_ball:

I was thinking. We have a Spectral module here in eeExtra related to the spectral indices computation (ee_extra.Spectral). If you want, you can add it there :)

Regarding the design questions:

  1. Yes, adding them to the original image is nice since users won't need to deal with a lot of variables :)
  2. I think that they meant TOA when the said "at-sensor", but I could be wrong, I just checked the paper and they say that they computed reflectance according to this USGS page, and it is the TOA reflectance. I know that it shouldn't vary too much if we allow people to use Surface Reflectance, but we have no reference for that :( so I think it is better if we are strict here :)

I'll assign you this Issue then, @aazuspan! If you need something, please let us know! :) :rocket:

aazuspan commented 2 years ago

Adding tasseledCap to the Spectral module makes sense to me!

I'm not super familiar with the different levels of Landsat processing, but I did see that the GEE catalog describes the Landsat raw datasets as at-sensor

Landsat 8 Collection 1 Tier 1 OLI DN values, representing scaled, calibrated at-sensor radiance.

I'll do a little more research and also see if I can track down coefficients for surface reflectance data :)

Thanks @davemlz!

davemlz commented 2 years ago

I found this example in the EE Guide that uses TOA but for L5. But for L8 I'm not sure. I have never used tasseled cap xD I would say that if in the paper they say that they used DN, let's use the RAW values, and if they say that they used Reflectance, let's use the TOA values (unless SR is explicitly mentioned) :)

If you find references, it would be nice to add them to the docstrings! :rocket: Here an example:

def tasseledCap(x: Union[ee.Image, ee.ImageCollection]) -> Union[ee.Image, ee.ImageCollection]:
    """Computes the Tasseled Cap Transformation [1]_.

    Args:
        x : Image or Image Collection, etc.

    Returns:
        Image or Image Collection, etc.

    References:
        .. [1] `Doe, John. 2021. Tasseled Cap Transformations, etc. <https://link.com/>`_
    """
    return None

If you have troubles or questions, let us know! :)

Thank you, @aazuspan!

aazuspan commented 2 years ago

Sounds like a good plan, thanks for looking into it! :)