[GRASS-SVN] r44703 - grass/branches/develbranch_6/imagery/i.modis.qc

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 23 19:55:38 EST 2010


Author: neteler
Date: 2010-12-23 16:55:38 -0800 (Thu, 23 Dec 2010)
New Revision: 44703

Added:
   grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1a.c
   grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1b.c
   grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1c.c
   grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1d.c
Modified:
   grass/branches/develbranch_6/imagery/i.modis.qc/description.html
   grass/branches/develbranch_6/imagery/i.modis.qc/main.c
Log:
MOD11A1 (LST daily) support added

Modified: grass/branches/develbranch_6/imagery/i.modis.qc/description.html
===================================================================
--- grass/branches/develbranch_6/imagery/i.modis.qc/description.html	2010-12-24 00:54:18 UTC (rev 44702)
+++ grass/branches/develbranch_6/imagery/i.modis.qc/description.html	2010-12-24 00:55:38 UTC (rev 44703)
@@ -75,6 +75,46 @@
 </ul>
 
 <pre>
+<EM>MOD11A1: Data Quality Flag bits=[2-3]</EM>
+</pre>
+<ul>
+ <li>[00]= class 0: Good data quality of L1B in bands 31 and 32</li>
+ <li>[01]= class 1: Other quality data</li>
+ <li>[10]= class 2: TBD</li>
+ <li>[11]= class 3: TBD</li>
+</ul>
+
+<pre>
+<EM>MOD11A1: Emis Error Flag bits=[4-5]</EM>
+</pre>
+<ul>
+ <li>[00]= class 0: Average emissivity error le 0.01</li>
+ <li>[01]= class 1: Average emissivity error le 0.02</li>
+ <li>[10]= class 2: Average emissivity error le 0.04</li>
+ <li>[11]= class 3: Average emissivity error gt 0.04</li>
+</ul>
+
+<pre>
+<EM>MOD11A1: LST Error Flag bits=[6-7]</EM>
+</pre>
+<ul>
+ <li>[00]= class 0: Average LST error le 1</li>
+ <li>[01]= class 1: Average LST error le 2</li>
+ <li>[10]= class 2: Average LST error le 3</li> 
+ <li>[11]= class 3: Average LST error gt 3</li>
+</ul>
+<pre>
+
+<EM>MOD11A2: Mandatory QA Flags bits=[0-1]</EM>
+</pre>
+<ul>
+ <li>[00]= class 0: LST produced, good quality, not necessary to examine more detailed QA</li>
+ <li>[01]= class 1: LST produced, other quality, recommend examination of more detailed QA</li>
+ <li>[10]= class 2: LST not produced due to cloud effects</li>
+ <li>[11]= class 3: LST not produced primarily due to reasons other than cloud</li>
+</ul>
+
+<pre>
 <EM>MOD11A2: Data Quality Flag bits=[2-3]</EM>
 </pre>
 <ul>
@@ -95,7 +135,7 @@
 </ul>
 
 <pre>
-<EM>MOD11A2: LST Error Flag bits=[4-5]</EM>
+<EM>MOD11A2: LST Error Flag bits=[6-7]</EM>
 </pre>
 <ul>
  <li>[00]= class 0: Average LST error le 1</li>

Modified: grass/branches/develbranch_6/imagery/i.modis.qc/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.modis.qc/main.c	2010-12-24 00:54:18 UTC (rev 44702)
+++ grass/branches/develbranch_6/imagery/i.modis.qc/main.c	2010-12-24 00:55:38 UTC (rev 44703)
@@ -48,6 +48,12 @@
 CELL mod09A1sj(CELL pixel);
 CELL mod09A1sk(CELL pixel);
 
+    /* MOD11A1 Products (1Km, daily) */ 
+CELL mod11A1a(CELL pixel);
+CELL mod11A1b(CELL pixel);
+CELL mod11A1c(CELL pixel);
+CELL mod11A1d(CELL pixel);
+
     /* MOD11A2 Products (1Km, 8-Days) */ 
 CELL mod11A2a(CELL pixel);
 CELL mod11A2b(CELL pixel);
@@ -94,6 +100,7 @@
     input->descriptions =_("mod09Q1;surf. refl. 250m 8-days;"
                             "mod09A1;surf. refl. 500m 8-days;"
                             "mod09A1s;surf. refl. 500m 8-days, State QA;"
+                            "mod11A1;LST 1Km daily (Day/Night);"
                             "mod11A2;LST 1Km 8-days (Day/Night);");
     input->answer = "mod09Q1";
 
@@ -108,6 +115,10 @@
                             "data_quality (mod09: Band-Wise Data Quality Flag); "
                             "diff_orbit_from_500m (mod09: 250m Band is at Different Orbit than 500m); "
                             "modland_qa_bits (mod09: MODIS Land General Quality Assessment); "
+                            "mandatory_qa (mod11A1: MODIS Land General Quality Assessment); "
+                            "data_quality_flag (mod11A1: Detailed Quality Indications); "
+                            "emis_error (mod11A1: Average Emissivity Error Classes); "
+                            "lst_error (mod11A1: Average LST Error Classes); "
                             "data_quality_flag (mod11A2: Detailed Quality Indications); "
                             "emis_error (mod11A2: Average Emissivity Error Classes); "
                             "mandatory_qa (mod11A2: MODIS Land General Quality Assessment); "
@@ -174,6 +185,12 @@
 	    G_fatal_error(_("mod09Q1 product only has 2 bands"));
     }
     
+    if ((!strcmp(qcflag, "mandatory_qa") && (strcmp(product, "mod11A1"))) ||
+        (!strcmp(qcflag, "data_quality_flag") && (strcmp(product, "mod11A1"))) ||
+        (!strcmp(qcflag, "emis_error") && (strcmp(product, "mod11A1"))) ||
+        (!strcmp(qcflag, "lst_error") && (strcmp(product, "mod11A1"))))
+        G_fatal_error(_("This flag is only available for MOD11A1 @ 1Km products"));
+
     if ((!strcmp(qcflag, "mandatory_qa") && (strcmp(product, "mod11A2"))) || 
 	(!strcmp(qcflag, "data_quality_flag") && (strcmp(product, "mod11A2"))) ||
 	(!strcmp(qcflag, "emis_error") && (strcmp(product, "mod11A2"))) ||
@@ -263,6 +280,21 @@
                 /*calculate different orbit from 500m flag  */ 
                     c = mod09Q1f(c);
             }
+            else if (!strcmp(product, "mod11A1"))
+            {
+                if (!strcmp(qcflag, "mandatory_qa"))
+                /*calculate mod11A1 mandatory qa flags  */
+                    c = mod11A1a(c);
+                if (!strcmp(qcflag, "data_quality_flag"))
+                /*calculate mod11A1 data quality flag  */
+                    c = mod11A1b(c);
+                if (!strcmp(qcflag, "emis_error"))
+                /*calculate mod11A1 emissivity error flag  */
+                    c = mod11A1c(c);
+                if (!strcmp(qcflag, "lst_error"))
+                /*calculate mod11A1 lst error flag  */
+                    c = mod11A1d(c);
+            }
             else if (!strcmp(product, "mod11A2"))
             {
                 if (!strcmp(qcflag, "mandatory_qa")) 

Added: grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1a.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1a.c	                        (rev 0)
+++ grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1a.c	2010-12-24 00:55:38 UTC (rev 44703)
@@ -0,0 +1,18 @@
+/* mod11A1 Mandatory QA Flags 1Km bits[0-1]
+ * 00 -> class 0: LST produced, good quality, not necessary to examine more detailed QA
+ * 01 -> class 1: LST produced, other quality, recommend examination of more detailed QA
+ * 10 -> class 2: LST not produced due to cloud effects
+ * 11 -> class 3: LST not produced primarily due to reasons other than cloud
+ */  
+
+#include <grass/gis.h>
+
+CELL mod11A1a (CELL pixel) 
+{
+    CELL qctemp;
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+


Property changes on: grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1a.c
___________________________________________________________________
Added: svn:eol-style
   + native

Added: grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1b.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1b.c	                        (rev 0)
+++ grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1b.c	2010-12-24 00:55:38 UTC (rev 44703)
@@ -0,0 +1,20 @@
+/* mod11A1 Data Quality Flag bits[2-3]
+ * 00 -> class 0: Good data quality of L1B in bands 31 and 32
+ * 01 -> class 1: Other quality data
+ * 10 -> class 2: TBD
+ * 11 -> class 3: TBD
+ */  
+
+#include <grass/gis.h>
+
+CELL mod11A1b(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 2;		/*bits [2-3] become [0-1] */
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+


Property changes on: grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1b.c
___________________________________________________________________
Added: svn:eol-style
   + native

Added: grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1c.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1c.c	                        (rev 0)
+++ grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1c.c	2010-12-24 00:55:38 UTC (rev 44703)
@@ -0,0 +1,20 @@
+/* mod11A1 Emis Error Flag bits[4-5]
+ * 00 -> class 0: Average emissivity error <= 0.01
+ * 01 -> class 1: Average emissivity error <= 0.02
+ * 10 -> class 2: Average emissivity error <= 0.04
+ * 11 -> class 3: Average emissivity error > 0.04
+ */  
+
+#include <grass/gis.h>
+
+CELL mod11A1c(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 4;		/*bits [4-5] become [0-1] */
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+


Property changes on: grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1c.c
___________________________________________________________________
Added: svn:eol-style
   + native

Added: grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1d.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1d.c	                        (rev 0)
+++ grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1d.c	2010-12-24 00:55:38 UTC (rev 44703)
@@ -0,0 +1,20 @@
+/* mod11A1 LST Error Flag bits[6-7]
+ * 00 -> class 0: Average LST error <= 1
+ * 01 -> class 1: Average LST error <= 2K
+ * 10 -> class 2: Average LST error <= 3K
+ * 11 -> class 3: Average LST error > 3K
+ */  
+
+#include <grass/gis.h>
+
+CELL mod11A1d(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 6;		/*bits [6-7] become [0-1] */
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+


Property changes on: grass/branches/develbranch_6/imagery/i.modis.qc/mod11A1d.c
___________________________________________________________________
Added: svn:eol-style
   + native



More information about the grass-commit mailing list