Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude Landsat 7 striping fix. #3

Open
clarype opened this issue May 1, 2024 · 2 comments
Open

Exclude Landsat 7 striping fix. #3

clarype opened this issue May 1, 2024 · 2 comments

Comments

@clarype
Copy link
Contributor

clarype commented May 1, 2024

I've noticed a potential issue with the method designed to remove striping from Landsat 7 images. It appears that the ee.Filter.gt('SCENE_CENTER_TIME', '2003-06-01T00:00') condition is preventing the function from returning an adjusted collection. The main concern is that SCENE_CENTER_TIME only provides the time of day without any year date information, making it inappropriate for filtering by specific dates.

Ideally, we'd like to preserve the earlier images from Landsat 7, before the onset of striping issues. However, I am currently unable to find a property that explicitly dates each image. The closest available identifier is the LANDSAT_PRODUCT_ID, which is a string. To extract the date from this ID, we would need to parse the string for each image which seems cumbersome in its implementation using inequities methods.

To the point, the easiest and fastest way would be to just exclude all of Landsat 7 by dropping the the 'ee.filter.and' and the 'ee.Filter.gt('SCENE_CENTER_TIME', '2003-06-01T00:00')'

From :
if 'slcOff' in self.exclude: if self.exclude['slcOff'] is True: collection = collection.filter(ee.Filter.And( ee.Filter.eq('SPACECRAFT_ID', 'LANDSAT_7'), ee.Filter.gt('SCENE_CENTER_TIME', '2003-06-01T00:00') ).Not())
To:
if 'slcOff' in self.exclude: if self.exclude['slcOff'] is True: collection = collection.filter(ee.Filter.eq('SPACECRAFT_ID', 'LANDSAT_7')).Not())

@jdbcode
Copy link
Member

jdbcode commented May 1, 2024

I think the logic is all fine. However, it looks like the value format for SCENE_CENTER_TIME has changed for Collection 2 e.g., '18:18:29.6640940Z' - it is no longer YYYY-MM-dd etc. I think if you filter on system:time_start it should work: ee.Filter.gt('system:time_start', 1054425600000)

Tested: https://code.earthengine.google.com/d44e507094ce05f3a7b1594cbf5c853b

@clarype
Copy link
Contributor Author

clarype commented May 1, 2024

Prefect! Thanks Jdbcode!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants