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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 27 02:27:53 PDT 2014


Author: ychemin
Date: 2014-08-27 02:27:52 -0700 (Wed, 27 Aug 2014)
New Revision: 61754

Added:
   grass/trunk/imagery/i.modis.qc/mod09CMGa.c
   grass/trunk/imagery/i.modis.qc/mod09CMGc.c
   grass/trunk/imagery/i.modis.qc/mod09CMGd.c
   grass/trunk/imagery/i.modis.qc/mod09CMGe.c
   grass/trunk/imagery/i.modis.qc/mod09CMGia.c
   grass/trunk/imagery/i.modis.qc/mod09CMGib.c
   grass/trunk/imagery/i.modis.qc/mod09CMGic.c
   grass/trunk/imagery/i.modis.qc/mod09CMGid.c
   grass/trunk/imagery/i.modis.qc/mod09CMGie.c
   grass/trunk/imagery/i.modis.qc/mod09CMGif.c
   grass/trunk/imagery/i.modis.qc/mod09CMGig.c
   grass/trunk/imagery/i.modis.qc/mod09CMGih.c
   grass/trunk/imagery/i.modis.qc/mod09CMGii.c
   grass/trunk/imagery/i.modis.qc/mod09CMGij.c
   grass/trunk/imagery/i.modis.qc/mod09CMGik.c
   grass/trunk/imagery/i.modis.qc/mod09CMGil.c
   grass/trunk/imagery/i.modis.qc/mod09CMGim.c
   grass/trunk/imagery/i.modis.qc/mod09CMGin.c
Log:
MYD09CMG/MOD09CMG Qa functions upload

Added: grass/trunk/imagery/i.modis.qc/mod09CMGa.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGa.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGa.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -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 mod09CMGa(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/mod09CMGc.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGc.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGc.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -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 mod09CMGc(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/mod09CMGd.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGd.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGd.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -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 mod09CMGd(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 30;		/* bit no 30 becomes 0 */
+    qctemp = pixel & 0x01;    
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGe.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGe.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGe.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -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 mod09CMGe(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 31;		/* bit no 31 becomes 0 */
+    qctemp = pixel & 0x01; 
+    
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGia.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGia.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGia.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,17 @@
+/* cloudy unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGia(CELL pixel) 
+{
+    CELL qctemp;
+
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGib.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGib.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGib.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* clear unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGib(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 1;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGic.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGic.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGic.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* high clouds unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGic(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 2;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGid.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGid.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGid.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* low clouds unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGid(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 3;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGie.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGie.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGie.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* snow unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGid(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 4;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGif.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGif.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGif.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* fire unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGif(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 5;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGig.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGig.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGig.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* sun glint unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGig(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 6;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGih.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGih.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGih.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* dust unsigned int bits[4]
+ * 00 -> class 0: no
+ * 01 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGih(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 7;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGii.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGii.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGii.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* cloud shadow unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09A1ii(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 8;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGij.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGij.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGij.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* pixel adjacent to cloud unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGij(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 9;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGik.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGik.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGik.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,20 @@
+/* cirrus unsigned int bits[4]
+ * 00 -> class 0: none
+ * 01 -> class 1: small
+ * 10 -> class 2: average
+ * 11 -> class 3: high
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGik(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 10;
+    qctemp = pixel & 0x03;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGil.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGil.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGil.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* pan flag unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGil(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 12;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGim.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGim.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGim.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/* criteria used for aerosol retrieval unsigned int bits[2]
+ * 0 -> class 0: criterion 1
+ * 1 -> class 1: criterion 2
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGim(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 13;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

Added: grass/trunk/imagery/i.modis.qc/mod09CMGin.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod09CMGin.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod09CMGin.c	2014-08-27 09:27:52 UTC (rev 61754)
@@ -0,0 +1,18 @@
+/*  AOT (aerosol optical thinkness) has climatological values unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGin(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 14;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+



More information about the grass-commit mailing list