[GRASS-SVN] r70082 - grass/trunk/imagery/i.modis.qc

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 17 03:11:35 PST 2016


Author: ychemin
Date: 2016-12-17 03:11:35 -0800 (Sat, 17 Dec 2016)
New Revision: 70082

Added:
   grass/trunk/imagery/i.modis.qc/mod09GAa.c
   grass/trunk/imagery/i.modis.qc/mod09GAc.c
   grass/trunk/imagery/i.modis.qc/mod09GAd.c
   grass/trunk/imagery/i.modis.qc/mod09GAe.c
   grass/trunk/imagery/i.modis.qc/mod09GAsa.c
   grass/trunk/imagery/i.modis.qc/mod09GAsb.c
   grass/trunk/imagery/i.modis.qc/mod09GAsc.c
   grass/trunk/imagery/i.modis.qc/mod09GAsd.c
   grass/trunk/imagery/i.modis.qc/mod09GAse.c
   grass/trunk/imagery/i.modis.qc/mod09GAsf.c
   grass/trunk/imagery/i.modis.qc/mod09GAsg.c
   grass/trunk/imagery/i.modis.qc/mod09GAsh.c
   grass/trunk/imagery/i.modis.qc/mod09GAsi.c
   grass/trunk/imagery/i.modis.qc/mod09GAsj.c
   grass/trunk/imagery/i.modis.qc/mod09GAsk.c
Log:
Added mod09GA definitions

Added: grass/trunk/imagery/i.modis.qc/mod09GAa.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAa.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAa.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,22 @@
+/* MODLAND QA Bits 500m long int bits[0-1]
+ * 00 -> class 0: Corrected product produced at ideal quality -- all bands
+ * 01 -> class 1: Corrected product produced at less than idel quality -- some or all bands
+ * 10 -> class 2: Corrected product NOT produced due to cloud effect -- all bands
+ * 11 -> class 3: Corrected product NOT produced due to other reasons -- some or all bands mayb be fill value (Note that a value of [11] overrides a value of [01])
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAa(CELL pixel) 
+{
+    CELL qctemp;
+
+    /* Select bit 0 and 1 (right-side).
+     * hexadecimal "0x03" => binary "11" 
+     * this will set all other bits to null */
+    qctemp = pixel & 0x03;
+
+    return qctemp;
+}
+
+

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

Added: grass/trunk/imagery/i.modis.qc/mod09GAd.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAd.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAd.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* Atmospheric correction 500m long Int bit[30]
+ * 0 -> class 0: Not Corrected product
+ * 1 -> class 1: Corrected product
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAd(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 30;		/* bit no 30 becomes 0 */
+    qctemp = pixel & 0x01;    
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAe.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAe.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAe.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* Adjacency correction 500m long Int bit[31]
+ * 0 -> class 0: Not Corrected product
+ * 1 -> class 1: Corrected product
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAe(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 31;		/* bit no 31 becomes 0 */
+    qctemp = pixel & 0x01; 
+    
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsa.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsa.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsa.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,22 @@
+/* Cloud State unsigned int bits[0-1]
+ * 00 -> class 0: clear
+ * 01 -> class 1: cloudy
+ * 10 -> class 2: mixed
+ * 11 -> class 3: not set, assumed clear
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsa(CELL pixel) 
+{
+    CELL qctemp;
+
+    /* Select bit 0 and 1 (right-side).
+     * hexadecimal "0x03" => binary "11" 
+     * this will set all other bits to null */
+    qctemp = pixel & 0x03;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsb.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsb.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsb.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* cloud shadow unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsb(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 2;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsc.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsc.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsc.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,24 @@
+/* LAND/WATER FLAG unsigned int bits[3-5]
+ * 000 -> class 0: Shallow ocean
+ * 001 -> class 1: Land
+ * 010 -> class 2: Ocean coastlines and lake shorelines
+ * 011 -> class 3: Shallow inland water
+ * 100 -> class 4: Ephemeral water
+ * 101 -> class 5: Deep inland water
+ * 110 -> class 6: Continental/moderate ocean
+ * 111 -> class 7: Deep ocean
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsc(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 3;
+    qctemp = pixel & 0x07;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsd.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsd.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsd.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,20 @@
+/* AEROSOL QUANTITY unsigned int bits[6-7]
+ * 00 -> class 0: Climatology
+ * 01 -> class 1: Low
+ * 10 -> class 2: Average
+ * 11 -> class 3: High
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsd(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 6;
+    qctemp = pixel & 0x03;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAse.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAse.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAse.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,20 @@
+/* CIRRUS DETECTED unsigned int bits[8-9]
+ * 00 -> class 0: None
+ * 01 -> class 1: Small
+ * 10 -> class 2: Average
+ * 11 -> class 3: High
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAse(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 8;
+    qctemp = pixel & 0x03;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsf.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsf.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsf.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* Internal Cloud Algorithm Flag unsigned int bits[10]
+ * 0 -> class 0: No cloud 
+ * 1 -> class 1: Cloud
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsf(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 10;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsg.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsg.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsg.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* Internal Fire Algorithm Flag unsigned int bits[11]
+ * 0 -> class 0: No fire 
+ * 1 -> class 1: Fire
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsg(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 11;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsh.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsh.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsh.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* MOD35 snow/ice flag unsigned int bits [12]
+ * 0 -> class 0: No
+ * 1 -> class 1: Yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsh(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 12;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsi.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsi.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsi.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* Pixel adjacent to cloud unsigned int bits[13]
+ * 0 -> class 0: No
+ * 1 -> class 1: Yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsi(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 13;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsj.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsj.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsj.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* Salt pan unsigned int bits[14]
+ * 0 -> class 0: No
+ * 1 -> class 1: Yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsj(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 14;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09GAsk.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09GAsk.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09GAsk.c	2016-12-17 11:11:35 UTC (rev 70082)
@@ -0,0 +1,18 @@
+/* Internal Snow Mask unsigned int bits[15]
+ * 0 -> class 0: No snow
+ * 1 -> class 1: Snow
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09GAsk(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 15;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+



More information about the grass-commit mailing list