davemlz / eemont

A python package that extends Google Earth Engine.
https://eemont.readthedocs.io/
MIT License
417 stars 69 forks source link

.preprocess() failed for the new COPERNICUS/S2_SR_HARMONIZED #82

Open Daniel-Trung-Nguyen opened 1 year ago

Daniel-Trung-Nguyen commented 1 year ago

Hi, GEE recently recommended switching to COPERNICUS/S2_HARMONIZED and COPERNICUS/S2_SR_HARMONIZED. I am not sure if the .preprocess() supports COPERNICUS/S2_SR_HARMONIZED natively, but I ran into errors running .preprocess() on the S2_SR_HARMONIZED image collection image

Thanks, Daniel

adguerou commented 1 year ago

Hi @Daniel-Trung-Nguyen, I just bumped onto the same issue. What I figured out so far is that the issue is coming from the underlying method .maskClouds() of the .preprocess() method.

Code below raises the same error than you showed except if one removes .maskClouds()

s2_prep_detailed = ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED') \ .filterDate('2022-08-01', '2022-08-31') \ .filterBounds(ee.Geometry.Point([-74.0592,11.3172])) \ .scaleAndOffset() .maskClouds()

I though it was due to missing masks in some products (https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S2_SR_HARMONIZED#bands), but this is also the case in the COPERNICUS/S2_SR products.

@davemlz, any idea where it could bug? Any advice also on applying the .scaleAndOffset() method on S2_SR_HARMONIZED dataset for which some range values have been shifted by 1000?

Thanks, Adrien

asaph-marvin commented 1 year ago

any updates? I'm also experiencing this exact issue, would love to get some help

philament commented 1 year ago

Same issue here. My code using scaleAndOffset() and masClouds() works great for COPERNICUS/S2_SR but throws the error shown above when switching to COPERNICUS/S2_SR_HARMONIZED.

lukegre commented 5 months ago

Having the same issue. The issue lies with ee_extra. I've created a pull request to fix this issue.