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

ImageCollection.containsBandNames: add argument to indicate the property that contains the band names #425

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fitoprincipe
Copy link
Member

@fitoprincipe fitoprincipe commented Jan 29, 2025

In some image collections the images contain all bands but some are completely masked out. In this case, using the band names is useless and mosaicking will not fail, but the user could still want to use valid bands and avoid the masked ones.

There are 2 changes:

  1. Use already computed system property system:band_names instead of computing it on the fly and storing in a property with random name.
  2. Allow the user to specify the name of the property that contains the band names.

@fitoprincipe fitoprincipe requested a review from 12rambau January 29, 2025 10:33
@12rambau
Copy link
Member

@fitoprincipe can you rebase your branch on current main I made a patch to avoid the service account issue generated from GEE latest update ?

@fitoprincipe
Copy link
Member Author

done

"""Filter the :py:class:`ee.ImageCollection` by band names using the provided filter.

Args:
bandNames: List of band names to filter.
filter: Type of filter to apply. To keep images that contains all the specified bands use ``"ALL"``. To get the images including at least one of the specified band use ``"ANY"``.
bandNamesProperty: the name of the property that contains the band names. Defaults to 'system:band_name' because GEE stores them there.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bandNamesProperty: the name of the property that contains the band names. Defaults to 'system:band_name' because GEE stores them there.
bandNamesProperty: the name of the property that contains the band names. Defaults to GEE native default: 'system:band_name'.

"""Filter the :py:class:`ee.ImageCollection` keeping only the images with all the provided bands.

Args:
bandNames: List of band names to filter.
bandNamesProperty: the name of the property that contains the band names. Defaults to 'system:band_name' because GEE stores them there.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bandNamesProperty: the name of the property that contains the band names. Defaults to 'system:band_name' because GEE stores them there.
bandNamesProperty: the name of the property that contains the band names. Defaults to GEE native default: 'system:band_name'.

"""Filter the :py:class:`ee.ImageCollection` keeping only the images with any of the provided bands.

Args:
bandNames: List of band names to filter.
bandNamesProperty: the name of the property that contains the band names. Defaults to 'system:band_name' because GEE stores them there.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bandNamesProperty: the name of the property that contains the band names. Defaults to 'system:band_name' because GEE stores them there.
bandNamesProperty: the name of the property that contains the band names. Defaults to GEE native default: 'system:band_name'.

Copy link
Member

@12rambau 12rambau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appart from the docstring wording the rest is perfect, thanks !

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

Successfully merging this pull request may close these issues.

2 participants