浏览代码

Added mod13Q1 support

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68388 15284696-431f-4ddb-bdfa-cd5b030d7da7
Yann Chemin 9 年之前
父节点
当前提交
4a41e1c17d

文件差异内容过多而无法显示
+ 74 - 6
imagery/i.modis.qc/main.c


+ 18 - 0
imagery/i.modis.qc/mod13Q1a.c

@@ -0,0 +1,18 @@
+/* mod13Q1 Mandatory QA Flags 250m bits[0-1]
+ * 00 -> class 0: VI produced, good quality
+ * 01 -> class 1: VI produced, but check other QA
+ * 10 -> class 2: Pixel produced, but most probably cloud
+ * 11 -> class 3: Pixel not produced due to other reasons than clouds
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1a (CELL pixel) 
+{
+    CELL qctemp;
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+

+ 27 - 0
imagery/i.modis.qc/mod13Q1b.c

@@ -0,0 +1,27 @@
+/* mod13Q1 VI Usefulness Flag bits[2-5]
+ * 0000 -> class 0: Highest quality
+ * 0001 -> class 1: Lower quality
+ * 0010 -> class 2: Decreasing quality
+ * 0100 -> class 3: Decreasing quality
+ * 1000 -> class 4: Decreasing quality
+ * 1001 -> class 5: Decreasing quality
+ * 1010 -> class 6: Decreasing quality
+ * 1100 -> class 7: Lowest quality
+ * 1101 -> class 8: Quality so low that it is not useful
+ * 1110 -> class 9: L1B data faulty
+ * 1111 -> class 10: Not useful for any other reason/not processed
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1b(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 2;		/*bits [2-5] become [0-4] */
+    qctemp = pixel & 0x0F;
+    
+    return qctemp;
+}
+
+

+ 20 - 0
imagery/i.modis.qc/mod13Q1c.c

@@ -0,0 +1,20 @@
+/* mod13Q1 Aerosol quantity Flags 250m bits[6-7]
+ * 00 -> class 0: Climatology
+ * 01 -> class 1: Low
+ * 10 -> class 2: Average
+ * 11 -> class 3: High
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1c (CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 6;		/*bits [6-7] become [0-1] */
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+

+ 18 - 0
imagery/i.modis.qc/mod13Q1d.c

@@ -0,0 +1,18 @@
+/* mod13Q1 Adjacent cloud detected 250m bit[8]
+ * 00 -> class 0: No
+ * 01 -> class 1: Yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1d (CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 8;		/*bit [8] becomes [0] */
+    qctemp = pixel & 0x01;
+    
+    return qctemp;
+}
+
+

+ 18 - 0
imagery/i.modis.qc/mod13Q1e.c

@@ -0,0 +1,18 @@
+/* mod13Q1 Atmosphere BRDF correction performed 250m bit[9]
+ * 00 -> class 0: No
+ * 01 -> class 1: Yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1e (CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 9;		/*bit [9] becomes [0] */
+    qctemp = pixel & 0x01;
+    
+    return qctemp;
+}
+
+

+ 18 - 0
imagery/i.modis.qc/mod13Q1f.c

@@ -0,0 +1,18 @@
+/* mod13Q1 Mixed clouds 250m bit[10]
+ * 00 -> class 0: No
+ * 01 -> class 1: Yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1f (CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 10;		/*bit [10] becomes [0] */
+    qctemp = pixel & 0x01;
+    
+    return qctemp;
+}
+
+

+ 24 - 0
imagery/i.modis.qc/mod13Q1g.c

@@ -0,0 +1,24 @@
+/* mod13Q1 Land/Water Flags 250m bits[11-13]
+ * 000 -> class 0: Shallow Ocean
+ * 001 -> class 1: Land (Nothing else but 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: Moderate or continental ocean
+ * 111 -> class 7: Deep ocean
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1g (CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 11;		/*bits [11-13] become [0-2] */
+    qctemp = pixel & 0x07;
+    
+    return qctemp;
+}
+
+

+ 18 - 0
imagery/i.modis.qc/mod13Q1h.c

@@ -0,0 +1,18 @@
+/* mod13Q1 Possible Snow/Ice 250m bits[14]
+ * 0 -> class 0: No
+ * 1 -> class 1: Yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1h(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 14;		/*bit [14] becomes [0] */
+    qctemp = pixel & 0x01;
+    
+    return qctemp;
+}
+
+

+ 18 - 0
imagery/i.modis.qc/mod13Q1i.c

@@ -0,0 +1,18 @@
+/* mod13Q1 Possible Shadow 250m bits[15]
+ * 0 -> class 0: No
+ * 1 -> class 1: Yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod13Q1i (CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 15;		/*bit [15] becomes [0] */
+    qctemp = pixel & 0x01;
+    
+    return qctemp;
+}
+
+