[GRASS-SVN] r50990 - grass/branches/releasebranch_6_4/imagery/i.modis.qc

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 4 07:28:05 EST 2012


Author: martinl
Date: 2012-03-04 04:28:05 -0800 (Sun, 04 Mar 2012)
New Revision: 50990

Modified:
   grass/branches/releasebranch_6_4/imagery/i.modis.qc/main.c
Log:
i.modis.qc: fix broken module's UI
	    (merge r50989 from devbr6)


Modified: grass/branches/releasebranch_6_4/imagery/i.modis.qc/main.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.modis.qc/main.c	2012-03-04 12:26:40 UTC (rev 50989)
+++ grass/branches/releasebranch_6_4/imagery/i.modis.qc/main.c	2012-03-04 12:28:05 UTC (rev 50990)
@@ -67,7 +67,7 @@
     int row, col;
     char *qcflag;		/*Switch for particular index */
     struct GModule *module;
-    struct Option *input, *input1, *input2, *input_band, *output;
+    struct Option *productname, *qcname, *input, *input_band, *output;
     struct History history;	/*metadata */
     struct Colors colors;	/*Color rules */
 
@@ -89,65 +89,72 @@
     module = G_define_module();
     module->keywords = _("QC, Quality Control, surface reflectance, Modis");
     module->description =
-	_("Extract quality control parameters from Modis QC layers");
+	_("Extracts quality control parameters from Modis QC layers.");
 
     /* Define the different options */ 
-    input = G_define_option();
-    input->key = "productname";
-    input->type = TYPE_STRING;
-    input->required = YES;
-    input->description = _("Name of MODIS product type");
-    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";
 
-    input1 = G_define_option();
-    input1->key = "qcname";
-    input1->type = TYPE_STRING;
-    input1->required = YES;
-    input1->description = _("Name of QC type to extract:"
-                            "adjcorr;mod09: Adjacency Correction;"
-                            "atcorr;mod09: Atmospheric Correction;"
-                            "cloud;mod09: Cloud State;"
-                            "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_11A1;mod11A1: MODIS Land General Quality Assessment;"
-                            "data_quality_flag_11A1;mod11A1: Detailed Quality Indications;"
-                            "emis_error_11A1;mod11A1: Average Emissivity Error Classes;"
-                            "lst_error_11A1;mod11A1: Average LST Error Classes;"
-                            "data_quality_flag_11A2;mod11A2: Detailed Quality Indications;"
-                            "emis_error_11A2;mod11A2: Average Emissivity Error Classes;"
-                            "mandatory_qa_11A2;mod11A2: MODIS Land General Quality Assessment;"
-                            "lst_error_11A2;mod11A2: Average LST Error Classes;"
-                            "aerosol_quantity;mod09A1s: StateQA Internal Snow Mask"
-                            "brdf_correction_performed;mod09A1s: StateQA Internal Snow Mask"
-                            "cirrus_detected;mod09A1s: StateQA Internal Snow Mask"
-                            "cloud_shadow;mod09A1s: StateQA Internal Snow Mask"
-                            "cloud_state;mod09A1s: StateQA Internal Snow Mask"
-                            "internal_cloud_algorithm;mod09A1s: StateQA Internal Snow Mask"
-                            "internal_fire_algorithm;mod09A1s: StateQA Internal Snow Mask"
-                            "internal_snow_mask;mod09A1s: StateQA Internal Snow Mask"
-                            "land_water;mod09A1s: StateQA Internal Snow Mask"
-                            "mod35_snow_ice;mod09A1s: StateQA Internal Snow Mask"
-                            "pixel_adjacent_to_cloud;mod09A1s: StateQA Internal Snow Mask"
-);
-    input1->answer = "modland_qa_bits";
+    input = G_define_standard_option(G_OPT_R_INPUT);
+    input->description =
+	_("Name of input surface reflectance QC layer [bit array]");
 
-    input2 = G_define_standard_option(G_OPT_R_INPUT);
-    input2->description =
-	_("Name of the surface reflectance QC layer [bit array]");
+    output = G_define_standard_option(G_OPT_R_OUTPUT);
+    output->key = "output";
+    output->description =
+	_("Name for output QC type classification layer");
 
+    productname = G_define_option();
+    productname->key = "productname";
+    productname->type = TYPE_STRING;
+    productname->required = YES;
+    productname->description = _("Name of MODIS product type");
+    productname->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);");
+    productname->options = "mod09Q1,mod09A1,mod09A1s,mod11A1,mod11A2";
+    productname->answer = "mod09Q1";
+
+    qcname = G_define_option();
+    qcname->key = "qcname";
+    qcname->type = TYPE_STRING;
+    qcname->required = YES;
+    qcname->description = _("Name of QC type to extract");
+    qcname->descriptions = _("adjcorr;mod09: Adjacency Correction;"
+			     "atcorr;mod09: Atmospheric Correction;"
+			     "cloud;mod09: Cloud State;"
+			     "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_11A1;mod11A1: MODIS Land General Quality Assessment;"
+			     "data_quality_flag_11A1;mod11A1: Detailed Quality Indications;"
+			     "emis_error_11A1;mod11A1: Average Emissivity Error Classes;"
+			     "lst_error_11A1;mod11A1: Average LST Error Classes;"
+			     "data_quality_flag_11A2;mod11A2: Detailed Quality Indications;"
+			     "emis_error_11A2;mod11A2: Average Emissivity Error Classes;"
+			     "mandatory_qa_11A2;mod11A2: MODIS Land General Quality Assessment;"
+			     "lst_error_11A2;mod11A2: Average LST Error Classes;"
+			     "aerosol_quantity;mod09A1s: StateQA Internal Snow Mask;"
+			     "brdf_correction_performed;mod09A1s: StateQA Internal Snow Mask;"
+			     "cirrus_detected;mod09A1s: StateQA Internal Snow Mask;"
+			     "cloud_shadow;mod09A1s: StateQA Internal Snow Mask;"
+			     "cloud_state;mod09A1s: StateQA Internal Snow Mask;"
+			     "internal_clou_algorithm;mod09A1s: StateQA Internal Snow Mask;"
+			     "internal_fire_algorithm;mod09A1s: StateQA Internal Snow Mask;"
+			     "internal_snow_mask;mod09A1s: StateQA Internal Snow Mask;"
+			     "land_water;mod09A1s: StateQA Internal Snow Mask;"
+			     "mod35_snow_ice;mod09A1s: StateQA Internal Snow Mask;"
+			     "pixel_adjacent_to_cloud;mod09A1s: StateQA Internal Snow Mask;"
+			     );
+    qcname->options = "adjcorr,atcorr,cloud,data_quality,diff_orbit_from_500m,modland_qa_bits,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_clou_algorithm,internal_fire_algorithm,internal_snow_mask,land_water,mod35_snow_ice,pixel_adjacent_to_cloud";
+    qcname->answer = "modland_qa_bits";
+
     input_band = G_define_option();
     input_band->key = "band";
-    input_band->type = TYPE_INTEGER;
+    input_band->type = TYPE_STRING;
     input_band->required = NO;
-    input_band->gisprompt = "old,value";
     input_band->description =
-	_("Band number of Modis product mod09Q1=[1,2],mod09A1=[1-7]");
+	_("Band number of Modis product (mod09Q1=[1,2],mod09A1=[1-7])");
     input_band->descriptions =_("1;mod09Q1/A1 Band 1: Red;"
                                 "2;mod09Q1/A1 Band 2: NIR;"
                                 "3;mod09A1 Band 3: Blue;"
@@ -155,20 +162,15 @@
                                 "5;mod09A1 Band 5: SWIR 1;"
                                 "6;mod09A1 Band 6: SWIR 2;"
                                 "7;mod09A1 Band 7: SWIR 3;");
-
-    output = G_define_standard_option(G_OPT_R_OUTPUT);
-    output->key = "output";
-    output->description =
-	_("Name of the output QC type classification layer");
-    output->answer = "qc";
-
+    input_band->options = "1,2,3,4,5,6,7";
+    
     /********************/ 
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-    product = input->answer;
-    qcflag = input1->answer;
-    qcchan = input2->answer;
+    product = productname->answer;
+    qcflag = qcname->answer;
+    qcchan = input->answer;
     if (input_band->answer)
 	bandno = atoi(input_band->answer);
 



More information about the grass-commit mailing list