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

cfmask band will disappear, information migrated to pixel_qa band #68

Open
loicdtx opened this issue May 10, 2017 · 1 comment
Open

Comments

@loicdtx
Copy link
Owner

loicdtx commented May 10, 2017

Note from ESPA:

May 9, 2017 - Notice of Upcoming CFMask Discontinuation
Starting June 2, 2017, users will no longer be able to order CFMask processing for Landsat Collection 1 Higher-Level data products. Equivalent information is now available in the pixel_qa band, which is included with all Higher-Level products. For more information on the pixel_qa band, see the Product Characteristics sections of the Landsat 4-7 and Landsat 8 Surface Reflectance Product Guides.

L8 product guide
L4-7 product guide

TODO:

  • Add pixel_qa Bit Index table to processLandsat doc
  • Create well documented bitVectorToInt function
  • Choose sensible default values for processLandsat
  • Update tutorial to reflect these changes

Example of bitToInt function

def bit_pos_to_int(x):
    """Takes a list containing bit positions and returns the corresponding
    integer

    Args:
        x (list): A list of bit position (e.g.: [0,3] for 1001, aka 9)

    Return:
        The integer corresponding to the list of bit position provided in the
        list
    """
    bit_list = [0] * (max(x) + 1)
    for i in x:
        bit_list[i] = 1
    out = 0
    for bit in bit_list[::-1]:
        out = (out << 1) | bit
    return out
@loicdtx loicdtx changed the title cfmask band will disappea, information migrated to pixel_qa band cfmask band will disappear, information migrated to pixel_qa band May 10, 2017
@GreatEmerald
Copy link

On the it value conversion, for a related package I suggested making a function with human-interpretable parameters that define features (=bits) that must (TRUE), must not (FALSE) or may (NA) be present in the output file: JornDallinga/JornDallinga.github.io#3

So, for instance, to obtain Landsat 8 "Clear" values one could have:

GetLandsat8QCMask(fill=FALSE, clear=TRUE, water=FALSE, shadow=FALSE, snow=FALSE,
cloud=FALSE, occlusion=FALSE, cloud_confidence=c("Low", "Medium"), cirrus_confidence="Low")

And that would return integers 322 and 386. This makes it easy to, for instance, not to filter out water pixels (by using water=NA, in which case the function returns 4 integers).

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