mcd43B2b.c 633 B

123456789101112131415161718192021222324252627
  1. /* mcd43B2 SDS Albedo Ancillary QA Land/Water Flags 1Km bits[4-7]
  2. * 0000 -> class 0: Shallow Ocean
  3. * 0001 -> class 1: Land (Nothing else but land)
  4. * 0010 -> class 2: Ocean and lake shorelines
  5. * 0011 -> class 3: Shallow inland water
  6. * 0100 -> class 4: Ephemeral water
  7. * 0101 -> class 5: Deep inland water
  8. * 0110 -> class 6: Moderate or continental ocean
  9. * 0111 -> class 7: Deep ocean
  10. * 1111 -> class 15: Fill Value
  11. * Classes 8-14: Not used
  12. */
  13. #include <grass/raster.h>
  14. CELL mcd43B2b (CELL pixel)
  15. {
  16. CELL qctemp;
  17. pixel >>= 4; /*bits [4-7] become [0-3] */
  18. qctemp = pixel & 0x0F;
  19. return qctemp;
  20. }