소스 검색

i.modis.qc: Added Internal Climatology for MOD09CMG and MYD09CMG (trunk https://trac.osgeo.org/grass/changeset/61856 and subsequent)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61937 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 년 전
부모
커밋
f4cd52a7cf

+ 45 - 45
imagery/i.modis.qc/i.modis.qc.html

@@ -33,8 +33,8 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
  <li>[0000]= class 0: highest quality</li>
  <li>[0000]= class 0: highest quality</li>
  <li>[0111]= class 1: noisy detector</li>
  <li>[0111]= class 1: noisy detector</li>
  <li>[1000]= class 2: dead detector; data interpolated in L1B</li>
  <li>[1000]= class 2: dead detector; data interpolated in L1B</li>
- <li>[1001]= class 3: solar zenith ge 86 degrees</li>
- <li>[1010]= class 4: solar zenith ge 85 and lt 86 degrees</li>
+ <li>[1001]= class 3: solar zenith &ge; 86 degrees</li>
+ <li>[1010]= class 4: solar zenith &ge; 85 and &lt; 86 degrees</li>
  <li>[1011]= class 5: missing input</li>
  <li>[1011]= class 5: missing input</li>
  <li>[1100]= class 6: internal constant used in place of climatological data for at least one atmospheric constant</li>
  <li>[1100]= class 6: internal constant used in place of climatological data for at least one atmospheric constant</li>
  <li>[1101]= class 7: correction out of bounds, pixel constrained to extreme allowable value</li>
  <li>[1101]= class 7: correction out of bounds, pixel constrained to extreme allowable value</li>
@@ -91,20 +91,20 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 <em>MOD11A1: Emis Error Flag bits=[4-5]</em>
 <em>MOD11A1: Emis Error Flag bits=[4-5]</em>
 </pre>
 </pre>
 <ul>
 <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>
+ <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>
 </ul>
 
 
 <pre>
 <pre>
 <em>MOD11A1: LST Error Flag bits=[6-7]</em>
 <em>MOD11A1: LST Error Flag bits=[6-7]</em>
 </pre>
 </pre>
 <ul>
 <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>
+ <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>
 </ul>
 <pre>
 <pre>
 
 
@@ -131,20 +131,20 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 <em>MOD11A2: Emis Error Flag bits=[4-5]</em>
 <em>MOD11A2: Emis Error Flag bits=[4-5]</em>
 </pre>
 </pre>
 <ul>
 <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>
+ <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>
 </ul>
 
 
 <pre>
 <pre>
 <em>MOD11A2: LST Error Flag bits=[6-7]</em>
 <em>MOD11A2: LST Error Flag bits=[6-7]</em>
 </pre>
 </pre>
 <ul>
 <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>
+ <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>
 </ul>
 
 
 <pre>
 <pre>
@@ -161,8 +161,8 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 <em>MOD09A1s: Cloud shadow bits=[2]</em>
 <em>MOD09A1s: Cloud shadow bits=[2]</em>
 </pre>
 </pre>
 <ul>
 <ul>
- <li>[0]= class 0: yes</li>
- <li>[1]= class 1: no</li>
+ <li>[0]= class 0: no</li>
+ <li>[1]= class 1: yes</li>
 </ul>
 </ul>
 
 
 <pre>
 <pre>
@@ -203,52 +203,52 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 <em>MOD09A1s: Internal Cloud Algorithm Flag bits=[10]</em>
 <em>MOD09A1s: Internal Cloud Algorithm Flag bits=[10]</em>
 </pre>
 </pre>
 <ul>
 <ul>
- <li>[0]= class 0: Cloud</li>
- <li>[1]= class 1: No cloud</li>
+ <li>[0]= class 0: No cloud</li>
+ <li>[1]= class 1: Cloud</li>
 </ul>
 </ul>
 
 
 <pre>
 <pre>
 <em>MOD09A1s: Internal Fire Algorithm Flag bits=[11]</em>
 <em>MOD09A1s: Internal Fire Algorithm Flag bits=[11]</em>
 </pre>
 </pre>
 <ul>
 <ul>
- <li>[0]= class 0: Fire</li>
- <li>[1]= class 1: No fire</li>
+ <li>[0]= class 0: No fire</li>
+ <li>[1]= class 1: Fire</li>
 </ul>
 </ul>
 
 
 <pre>
 <pre>
 <em>MOD09A1s: MOD35 snow/ice flag bits=[12]</em>
 <em>MOD09A1s: MOD35 snow/ice flag bits=[12]</em>
 </pre>
 </pre>
 <ul>
 <ul>
- <li>[0]= class 0: Yes</li>
- <li>[1]= class 1: No</li>
+ <li>[0]= class 0: No</li>
+ <li>[1]= class 1: Yes</li>
 </ul>
 </ul>
 
 
 <pre>
 <pre>
 <em>MOD09A1s: Pixel adjacent to cloud bits=[13]</em>
 <em>MOD09A1s: Pixel adjacent to cloud bits=[13]</em>
 </pre>
 </pre>
 <ul>
 <ul>
- <li>[0]= class 0: Yes</li>
- <li>[1]= class 1: No</li>
+ <li>[0]= class 0: No</li>
+ <li>[1]= class 1: Yes</li>
 </ul>
 </ul>
 
 
 <pre>
 <pre>
 <em>MOD09A1s: BRDF correction performed bits=[14]</em>
 <em>MOD09A1s: BRDF correction performed bits=[14]</em>
 </pre>
 </pre>
 <ul>
 <ul>
- <li>[0]= class 0: Yes</li>
- <li>[1]= class 1: No</li>
+ <li>[0]= class 0: No</li>
+ <li>[1]= class 1: Yes</li>
 </ul>
 </ul>
 
 
 <pre>
 <pre>
 <em>MOD09A1s: Internal Snow Mask bits=[15]</em>
 <em>MOD09A1s: Internal Snow Mask bits=[15]</em>
 </pre>
 </pre>
 <ul>
 <ul>
- <li>[0]= class 0: Snow</li>
- <li>[1]= class 1: No snow</li>
+ <li>[0]= class 0: No snow</li>
+ <li>[1]= class 1: Snow</li>
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MOD13A2: Mandatory QA Flags 1Km bits[0-1]</em>
+<em>MOD13A2: Mandatory QA Flags 1km bits[0-1]</em>
 </pre>
 </pre>
 <ul>
 <ul>
  <li>[00]= class 0: VI produced, good quality</li>
  <li>[00]= class 0: VI produced, good quality</li>
@@ -275,7 +275,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MOD13A2: Aerosol quantity Flags 1Km bits[6-7]</em>
+<em>MOD13A2: Aerosol quantity Flags 1km bits[6-7]</em>
 </pre>
 </pre>
 <ul>
 <ul>
  <li>[00]= class 0: Climatology</li>
  <li>[00]= class 0: Climatology</li>
@@ -285,7 +285,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MOD13A2: Adjacent cloud detected 1Km bit[8]</em>
+<em>MOD13A2: Adjacent cloud detected 1km bit[8]</em>
 </pre>
 </pre>
 <ul>
 <ul>
  <li>[00]= class 0: No</li>
  <li>[00]= class 0: No</li>
@@ -293,7 +293,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MOD13A2: Atmosphere BRDF correction performed 1Km bit[9]</em>
+<em>MOD13A2: Atmosphere BRDF correction performed 1km bit[9]</em>
 </pre>
 </pre>
 <ul>
 <ul>
  <li>[00]= class 0: No</li>
  <li>[00]= class 0: No</li>
@@ -301,7 +301,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MOD13A2: Mixed clouds 1Km bit[10]</em>
+<em>MOD13A2: Mixed clouds 1km bit[10]</em>
 </pre>
 </pre>
 <ul>
 <ul>
  <li>[00]= class 0: No</li>
  <li>[00]= class 0: No</li>
@@ -309,7 +309,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MOD13A2: Land/Water Flags 1Km bits[11-13]</em>
+<em>MOD13A2: Land/Water Flags 1km bits[11-13]</em>
 </pre>
 </pre>
 <ul>
 <ul>
  <li>[000]= class 0: Shallow Ocean</li>
  <li>[000]= class 0: Shallow Ocean</li>
@@ -323,7 +323,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MOD13A2: Possible Snow/Ice 1Km bits[14]</em>
+<em>MOD13A2: Possible Snow/Ice 1km bits[14]</em>
 </pre>
 </pre>
 <ul>
 <ul>
  <li>[0]= class 0: No</li>
  <li>[0]= class 0: No</li>
@@ -331,7 +331,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MOD13A2: Possible Shadow 1Km bits[15]</em>
+<em>MOD13A2: Possible Shadow 1km bits[15]</em>
 </pre>
 </pre>
 <ul>
 <ul>
  <li>[0]= class 0: No</li>
  <li>[0]= class 0: No</li>
@@ -340,7 +340,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 
 
 
 
 <pre>
 <pre>
-<em>MCD43B2: Albedo Quality Ancillary Platform Data 1Km bits[0-3]</em>
+<em>MCD43B2: Albedo Quality Ancillary Platform Data 1km bits[0-3]</em>
 <em>SDS: BRDF_Albedo_Ancillary</em>
 <em>SDS: BRDF_Albedo_Ancillary</em>
 </pre>
 </pre>
 <ul>
 <ul>
@@ -352,7 +352,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MCD43B2: Albedo Quality Ancillary Land/Water Data 1Km bits[4-7]</em>
+<em>MCD43B2: Albedo Quality Ancillary Land/Water Data 1km bits[4-7]</em>
 <em>SDS: BRDF_Albedo_Ancillary</em>
 <em>SDS: BRDF_Albedo_Ancillary</em>
 </pre>
 </pre>
 <ul>
 <ul>
@@ -369,7 +369,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 </ul>
 </ul>
 
 
 <pre>
 <pre>
-<em>MCD43B2: Albedo Quality Ancillary Sun Zenith Angle at Local Solar Noon Data 1Km bits[8-14]</em>
+<em>MCD43B2: Albedo Quality Ancillary Sun Zenith Angle at Local Solar Noon Data 1km bits[8-14]</em>
 <em>SDS: BRDF_Albedo_Ancillary</em>
 <em>SDS: BRDF_Albedo_Ancillary</em>
 </pre>
 </pre>
 <ul>
 <ul>
@@ -378,7 +378,7 @@ MCD43B2. This does include MOD09A1 QA_state_500m layer (see Notes).
 
 
 
 
 <pre>
 <pre>
-<em>MCD43B2: Band-wise Albedo Quality Data 1Km</em>
+<em>MCD43B2: Band-wise Albedo Quality Data 1km</em>
 <em>SDS: BRDF_Albedo_Band_Quality</em>
 <em>SDS: BRDF_Albedo_Band_Quality</em>
 </pre>
 </pre>
 bits[0-3][4-7][8-11][12-15][16-19][20-23][24-27]<br>
 bits[0-3][4-7][8-11][12-15][16-19][20-23][24-27]<br>
@@ -399,7 +399,7 @@ standard QC (MOD09A1 in this module) since version 3, State-QA 500m images
 (MOD09A1s in this module) should be used (see Vermote et al., 2008).
 (MOD09A1s in this module) should be used (see Vermote et al., 2008).
 
 
 <h2>TODO</h2>
 <h2>TODO</h2>
-Add one Day products.
+Add more daily products.
 
 
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>
 
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 206 - 38
imagery/i.modis.qc/main.c


+ 2 - 2
imagery/i.modis.qc/mod09A1sb.c

@@ -1,6 +1,6 @@
 /* cloud shadow unsigned int bits[2]
 /* cloud shadow unsigned int bits[2]
- * 0 -> class 0: yes
- * 1 -> class 1: no
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
  */  
  */  
 
 
 #include <grass/raster.h>
 #include <grass/raster.h>

+ 2 - 2
imagery/i.modis.qc/mod09A1sf.c

@@ -1,6 +1,6 @@
 /* Internal Cloud Algorithm Flag unsigned int bits[10]
 /* Internal Cloud Algorithm Flag unsigned int bits[10]
- * 0 -> class 0: Cloud 
- * 1 -> class 1: No cloud
+ * 0 -> class 0: No cloud 
+ * 1 -> class 1: Cloud
  */  
  */  
 
 
 #include <grass/raster.h>
 #include <grass/raster.h>

+ 2 - 2
imagery/i.modis.qc/mod09A1sg.c

@@ -1,6 +1,6 @@
 /* Internal Fire Algorithm Flag unsigned int bits[11]
 /* Internal Fire Algorithm Flag unsigned int bits[11]
- * 0 -> class 0: Fire 
- * 1 -> class 1: No fire
+ * 0 -> class 0: No fire 
+ * 1 -> class 1: Fire
  */  
  */  
 
 
 #include <grass/raster.h>
 #include <grass/raster.h>

+ 2 - 2
imagery/i.modis.qc/mod09A1sh.c

@@ -1,6 +1,6 @@
 /* MOD35 snow/ice flag unsigned int bits [12]
 /* MOD35 snow/ice flag unsigned int bits [12]
- * 0 -> class 0: Yes
- * 1 -> class 1: No
+ * 0 -> class 0: No
+ * 1 -> class 1: Yes
  */  
  */  
 
 
 #include <grass/raster.h>
 #include <grass/raster.h>

+ 2 - 2
imagery/i.modis.qc/mod09A1si.c

@@ -1,6 +1,6 @@
 /* Pixel adjacent to cloud unsigned int bits[13]
 /* Pixel adjacent to cloud unsigned int bits[13]
- * 0 -> class 0: Yes
- * 1 -> class 1: No
+ * 0 -> class 0: No
+ * 1 -> class 1: Yes
  */  
  */  
 
 
 #include <grass/raster.h>
 #include <grass/raster.h>

+ 2 - 2
imagery/i.modis.qc/mod09A1sj.c

@@ -1,6 +1,6 @@
 /* BRDF correction performed unsigned int bits[14]
 /* BRDF correction performed unsigned int bits[14]
- * 0 -> class 0: Yes
- * 1 -> class 1: No
+ * 0 -> class 0: No
+ * 1 -> class 1: Yes
  */  
  */  
 
 
 #include <grass/raster.h>
 #include <grass/raster.h>

+ 2 - 2
imagery/i.modis.qc/mod09A1sk.c

@@ -1,6 +1,6 @@
 /* Internal Snow Mask unsigned int bits[15]
 /* Internal Snow Mask unsigned int bits[15]
- * 0 -> class 0: Snow
- * 1 -> class 1: No snow
+ * 0 -> class 0: No snow
+ * 1 -> class 1: Snow
  */  
  */  
 
 
 #include <grass/raster.h>
 #include <grass/raster.h>

+ 22 - 0
imagery/i.modis.qc/mod09CMGa.c

@@ -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;
+}
+
+

+ 28 - 0
imagery/i.modis.qc/mod09CMGc.c

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

+ 17 - 0
imagery/i.modis.qc/mod09CMGia.c

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -0,0 +1,18 @@
+/* snow unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGie(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 4;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -0,0 +1,18 @@
+/* cloud shadow unsigned int bits[2]
+ * 0 -> class 0: no
+ * 1 -> class 1: yes
+ */  
+
+#include <grass/raster.h>
+
+CELL mod09CMGii(CELL pixel) 
+{
+    CELL qctemp;
+
+    pixel >>= 8;
+    qctemp = pixel & 0x01;
+
+    return qctemp;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+

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

@@ -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;
+}
+
+