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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 23 19:54:18 EST 2010


Author: neteler
Date: 2010-12-23 16:54:18 -0800 (Thu, 23 Dec 2010)
New Revision: 44702

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

Modified: grass/trunk/imagery/i.modis.qc/i.modis.qc.html
===================================================================
--- grass/trunk/imagery/i.modis.qc/i.modis.qc.html	2010-12-24 00:48:38 UTC (rev 44701)
+++ grass/trunk/imagery/i.modis.qc/i.modis.qc.html	2010-12-24 00:54:18 UTC (rev 44702)
@@ -65,6 +65,46 @@
 </ul>
 
 <pre>
+<EM>MOD11A1: 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>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>
@@ -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/trunk/imagery/i.modis.qc/main.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/main.c	2010-12-24 00:48:38 UTC (rev 44701)
+++ grass/trunk/imagery/i.modis.qc/main.c	2010-12-24 00:54:18 UTC (rev 44702)
@@ -49,6 +49,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);
@@ -98,6 +104,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";
 
@@ -112,6 +119,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;"
@@ -178,6 +189,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"))) ||
@@ -261,6 +278,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/trunk/imagery/i.modis.qc/mod11A1a.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod11A1a.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod11A1a.c	2010-12-24 00:54:18 UTC (rev 44702)
@@ -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/raster.h>
+
+CELL mod11A1a (CELL pixel) 
+{
+    CELL qctemp;
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+


Property changes on: grass/trunk/imagery/i.modis.qc/mod11A1a.c
___________________________________________________________________
Added: svn:mime-type
   + text/x-csrc
Added: svn:eol-style
   + native

Added: grass/trunk/imagery/i.modis.qc/mod11A1b.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod11A1b.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod11A1b.c	2010-12-24 00:54:18 UTC (rev 44702)
@@ -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/raster.h>
+
+CELL mod11A1b(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 2;		/*bits [2-3] become [0-1] */
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+


Property changes on: grass/trunk/imagery/i.modis.qc/mod11A1b.c
___________________________________________________________________
Added: svn:mime-type
   + text/x-csrc
Added: svn:eol-style
   + native

Added: grass/trunk/imagery/i.modis.qc/mod11A1c.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod11A1c.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod11A1c.c	2010-12-24 00:54:18 UTC (rev 44702)
@@ -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/raster.h>
+
+CELL mod11A1c(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 4;		/*bits [4-5] become [0-1] */
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+


Property changes on: grass/trunk/imagery/i.modis.qc/mod11A1c.c
___________________________________________________________________
Added: svn:mime-type
   + text/x-csrc
Added: svn:eol-style
   + native

Added: grass/trunk/imagery/i.modis.qc/mod11A1d.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/mod11A1d.c	                        (rev 0)
+++ grass/trunk/imagery/i.modis.qc/mod11A1d.c	2010-12-24 00:54:18 UTC (rev 44702)
@@ -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/raster.h>
+
+CELL mod11A1d(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 6;		/*bits [6-7] become [0-1] */
+    qctemp = pixel & 0x03;
+    
+    return qctemp;
+}
+
+


Property changes on: grass/trunk/imagery/i.modis.qc/mod11A1d.c
___________________________________________________________________
Added: svn:mime-type
   + text/x-csrc
Added: svn:eol-style
   + native



More information about the grass-commit mailing list