[GRASS-SVN] r60159 - grass-addons/grass7/imagery/i.feo_tio2

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 9 08:06:24 PDT 2014


Author: ychemin
Date: 2014-05-09 08:06:24 -0700 (Fri, 09 May 2014)
New Revision: 60159

Modified:
   grass-addons/grass7/imagery/i.feo_tio2/clementine_mapplanet.c
   grass-addons/grass7/imagery/i.feo_tio2/feo.c
   grass-addons/grass7/imagery/i.feo_tio2/main.c
Log:
fixed bugs, added Zhang et al. (2013) real equation

Modified: grass-addons/grass7/imagery/i.feo_tio2/clementine_mapplanet.c
===================================================================
--- grass-addons/grass7/imagery/i.feo_tio2/clementine_mapplanet.c	2014-05-09 14:56:00 UTC (rev 60158)
+++ grass-addons/grass7/imagery/i.feo_tio2/clementine_mapplanet.c	2014-05-09 15:06:24 UTC (rev 60159)
@@ -3,7 +3,7 @@
 
 double feolucey2000(double uvvis2, double uvvis4){
 	 //\cite{lucey2000lunar}
-	 return(17.427*(-atan2f(((uvvis4/uvvis2)-1.19)/(uvvis2-0.08)))-7.565);
+	 return(17.427*(-atan2f(((uvvis4/uvvis2)-1.19),(uvvis2-0.08)))-7.565);
 }
 
 double feolawrence2002(double uvvis2, double uvvis4){
@@ -28,6 +28,6 @@
 
 double tio2lucey2000(double uvvis1, double uvvis2){
 	 //\cite{lucey2000lunar}
-	 return(3.708*pow((atan2f(((uvvis1/uvvis2)-0.42)/(uvvis2-0.0))),5.979));
+	 return(3.708*pow((atan2f(((uvvis1/uvvis2)-0.42),(uvvis2-0.0))),5.979));
 }
 

Modified: grass-addons/grass7/imagery/i.feo_tio2/feo.c
===================================================================
--- grass-addons/grass7/imagery/i.feo_tio2/feo.c	2014-05-09 14:56:00 UTC (rev 60158)
+++ grass-addons/grass7/imagery/i.feo_tio2/feo.c	2014-05-09 15:06:24 UTC (rev 60159)
@@ -7,3 +7,16 @@
 {
     return (-137.97 *( r750 * sin(theta) + (r950/r750) * cos(theta) ) + 57.46);
 }
+
+/*@inproceedings{zhang2013mapping,
+  title={Mapping lunar TiO2 and FeO with Chandrayaan-1 M3 Data},
+  author={Zhang, W and Bowles, NE},
+  booktitle={Lunar and Planetary Institute Science Conference Abstracts},
+  volume={44},
+  pages={1212},
+  year={2013}
+}*/
+double feozhang2013(double r750, double r950)
+{
+    return ( 17.83 * (-atan2f( ((r950/r750)-1.26),(r750-0.01) )) - 6.82);
+}

Modified: grass-addons/grass7/imagery/i.feo_tio2/main.c
===================================================================
--- grass-addons/grass7/imagery/i.feo_tio2/main.c	2014-05-09 14:56:00 UTC (rev 60158)
+++ grass-addons/grass7/imagery/i.feo_tio2/main.c	2014-05-09 15:06:24 UTC (rev 60159)
@@ -23,6 +23,7 @@
 #define MAXFILES 8
 double feo(double r750, double r950, double theta);
 double tio2(double r415, double r750, double y0Ti, double s0Ti);
+double feozhang2013(double r750, double r950);
 
 double feolucey2000(double uvvis2, double uvvis4);
 double feolawrence2002(double uvvis2, double uvvis4);
@@ -37,8 +38,9 @@
     int nrows, ncols;
     int row, col;
     char *equationflag;		/*Switch for particular equation */
+    char *desc;
     struct GModule *module;
-    struct Option *in0, *in1, *output, *param0, *param1;
+    struct Option *in0, *in1, *output, *param0, *param1, *eqname;
     struct Flag *flag1;
     struct History history;	/*metadata */
     struct Colors colors;	/*Color rules */
@@ -61,7 +63,9 @@
     G_add_keyword(_("imagery"));
     G_add_keyword(_("Moon"));
     G_add_keyword(_("Clementine"));
+    G_add_keyword(_("Chandrayaan1"));
     G_add_keyword(_("UVVIS"));
+    G_add_keyword(_("M3"));
     G_add_keyword(_("FeO"));
     G_add_keyword(_("TiO2"));
     G_add_keyword(_("reflectance"));
@@ -70,11 +74,11 @@
     /* Define the different options */
     in0 = G_define_standard_option(G_OPT_R_INPUT);
     in0->key = "band0";
-    in0->description = _("reflectance band at 750 nm (UVVIS 2)");
+    in0->description = _("reflectance band at 750 nm (UVVIS 2, M3 9)");
     
     in1 = G_define_standard_option(G_OPT_R_INPUT);
     in1->key = "band1";
-    in1->description = _("reflectance band at 950 nm (UVVIS 4 for FeO/OMAT) or at 415 nm (UVVIS 1 for TiO2)");
+    in1->description = _("reflectance band at 950 nm (UVVIS 4 for FeO/OMAT, M3 19) or at 415 nm (UVVIS 1 for TiO2)");
 
     output = G_define_standard_option(G_OPT_R_OUTPUT);
 
@@ -92,28 +96,29 @@
     param1->description = _("Value of s0Ti (TiO2)");
     param1->guisection = _("Parameters");
 
-    opt.eqname = G_define_option();
-    opt.eqname->key = "eqname";
-    opt.eqname->type = TYPE_STRING;
-    opt.eqname->required = YES;
-    opt.eqname->description = _("Type of equation");
+    eqname = G_define_option();
+    eqname->key = "eqname";
+    eqname->type = TYPE_STRING;
+    eqname->required = YES;
+    eqname->description = _("Type of equation");
     desc = NULL;
     G_asprintf(&desc,
 	       "feolucey2000;%s;feolawrence2002;%s;feowilcox2005_setparam;%s;"
-	       "feowilcox2005;%s;omatlucey2000;%s;omatwilcox2005;%s;"
+	       "feowilcox2005;%s;feozhang2013;%s;omatlucey2000;%s;omatwilcox2005;%s;"
 	       "tio2lucey2000_setparam;%s;tio2lucey2000;%s",
 	       _("FeO (Lucey et al., 2000)"),
 	       _("FeO (lawrence et al., 2002)"),
 	       _("FeO (Wilcox et al., 2005) set parameter theta"),
 	       _("FeO (Wilcox et al., 2005)"),
+	       _("FeO (Zhang et al., 2013)"),
 	       _("OMAT (Lucey et al., 2000)"),
 	       _("OMAT (Wilcox et al., 2005)"),
 	       _("TiO2 (Lucey et al., 2000) set parameters"),
 	       _("TiO2 (Lucey et al., 2000)"));
-    opt.eqname->descriptions = desc;
-    opt.eqname->options = "feolucey2000,feolawrence2002,feowilcox2005_setparam,feowilcox2005,omatlucey2000,omatwilcox2005,tio2lucey2000_setparam,tio2lucey2000";
-    opt.eqname->answer = "feolucey2000";
-    opt.eqname->key_desc = _("type");
+    eqname->descriptions = desc;
+    eqname->options = "feolucey2000,feolawrence2002,feowilcox2005_setparam,feowilcox2005,feozhang2013,omatlucey2000,omatwilcox2005,tio2lucey2000_setparam,tio2lucey2000";
+    eqname->answer = "feolucey2000";
+    eqname->key_desc = _("type");
 
     /* Define the different flags */
     flag1 = G_define_flag();
@@ -179,6 +184,8 @@
                     outrast[col] = feolawrence2002(d0, d1);
                 if (!strcasecmp(equationflag, "feolucey2000"))
                     outrast[col] = feolucey2000(d0, d1);
+                if (!strcasecmp(equationflag, "feozhang2013"))
+                    outrast[col] = feozhang2013(d0, d1);
                 if (!strcasecmp(equationflag, "omatwilcox2005"))
                     outrast[col] = omatwilcox2005(d0, d1);
                 if (!strcasecmp(equationflag, "omatlucey2000"))



More information about the grass-commit mailing list