[GRASS-SVN] r61937 - in grass/branches/releasebranch_7_0: . imagery/i.modis.qc

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 13 18:36:28 PDT 2014


Author: neteler
Date: 2014-09-13 18:36:28 -0700 (Sat, 13 Sep 2014)
New Revision: 61937

Added:
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGa.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGc.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGd.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGe.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGia.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGib.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGic.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGid.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGie.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGif.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGig.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGih.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGii.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGij.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGik.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGil.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGim.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGin.c
Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/i.modis.qc.html
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/main.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sb.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sf.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sg.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sh.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1si.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sj.c
   grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sk.c
Log:
i.modis.qc: Added Internal Climatology for MOD09CMG and MYD09CMG (trunk r61856 and subsequent)


Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:60289,60696,61269,61380,61420,61422,61480,61500,61764,61808,61829,61831,61854,61888,61891,61905,61907,61913-61914,61916,61918,61921
   + /grass/trunk:60289,60696,61269,61380,61420,61422,61480,61500,61764,61808,61829,61831,61851-61852,61854,61858,61888,61891,61905,61907,61913-61914,61916,61918,61921

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/i.modis.qc.html
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/i.modis.qc.html	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/i.modis.qc.html	2014-09-14 01:36:28 UTC (rev 61937)
@@ -33,8 +33,8 @@
  <li>[0000]= class 0: highest quality</li>
  <li>[0111]= class 1: noisy detector</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 ≥ 86 degrees</li>
+ <li>[1010]= class 4: solar zenith ≥ 85 and < 86 degrees</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>[1101]= class 7: correction out of bounds, pixel constrained to extreme allowable value</li>
@@ -91,20 +91,20 @@
 <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>
+ <li>[00]= class 0: Average emissivity error ≤ 0.01</li>
+ <li>[01]= class 1: Average emissivity error ≤ 0.02</li>
+ <li>[10]= class 2: Average emissivity error ≤ 0.04</li>
+ <li>[11]= class 3: Average emissivity error > 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>
+ <li>[00]= class 0: Average LST error ≤ 1</li>
+ <li>[01]= class 1: Average LST error ≤ 2</li>
+ <li>[10]= class 2: Average LST error ≤ 3</li> 
+ <li>[11]= class 3: Average LST error > 3</li>
 </ul>
 <pre>
 
@@ -131,20 +131,20 @@
 <em>MOD11A2: 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>
+ <li>[00]= class 0: Average emissivity error ≤ 0.01</li>
+ <li>[01]= class 1: Average emissivity error ≤ 0.02</li>
+ <li>[10]= class 2: Average emissivity error ≤ 0.04</li>
+ <li>[11]= class 3: Average emissivity error > 0.04</li>
 </ul>
 
 <pre>
 <em>MOD11A2: 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>
+ <li>[00]= class 0: Average LST error ≤ 1</li>
+ <li>[01]= class 1: Average LST error ≤ 2</li>
+ <li>[10]= class 2: Average LST error ≤ 3</li> 
+ <li>[11]= class 3: Average LST error > 3</li>
 </ul>
 
 <pre>
@@ -161,8 +161,8 @@
 <em>MOD09A1s: Cloud shadow bits=[2]</em>
 </pre>
 <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>
 
 <pre>
@@ -203,52 +203,52 @@
 <em>MOD09A1s: Internal Cloud Algorithm Flag bits=[10]</em>
 </pre>
 <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>
 
 <pre>
 <em>MOD09A1s: Internal Fire Algorithm Flag bits=[11]</em>
 </pre>
 <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>
 
 <pre>
 <em>MOD09A1s: MOD35 snow/ice flag bits=[12]</em>
 </pre>
 <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>
 
 <pre>
 <em>MOD09A1s: Pixel adjacent to cloud bits=[13]</em>
 </pre>
 <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>
 
 <pre>
 <em>MOD09A1s: BRDF correction performed bits=[14]</em>
 </pre>
 <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>
 
 <pre>
 <em>MOD09A1s: Internal Snow Mask bits=[15]</em>
 </pre>
 <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>
 
 <pre>
-<em>MOD13A2: Mandatory QA Flags 1Km bits[0-1]</em>
+<em>MOD13A2: Mandatory QA Flags 1km bits[0-1]</em>
 </pre>
 <ul>
  <li>[00]= class 0: VI produced, good quality</li>
@@ -275,7 +275,7 @@
 </ul>
 
 <pre>
-<em>MOD13A2: Aerosol quantity Flags 1Km bits[6-7]</em>
+<em>MOD13A2: Aerosol quantity Flags 1km bits[6-7]</em>
 </pre>
 <ul>
  <li>[00]= class 0: Climatology</li>
@@ -285,7 +285,7 @@
 </ul>
 
 <pre>
-<em>MOD13A2: Adjacent cloud detected 1Km bit[8]</em>
+<em>MOD13A2: Adjacent cloud detected 1km bit[8]</em>
 </pre>
 <ul>
  <li>[00]= class 0: No</li>
@@ -293,7 +293,7 @@
 </ul>
 
 <pre>
-<em>MOD13A2: Atmosphere BRDF correction performed 1Km bit[9]</em>
+<em>MOD13A2: Atmosphere BRDF correction performed 1km bit[9]</em>
 </pre>
 <ul>
  <li>[00]= class 0: No</li>
@@ -301,7 +301,7 @@
 </ul>
 
 <pre>
-<em>MOD13A2: Mixed clouds 1Km bit[10]</em>
+<em>MOD13A2: Mixed clouds 1km bit[10]</em>
 </pre>
 <ul>
  <li>[00]= class 0: No</li>
@@ -309,7 +309,7 @@
 </ul>
 
 <pre>
-<em>MOD13A2: Land/Water Flags 1Km bits[11-13]</em>
+<em>MOD13A2: Land/Water Flags 1km bits[11-13]</em>
 </pre>
 <ul>
  <li>[000]= class 0: Shallow Ocean</li>
@@ -323,7 +323,7 @@
 </ul>
 
 <pre>
-<em>MOD13A2: Possible Snow/Ice 1Km bits[14]</em>
+<em>MOD13A2: Possible Snow/Ice 1km bits[14]</em>
 </pre>
 <ul>
  <li>[0]= class 0: No</li>
@@ -331,7 +331,7 @@
 </ul>
 
 <pre>
-<em>MOD13A2: Possible Shadow 1Km bits[15]</em>
+<em>MOD13A2: Possible Shadow 1km bits[15]</em>
 </pre>
 <ul>
  <li>[0]= class 0: No</li>
@@ -340,7 +340,7 @@
 
 
 <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>
 </pre>
 <ul>
@@ -352,7 +352,7 @@
 </ul>
 
 <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>
 </pre>
 <ul>
@@ -369,7 +369,7 @@
 </ul>
 
 <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>
 </pre>
 <ul>
@@ -378,7 +378,7 @@
 
 
 <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>
 </pre>
 bits[0-3][4-7][8-11][12-15][16-19][20-23][24-27]<br>
@@ -399,7 +399,7 @@
 (MOD09A1s in this module) should be used (see Vermote et al., 2008).
 
 <h2>TODO</h2>
-Add one Day products.
+Add more daily products.
 
 <h2>SEE ALSO</h2>
 

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/main.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/main.c	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/main.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -8,7 +8,7 @@
  * 		 (MOD09Q/MOD09A), Modis LST (MOD11A1, MOD11A2), Modis Vegetation
  *		 (MOD13A2)
  *
- * COPYRIGHT:    (C) 2008 -2011 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2008 -2014 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *   	    	 License (>=v2). Read the file COPYING that comes with GRASS
@@ -53,19 +53,39 @@
 CELL mod09A1sj(CELL pixel);
 CELL mod09A1sk(CELL pixel);
 
-    /* MOD11A1 Products (1Km, daily) */ 
+    /* MOD09CMG Products (5000m, daily) */
+CELL mod09CMGa(CELL pixel);
+CELL mod09CMGc(CELL pixel, int bandno);
+CELL mod09CMGd(CELL pixel);
+CELL mod09CMGe(CELL pixel);
+CELL mod09CMGia(CELL pixel);
+CELL mod09CMGib(CELL pixel);
+CELL mod09CMGic(CELL pixel);
+CELL mod09CMGid(CELL pixel);
+CELL mod09CMGie(CELL pixel);
+CELL mod09CMGif(CELL pixel);
+CELL mod09CMGig(CELL pixel);
+CELL mod09CMGih(CELL pixel);
+CELL mod09CMGii(CELL pixel);
+CELL mod09CMGij(CELL pixel);
+CELL mod09CMGik(CELL pixel);
+CELL mod09CMGil(CELL pixel);
+CELL mod09CMGim(CELL pixel);
+CELL mod09CMGin(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) */ 
+    /* MOD11A2 Products (1km, 8-Days) */ 
 CELL mod11A2a(CELL pixel);
 CELL mod11A2b(CELL pixel);
 CELL mod11A2c(CELL pixel);
 CELL mod11A2d(CELL pixel);
 
-    /* MOD13A2 Products (1Km, 16-Days) */ 
+    /* MOD13A2 Products (1km, 16-Days) */ 
 CELL mod13A2a (CELL pixel);
 CELL mod13A2b (CELL pixel);
 CELL mod13A2c (CELL pixel);
@@ -76,7 +96,7 @@
 CELL mod13A2h (CELL pixel);
 CELL mod13A2i (CELL pixel);
 
-    /* MCD43B2 Products (1Km, 8-Days)*/
+    /* MCD43B2 Products (1km, 8-Days)*/
 
 /* SDS: BRDF_Albedo_Ancilliary */
 CELL mcd43B2a(CELL pixel);
@@ -106,7 +126,7 @@
     int outfd;
     char *product;
     char *qcchan;
-    int bandno;
+    int bandno=0;
     CELL *inrast;
     CELL *outrast;
     RASTER_MAP_TYPE data_type_output = CELL_TYPE;
@@ -122,7 +142,7 @@
     G_add_keyword(_("vegetation"));
     G_add_keyword(_("MODIS"));
     module->description =
-	_("Extracts quality control parameters from Modis QC layers.");
+	_("Extracts quality control parameters from MODIS QC layers.");
 
     /* Define the different options */ 
     input = G_define_standard_option(G_OPT_R_INPUT);
@@ -144,6 +164,9 @@
 	       "mod09Q1;%s;"
 	       "mod09A1;%s;"
 	       "mod09A1s;%s;"
+	       "mod09CMG;%s;"
+	       "mod09CMGs;%s;"
+	       "mod09CMGi;%s;"
 	       "mod11A1;%s;"
 	       "mod11A2;%s;"
 	       "mod13A2;%s;"
@@ -152,13 +175,16 @@
 	       _("surf. refl. 250m 8-days"),
 	       _("surf. refl. 500m 8-days"),
 	       _("surf. refl. 500m 8-days, State QA"),
-	       _("LST 1Km daily (Day/Night)"),
-	       _("LST 1Km 8-days (Day/Night)"),
-	       _("VI 1Km 16-days"),
-	       _("Brdf-Albedo Quality (Ancillary SDS) 1Km 8-days"),
-	       _("Brdf-Albedo Quality (BRDF SDS) 1Km 8-days"));
+	       _("surf. refl. 5000m daily"),
+	       _("surf. refl. 5000m daily, State QA"),
+	       _("surf. refl. 5000m daily, Internal Climatology"),
+	       _("LST 1km daily (Day/Night)"),
+	       _("LST 1km 8-days (Day/Night)"),
+	       _("VI 1km 16-days"),
+	       _("Brdf-Albedo Quality (Ancillary SDS) 1km 8-days"),
+	       _("Brdf-Albedo Quality (BRDF SDS) 1km 8-days"));
     productname->descriptions = desc_productname;
-    productname->options = "mod09Q1,mod09A1,mod09A1s,mod11A1,mod11A2,mod13A2,mcd43B2,mcd43B2q";
+    productname->options = "mod09Q1,mod09A1,mod09A1s,mod09CMG,mod09CMGs,mod09CMGi,mod11A1,mod11A2,mod13A2,mcd43B2,mcd43B2q";
     productname->answer = "mod13A2";
     
     qcname = G_define_option();
@@ -193,6 +219,20 @@
 	       "land_water;%s;"
 	       "mod35_snow_ice;%s;"
 	       "pixel_adjacent_to_cloud;%s;"
+	       "icm_cloudy;%s;"
+	       "icm_clear;%s;"
+	       "icm_high_clouds;%s;"
+	       "icm_low_clouds;%s;"
+	       "icm_snow;%s;"
+	       "icm_fire;%s;"
+	       "icm_sun_glint;%s;"
+	       "icm_dust;%s;"
+	       "icm_cloud_shadow;%s;"
+	       "icm_pixel_is_adjacent_to_cloud;%s;"
+	       "icm_cirrus;%s;"
+	       "icm_pan_flag;%s;"
+	       "icm_criteria_for_aerosol_retrieval;%s;"
+	       "icm_aot_has_clim_val;%s;"
 	       "modland_qa;%s;"
 	       "vi_usefulness;%s;"
 	       "aerosol_quantity;%s;"
@@ -220,17 +260,31 @@
 	       _("mod11A2: Average Emissivity Error Classes"),
 	       _("mod11A2: MODIS Land General Quality Assessment"),
 	       _("mod11A2: Average LST Error Classes"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
-	       _("mod09A1s: StateQA Internal Snow Mask"),
+	       _("mod09*s: StateQA Aerosol Quantity"),
+	       _("mod09*s: StateQA BRDF Correction Performed"),
+	       _("mod09*s: StateQA Cirrus Detected"),
+	       _("mod09*s: StateQA Cloud Shadow"),
+	       _("mod09*s: StateQA Cloud State"),
+	       _("mod09*s: StateQA Internal Cloud Algorithm"),
+	       _("mod09*s: StateQA Internal Fire Algorithm"),
+	       _("mod09*s: StateQA Internal Snow Mask"),
+	       _("mod09*s: StateQA Land Water"),
+	       _("mod09*s: StateQA mod35 Snow Ice"),
+	       _("mod09*s: StateQA Pixel Adjacent to Cloud"),
+	       _("mod09*i: Internal CM: Cloudy"),
+	       _("mod09*i: Internal CM: Clear"),
+	       _("mod09*i: Internal CM: High Clouds"),
+	       _("mod09*i: Internal CM: Low Clouds"),
+	       _("mod09*i: Internal CM: Snow"),
+	       _("mod09*i: Internal CM: Fire"),
+	       _("mod09*i: Internal CM: Sun Glint"),
+	       _("mod09*i: Internal CM: Dust"),
+	       _("mod09*i: Internal CM: Cloud Shadow"),
+	       _("mod09*i: Internal CM: Pixel is Adjacent to Cloud"),
+	       _("mod09*i: Internal CM: Cirrus"),
+	       _("mod09*i: Internal CM: Pan Flag"),
+	       _("mod09*i: Internal CM: Criteria for Aerosol Retrieval"),
+	       _("mod09*i: Internal CM: AOT (aerosol optical depth) has clim. val."),
 	       _("mod13A2: MODIS Land General Quality Assessment"),
 	       _("mod13A2: Quality estimation of the pixel"),
 	       _("mod13A2: Quantity range of Aerosol"),
@@ -245,7 +299,7 @@
 	       _("mcd43B2: Quality of BRDF correction performed"),
 	       _("mcd43B2q: Quality of BRDF correction performed"));
     qcname->descriptions = desc_qcname;
-    qcname->options = "adjcorr,atcorr,cloud,data_quality,diff_orbit_from_500m,modland_qa,mandatory_qa_11A1,data_quality_flag_11A1,emis_error_11A1,lst_error_11A1,data_quality_flag_11A2,emis_error_11A2,mandatory_qa_11A2,lst_error_11A2,aerosol_quantity,brdf_correction_performed,cirrus_detected,cloud_shadow,cloud_state,internal_cloud_algorithm,internal_fire_algorithm,internal_snow_mask,land_water,mod35_snow_ice,pixel_adjacent_to_cloud,modland_qa,vi_usefulness,aerosol_quantity,pixel_adjacent_to_cloud,brdf_correction_performed,mixed_clouds,land_water,possible_snow_ice,possible_shadow,platform,land_water,sun_z_angle_at_local_noon,brdf_correction_performed";
+    qcname->options = "adjcorr,atcorr,cloud,data_quality,diff_orbit_from_500m,modland_qa,mandatory_qa_11A1,data_quality_flag_11A1,emis_error_11A1,lst_error_11A1,data_quality_flag_11A2,emis_error_11A2,mandatory_qa_11A2,lst_error_11A2,aerosol_quantity,brdf_correction_performed,cirrus_detected,cloud_shadow,cloud_state,internal_cloud_algorithm,internal_fire_algorithm,internal_snow_mask,land_water,mod35_snow_ice,pixel_adjacent_to_cloud,icm_cloudy,icm_clear,icm_high_clouds,icm_low_clouds,icm_snow,icm_fire,icm_sun_glint,icm_dust,icm_cloud_shadow,icm_pixel_is_adjacent_to_cloud,icm_cirrus,icm_pan_flag,icm_criteria_for_aerosol_retrieval,icm_aot_has_clim_val,modland_qa,vi_usefulness,aerosol_quantity,pixel_adjacent_to_cloud,brdf_correction_performed,mixed_clouds,land_water,possible_snow_ice,possible_shadow,platform,land_water,sun_z_angle_at_local_noon,brdf_correction_performed";
     qcname->answer = "modland_qa";
 
     input_band = G_define_option();
@@ -253,7 +307,7 @@
     input_band->type = TYPE_STRING;
     input_band->required = NO;
     input_band->description =
-      _("Band number of Modis product (mod09Q1=[1,2],mod09A1=[1-7], mcd43B2q=[1-7])");
+      _("Band number of MODIS product (mod09Q1=[1,2],mod09A1=[1-7],m[o/y]d09CMG=[1-7], mcd43B2q=[1-7])");
     desc_input_band = NULL;
     G_asprintf(&desc_input_band,
                "1;%s;2;%s;3;%s;4;%s;5;%s;6;%s;7;%s",
@@ -282,7 +336,7 @@
     /*mod09Q1*/
     if ((strcmp(qcflag, "cloud") && !(strcmp(product, "mod09Q1"))) || 
 	(strcmp(qcflag, "diff_orbit_from_500m") && !(strcmp(product, "mod09Q1"))))
-	G_fatal_error(_("This flag is only available for MOD09Q1 @ 250m products"));
+	G_fatal_error(_("This bit flag is only available for MOD09Q1 @ 250m products"));
 
     if (!strcmp(qcflag, "data_quality")) {
 	if (bandno < 1 || bandno > 7)
@@ -291,28 +345,45 @@
 	    G_fatal_error(_("mod09Q1 product only has 2 bands"));
     }
     
-    /*mod09A1*/
-    if ((strcmp(qcflag, "cirrus_detected") && !(strcmp(product, "mod09A1s"))) ||
-	(strcmp(qcflag, "cloud_shadow") && !(strcmp(product, "mod09A1s"))) ||
-	(strcmp(qcflag, "cloud_state") && !(strcmp(product, "mod09A1s"))) ||
-	(strcmp(qcflag, "internal_cloud_algorithm") && !(strcmp(product, "mod09A1s"))) ||
-	(strcmp(qcflag, "internal_fire_algorithm") && !(strcmp(product, "mod09A1s"))) ||
-	(strcmp(qcflag, "internal_snow_mask") && !(strcmp(product, "mod09A1s"))) ||
-	(strcmp(qcflag, "mod35_snow_ice") && !(strcmp(product, "mod09A1s"))))
-	G_fatal_error(_("This flag is only available for MOD09A1s @ 500m products"));
+    /*mod09A1 stateqa or mod09CMG stateqa*/
+    if ((strcmp(qcflag, "cirrus_detected") && ( !(strcmp(product, "mod09A1s")) || !(strcmp(product, "mod09CMGs")) )) ||
+	(strcmp(qcflag, "cloud_shadow") && ( !(strcmp(product, "mod09A1s")) || !(strcmp(product, "mod09CMGs")) )) ||
+	(strcmp(qcflag, "cloud_state") && ( !(strcmp(product, "mod09A1s")) || !(strcmp(product, "mod09CMGs")) )) ||
+	(strcmp(qcflag, "internal_cloud_algorithm") && ( !(strcmp(product, "mod09A1s")) || !(strcmp(product, "mod09CMGs")) ))||
+	(strcmp(qcflag, "internal_fire_algorithm") && ( !(strcmp(product, "mod09A1s")) || !(strcmp(product, "mod09CMGs")) )) ||
+	(strcmp(qcflag, "internal_snow_mask") && ( !(strcmp(product, "mod09A1s")) || !(strcmp(product, "mod09CMGs")) )) ||
+	(strcmp(qcflag, "mod35_snow_ice") && ( !(strcmp(product, "mod09A1s")) || !(strcmp(product, "mod09CMGs")) )))
+	G_fatal_error(_("This bit flag is only available for MOD09A1s @ 500m or MOD09CMG @ 5000m products"));
 
+    /*mod09CMG*/
+    if ((strcmp(qcflag, "icm_cloudy") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_clear") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_high_clouds") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_low_clouds") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_snow") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_fire") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_sun_glint") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_dust") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_cloud_shadow") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_pixel_is_adjacent_to_cloud") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_cirrus") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_pan_flag") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_criteria_for_aerosol_retrieval") && !(strcmp(product, "mod09CMGi"))) ||
+	(strcmp(qcflag, "icm_aot_has_clim_val") && !(strcmp(product, "mod09CMGi"))))
+	G_fatal_error(_("This bit flag is only available for mod09CMGi @ 5000m products"));
+
     /*mod13A2*/
     if ((strcmp(qcflag, "vi_usefulness") && !(strcmp(product, "mod13A2"))) ||
         (strcmp(qcflag, "mixed_clouds") && !(strcmp(product, "mod13A2"))) ||
         (strcmp(qcflag, "possible_snow_ice") && !(strcmp(product, "mod13A2"))) ||
         (strcmp(qcflag, "possible_shadow") && !(strcmp(product, "mod13A2"))))
-        G_fatal_error(_("This flag is only available for MOD13A2 @ 1Km products"));
+        G_fatal_error(_("This bit flag is only available for MOD13A2 @ 1km products"));
 
     /*mcd43B2*/
     if ((strcmp(qcflag, "platform") && !(strcmp(product, "mcd43B2"))) ||
         (strcmp(qcflag, "land_water") && !(strcmp(product, "mcd43B2"))) ||
         (strcmp(qcflag, "sun_z_angle_at_local_noon") && !(strcmp(product, "mcd43B2"))))
-        G_fatal_error(_("This flag is only available for MCD43B2 @ 1Km products"));
+        G_fatal_error(_("This bit flag is only available for MCD43B2 @ 1km products"));
 
      /*mcd43B2q*/
     if (strcmp(product, "mcd43B2q") && (bandno < 1 || bandno > 7))
@@ -382,6 +453,21 @@
                 /*calculate different orbit from 500m flag  */ 
                     c = mod09Q1f(c);
             }
+            else if (!strcmp(product, "mod09CMG"))
+            {
+	        if (!strcmp(qcflag, "modland_qa")) 
+		/*calculate modland QA bits extraction  */ 
+		    c = mod09CMGa(c);
+	        if (!strcmp(qcflag, "data_quality"))
+		/*calculate modland QA bits extraction  */ 
+		    c = mod09CMGc(c, bandno);
+	        if (!strcmp(qcflag, "atcorr")) 
+		/*calculate atmospheric correction flag  */ 
+		    c = mod09CMGd(c);
+	        if (!strcmp(qcflag, "adjcorr")) 
+		/*calculate adjacency correction flag  */ 
+		    c = mod09CMGe(c);
+	    }
             else if (!strcmp(product, "mod11A1"))
             {
                 if (!strcmp(qcflag, "mandatory_qa"))
@@ -448,6 +534,88 @@
 		/*calculate mod09A1s internal snow mask flag  */ 
                     c = mod09A1sk(c);
             }
+            else if (!strcmp(product, "mod09CMGs"))
+            {
+	        if (!strcmp(qcflag, "cloud_state"))
+		/*calculate mod09A1s cloud state flag  */ 
+                    c = mod09A1sa(c);
+	        if (!strcmp(qcflag, "cloud_shadow")) 
+		/*calculate mod09A1s cloud shadow flag  */ 
+                    c = mod09A1sb(c);
+	        if (!strcmp(qcflag, "land_water")) 
+		/*calculate mod09A1s land/water flag  */ 
+                    c = mod09A1sc(c);
+	        if (!strcmp(qcflag, "aerosol_quantity")) 
+		/*calculate mod09A1s aerosol quantity flag  */ 
+                    c = mod09A1sd(c);
+	        if (!strcmp(qcflag, "cirrus_detected")) 
+		/*calculate mod09A1s cirrus detected flag  */ 
+                    c = mod09A1se(c);
+	        if (!strcmp(qcflag, "internal_cloud_algorithm")) 
+		/*calculate mod09A1s internal cloud algorithm flag  */ 
+                    c = mod09A1sf(c);
+	        if (!strcmp(qcflag, "internal_fire_algorithm")) 
+		/*calculate mod09A1s internal fire algorithm flag  */ 
+                    c = mod09A1sg(c);
+	        if (!strcmp(qcflag, "mod35_snow_ice")) 
+		/*calculate mod09A1s MOD35 snow/ice flag  */ 
+                    c = mod09A1sh(c);
+	        if (!strcmp(qcflag, "pixel_adjacent_to_cloud")) 
+		/*calculate mod09A1s pixel adjacent to cloud flag  */ 
+                    c = mod09A1si(c);
+	        if (!strcmp(qcflag, "brdf_correction_performed")) 
+		/*calculate mod09A1s BRDF correction performed flag  */ 
+                    c = mod09A1sj(c);
+	        if (!strcmp(qcflag, "internal_snow_mask")) 
+		/*calculate mod09A1s internal snow mask flag  */ 
+                    c = mod09A1sk(c);
+            }
+            else if (!strcmp(product, "mod09CMGi"))
+            {
+	        /* Internal Climatology for MOD09CMG or MYD09CMG  */
+	        if (!strcmp(qcflag, "icm_cloudy"))
+		/*calculate mod09A1i cloudy  */ 
+                    c = mod09CMGia(c);
+	        if (!strcmp(qcflag, "icm_clear")) 
+		/*calculate mod09A1i clear flag  */ 
+                    c = mod09CMGib(c);
+	        if (!strcmp(qcflag, "icm_high_clouds")) 
+		/*calculate mod09A1i high clouds flag  */ 
+                    c = mod09CMGic(c);
+	        if (!strcmp(qcflag, "icm_low_clouds")) 
+		/*calculate mod09A1s low clouds flag  */ 
+                    c = mod09CMGid(c);
+	        if (!strcmp(qcflag, "icm_snow")) 
+		/*calculate mod09A1i snow flag  */ 
+                    c = mod09CMGie(c);
+	        if (!strcmp(qcflag, "icm_fire")) 
+		/*calculate mod09A1i fire flag  */ 
+                    c = mod09CMGif(c);
+	        if (!strcmp(qcflag, "icm_sun_glint")) 
+		/*calculate mod09A1i sun glint flag  */ 
+                    c = mod09CMGig(c);
+	        if (!strcmp(qcflag, "icm_dust")) 
+		/*calculate mod09A1i dust flag  */ 
+                    c = mod09CMGih(c);
+	        if (!strcmp(qcflag, "icm_cloud_shadow")) 
+		/*calculate mod09A1i cloud shadow flag  */ 
+                    c = mod09CMGii(c);
+	        if (!strcmp(qcflag, "icm_pixel_is_adjacent_to_cloud")) 
+		/*calculate mod09A1i pixel is adjacent to cloud flag  */ 
+                    c = mod09CMGij(c);
+	        if (!strcmp(qcflag, "icm_cirrus")) 
+		/*calculate mod09A1i cirrus flag  */ 
+                    c = mod09CMGik(c);
+	        if (!strcmp(qcflag, "icm_pan_flag")) 
+		/*calculate mod09A1i pan flag  */ 
+                    c = mod09CMGil(c);
+	        if (!strcmp(qcflag, "icm_criteria_for_aerosol_retrieval")) 
+		/*calculate mod09A1i criteria for aerosol retrieval flag  */ 
+                    c = mod09CMGim(c);
+	        if (!strcmp(qcflag, "icm_aot_has_clim_val")) 
+		/*calculate mod09A1i aot has clim val flag  */ 
+                    c = mod09CMGin(c);
+            }
             else if (!strcmp(product, "mod13A2"))
             {
                 if (!strcmp(qcflag, "modland_qa")) 

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sb.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sb.c	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sb.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -1,6 +1,6 @@
 /* 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>

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sf.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sf.c	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sf.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -1,6 +1,6 @@
 /* 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>

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sg.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sg.c	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sg.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -1,6 +1,6 @@
 /* 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>

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sh.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sh.c	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sh.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -1,6 +1,6 @@
 /* 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>

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1si.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1si.c	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1si.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -1,6 +1,6 @@
 /* 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>

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sj.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sj.c	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sj.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -1,6 +1,6 @@
 /* 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>

Modified: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sk.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sk.c	2014-09-14 01:30:04 UTC (rev 61936)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09A1sk.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -1,6 +1,6 @@
 /* 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>

Added: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGa.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGa.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGa.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGc.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGc.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGc.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGd.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGd.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGd.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGe.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGe.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGe.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGia.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGia.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGia.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGib.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGib.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGib.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGic.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGic.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGic.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGid.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGid.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGid.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGie.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGie.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGie.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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;
+}
+
+

Added: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGif.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGif.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGif.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGig.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGig.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGig.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGih.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGih.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGih.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGii.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGii.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGii.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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;
+}
+
+

Added: grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGij.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGij.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGij.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGik.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGik.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGik.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGil.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGil.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGil.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGim.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGim.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGim.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGin.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGin.c	                        (rev 0)
+++ grass/branches/releasebranch_7_0/imagery/i.modis.qc/mod09CMGin.c	2014-09-14 01:36:28 UTC (rev 61937)
@@ -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