[GRASS-SVN] r44891 - grass/trunk/imagery/i.modis.qc
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 5 17:33:51 EST 2011
Author: ychemin
Date: 2011-01-05 14:33:51 -0800 (Wed, 05 Jan 2011)
New Revision: 44891
Added:
grass/trunk/imagery/i.modis.qc/mcd43B2a.c
grass/trunk/imagery/i.modis.qc/mcd43B2b.c
grass/trunk/imagery/i.modis.qc/mcd43B2c.c
grass/trunk/imagery/i.modis.qc/mcd43B2qa.c
Log:
added missing mcd43B2 functions
Added: grass/trunk/imagery/i.modis.qc/mcd43B2a.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mcd43B2a.c (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mcd43B2a.c 2011-01-05 22:33:51 UTC (rev 44891)
@@ -0,0 +1,20 @@
+/* mcd43B2 SDS Albedo Ancillary QA Flags 1Km bits[0-3]
+ * 0000 -> class 0: Satellite Platform: Terra
+ * 0001 -> class 1: Satellite Platform: Terrra/Aqua
+ * 0010 -> class 2: Satellite Platform: Aqua
+ * 1111 -> class 15: Fill Value
+ * Classes 3-14: Not used
+ */
+
+#include <grass/raster.h>
+
+CELL mcd43B2a (CELL pixel)
+{
+ CELL qctemp;
+
+ qctemp = pixel & 0x0F;
+
+ return qctemp;
+}
+
+
Added: grass/trunk/imagery/i.modis.qc/mcd43B2b.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mcd43B2b.c (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mcd43B2b.c 2011-01-05 22:33:51 UTC (rev 44891)
@@ -0,0 +1,26 @@
+/* mcd43B2 SDS Albedo Ancillary QA Land/Water Flags 1Km bits[4-7]
+ * 0000 -> class 0: Shallow Ocean
+ * 0001 -> class 1: Land (Nothing else but land)
+ * 0010 -> class 2: Ocean and lake shorelines
+ * 0011 -> class 3: Shallow inland water
+ * 0100 -> class 4: Ephemeral water
+ * 0101 -> class 5: Deep inland water
+ * 0110 -> class 6: Moderate or continental ocean
+ * 0111 -> class 7: Deep ocean
+ * 1111 -> class 15: Fill Value
+ * Classes 8-14: Not used
+ */
+
+#include <grass/raster.h>
+
+CELL mcd43B2b (CELL pixel)
+{
+ CELL qctemp;
+
+ pixel >>= 4; /*bits [4-7] become [0-3] */
+ qctemp = pixel & 0x0F;
+
+ return qctemp;
+}
+
+
Added: grass/trunk/imagery/i.modis.qc/mcd43B2c.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mcd43B2c.c (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mcd43B2c.c 2011-01-05 22:33:51 UTC (rev 44891)
@@ -0,0 +1,17 @@
+/* mcd43B2 SDS Albedo Ancillary QA Sun Zenith Angle at local solar noon bits[8-14]
+ Returns integer value [0-90], 127 is Fill Value
+ */
+
+#include <grass/raster.h>
+
+CELL mcd43B2c (CELL pixel)
+{
+ CELL qctemp;
+
+ pixel >>= 8; /*bits [8-14] become [0-7] */
+ qctemp = pixel & 0x7F;
+
+ return qctemp;
+}
+
+
Added: grass/trunk/imagery/i.modis.qc/mcd43B2qa.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mcd43B2qa.c (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mcd43B2qa.c 2011-01-05 22:33:51 UTC (rev 44891)
@@ -0,0 +1,25 @@
+/* Band-wise Albedo Quality Data 1Km long Int
+ * SDS: BRDF_Albedo_Band_Quality
+ * bits[0-3][4-7][8-11][12-15][16-19][20-23][24-27]
+ * 0000 -> class 0: best quality, 75% or more with best full inversions
+ * 0001 -> class 1: good quality, 75% or more with full inversions
+ * 0010 -> class 2: Mixed, 50% or less full inversions and 25% or less fill values
+ * 0011 -> class 3: All magnitude inversions or 50% or less fill values
+ * 0100 -> class 4: 75% or more fill values
+ * Classes 5-14: Not Used
+ * 1111 -> class 15: Fill Value
+ */
+
+#include <grass/raster.h>
+
+CELL mcd43B2qa(CELL pixel, int bandno)
+{
+ CELL qctemp;
+
+ pixel >>= 4 * (bandno - 1); /* bitshift [] to [0-3] etc. */
+ qctemp = pixel & 0x0F;
+
+ return qctemp;
+}
+
+
More information about the grass-commit
mailing list