mod09A1c.c 928 B

1234567891011121314151617181920212223242526272829
  1. /* Band-wise Data Quality 500m long Int
  2. * bits[2-5][6-9][10-13][14-17][18-21][22-25][26-29]
  3. * 0000 -> class 0: highest quality
  4. * 0111 -> class 1: noisy detector
  5. * 1000 -> class 2: dead detector; data interpolated in L1B
  6. * 1001 -> class 3: solar zenith >= 86 degrees
  7. * 1010 -> class 4: solar zenith >= 85 and < 86 degrees
  8. * 1011 -> class 5: missing input
  9. * 1100 -> class 6: internal constant used in place of climatological data for at least one atmospheric constant
  10. * 1101 -> class 7: correction out of bounds, pixel constrained to extreme allowable value
  11. * 1110 -> class 8: L1B data faulty
  12. * 1111 -> class 9: not processed due to deep ocean or cloud
  13. * Class 10-15: Combination of bits unused
  14. */
  15. #include <grass/raster.h>
  16. CELL mod09A1c(CELL pixel, int bandno)
  17. {
  18. CELL qctemp;
  19. pixel >>= 2 + (4 * (bandno - 1)); /* bitshift [] to [0-3] etc. */
  20. qctemp = pixel & 0x0F;
  21. return qctemp;
  22. }