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

Bits to band #427

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

Bits to band #427

wants to merge 4 commits into from

Conversation

fitoprincipe
Copy link
Member

A simplified version of the old "BitsReader".

The main idea is to be able to decode the bit bands using the same information as provided by GEE in the dataset's description, like the QA_PIXEL bands here. The only work the user needs to do is convert this:

Bit 3: Cloud
Bit 4: Cloud Shadow
Bit 5: Snow
Bit 6: Clear
  0: Cloud or Dilated Cloud bits are set
  1: Cloud and Dilated Cloud bits are not set
Bit 7: Water
Bits 8-9: Cloud Confidence
  0: None
  1: Low
  2: Medium
  3: High
Bits 10-11: Cloud Shadow Confidence
  0: None
  1: Low
  2: Medium
  3: High

to this

{
  "3": "Cloud",
  "4": "Cloud Shadow",
  "5": "Snow",  
  "7": "Water",
  "8-9": {
    "1": "Clouds Low Prob"
    "2": "Clouds Medium Prob"
    "3": "Clouds High Prob"
  },
  "10-11":  {
    "1": "Shadow Low Prob",
    "2": "Shadow Medium Prob",
    "3": "Shadow High Prob"
  }
}

It doesn't need to contain all classes but just the needed ones.

@fitoprincipe fitoprincipe requested a review from 12rambau February 6, 2025 18:20
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