Changeset 33613
- Timestamp:
- Sep 30, 2008, 3:19:18 AM (16 years ago)
- Location:
- grass/trunk/imagery/i.vi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/imagery/i.vi/i.vi.html
r33581 r33613 1 1 <H2>DESCRIPTION</H2> 2 2 3 <EM>i.vi</EM> calculates vegetation indices based on biophysical parameters. 3 <EM>i.vi</EM> calculates vegetation indices based on biophysical 4 parameters. 4 5 5 1. RVI: ratio vegetation index: 6 2. NDVI: Normalized Difference Vegetation Index 7 3: IPVI: Infrared Percentage Vegetation Index 8 4: DVI: Difference Vegetation Index 9 5: PVI: Perpendicular Vegetation Index 10 6: WDVI: Weighted Difference Vegetation Index 11 7: SAVI: Soil Adjusted Vegetation Index 12 8: GARI: Green atmospherically resistant vegetation index 13 9: MSAVI: Modified Soil Adjusted Vegetation Index 14 10:MSAVI2: second Modified Soil Adjusted Vegetation Index 15 11:GEMI: Global Environmental Monitoring Index 16 12:ARVI: atmospherically resistant vegetation indices 17 13:GVI: Green Vegetation Index 6 <ul> 7 <li>RVI: ratio vegetation index</li> 8 <li>NDVI: Normalized Difference Vegetation Index</li> 9 <li>IPVI: Infrared Percentage Vegetation Index</li> 10 <li>DVI: Difference Vegetation Index</li> 11 <li>PVI: Perpendicular Vegetation Index</li> 12 <li>WDVI: Weighted Difference Vegetation Index</li> 13 <li>SAVI: Soil Adjusted Vegetation Index</li> 14 <li>GARI: Green atmospherically resistant vegetation index</li> 15 <li>MSAVI: Modified Soil Adjusted Vegetation Index</li> 16 <li>MSAVI2: second Modified Soil Adjusted Vegetation Index</li> 17 <li>GEMI: Global Environmental Monitoring Index</li> 18 <li>ARVI: atmospherically resistant vegetation indices</li> 19 <li>GVI: Green Vegetation Index</li> 20 </ul> 18 21 22 <pre> 19 23 NDVI 20 24 Data Type Band Numbers ([IR, Red]) … … 27 31 28 32 (AVHRR) NDVI = (channel 2 - channel 1) / (channel 2 + channel 1) 29 33 </pre> 30 34 31 35 <H2>NOTES</H2> 36 37 <pre> 32 38 Originally from kepler.gps.caltech.edu 33 39 A FAQ on Vegetation in Remote Sensing … … 41 47 Mail Code 170-25 42 48 Pasadena, CA 91125 43 44 <H2>TODO</H2> 45 49 </pre> 46 50 47 51 <H2>SEE ALSO</H2> 48 52 49 53 <em> 50 <A HREF="i.albedo.html">i.albedo</A><br>54 <a href="i.albedo.html">i.albedo</a> 51 55 </em> 52 56 53 57 54 58 <H2>AUTHORS</H2> 55 Baburao Kamble, Asian Institute of Technology, Thailand<BR> 56 Yann Chemin, Asian Institute of Technology, Thailand<BR> 57 59 Baburao Kamble, Asian Institute of Technology, Thailand<br> 60 Yann Chemin, Asian Institute of Technology, Thailand<br> 58 61 59 62 <p> -
grass/trunk/imagery/i.vi/main.c
r33586 r33613 73 73 74 74 module = G_define_module(); 75 module->keywords = _("vegetation index, biophysical parameters"); 76 module->description = 77 _("14 types of vegetation indices from red and nir, and only some requiring additional bands"); 78 75 module->keywords = _("imagery, vegetation index, biophysical parameters"); 76 module->label = 77 _("Calculates different types of vegetation indices."); 78 module->description = _("Uses red and nir, " 79 "and only some requiring additional bands."); 80 79 81 /* Define the different options */ 80 82 input1 = G_define_option(); … … 82 84 input1->type = TYPE_STRING; 83 85 input1->required = YES; 84 input1->gisprompt = _("Name of VI"); 85 input1->description = 86 _("Name of VI: sr,ndvi,ipvi,dvi,evi,pvi,wdvi,savi,msavi,msavi2,gemi,arvi,gvi,gari."); 87 88 input1->answer = _("ndvi"); 86 input1->description = _("Name of vegetation index"); 87 input1->descriptions =_("sr;???" 88 "ndvi;Normalized Difference Vegetation Index;" 89 "ipvi;Infrared Percentage Vegetation Index;" 90 "dvi;Difference Vegetation Index;" 91 "evi;???" 92 "pvi;Perpendicular Vegetation Index;" 93 "wdvi;Weighted Difference Vegetation Index;" 94 "savi;Soil Adjusted Vegetation Index;" 95 "msavi;Modified Soil Adjusted Vegetation Index;" 96 "msavi2;second Modified Soil Adjusted Vegetation Index;" 97 "gemi;Global Environmental Monitoring Index;" 98 "arvi;Atmospherically Resistant Vegetation Indices;" 99 "gvi;Green Vegetation Index;" 100 "gari;Green atmospherically resistant vegetation index;"); 101 input1->answer = "ndvi"; 102 89 103 input2 = G_define_standard_option(G_OPT_R_INPUT); 90 input2->key = _("red"); 91 input2->description = 92 _("Name of the RED Channel surface reflectance map [0.0;1.0]"); 104 input2->key = "red"; 105 input2->label = 106 _("Name of the red channel surface reflectance map"); 107 input2->description = _("Range: [0.0;1.0]"); 93 108 94 109 input3 = G_define_standard_option(G_OPT_R_INPUT); 95 input3->key = _("nir"); 96 input3->description = 97 _("Name of the NIR Channel surface reflectance map [0.0;1.0]"); 110 input3->key = "nir"; 111 input3->label = 112 _("Name of the nir channel surface reflectance map"); 113 input3->description = _("Range: [0.0;1.0]"); 98 114 99 115 input4 = G_define_standard_option(G_OPT_R_INPUT); 100 input4->key = _("green");116 input4->key = "green"; 101 117 input4->required = NO; 102 input4->description = 103 _("Name of the GREEN Channel surface reflectance map [0.0;1.0]"); 104 118 input4->label = 119 _("Name of the green channel surface reflectance map"); 120 input4->description = _("Range: [0.0;1.0]"); 121 105 122 input5 = G_define_standard_option(G_OPT_R_INPUT); 106 input5->key = _("blue");123 input5->key = "blue"; 107 124 input5->required = NO; 108 input5->description = 109 _("Name of the BLUE Channel surface reflectance map [0.0;1.0]"); 125 input5->label = 126 _("Name of the blue channel surface reflectance map"); 127 input5->description = _("Range: [0.0;1.0]"); 110 128 111 129 input6 = G_define_standard_option(G_OPT_R_INPUT); 112 input6->key = _("chan5");130 input6->key = "chan5"; 113 131 input6->required = NO; 114 input6->description = 115 _("Name of the CHAN5 Channel surface reflectance map [0.0;1.0]"); 132 input6->label = 133 _("Name of the chan5 channel surface reflectance map"); 134 input6->description = _("Range: [0.0;1.0]"); 116 135 117 136 input7 = G_define_standard_option(G_OPT_R_INPUT); 118 input7->key = _("chan7");137 input7->key = "chan7"; 119 138 input7->required = NO; 120 input7->description = 121 _("Name of the CHAN7 Channel surface reflectance map [0.0;1.0]"); 139 input7->label = 140 _("Name of the chan7 channel surface reflectance map"); 141 input7->description = _("Range: [0.0;1.0]"); 122 142 123 143 output = G_define_standard_option(G_OPT_R_OUTPUT); 124 output->description = _("Name of the output vi layer");125 144 126 145 if (G_parser(argc, argv)) … … 137 156 138 157 if ((infd_redchan = G_open_cell_old(redchan, "")) < 0) 139 G_fatal_error(_(" Cannot open cell file [%s]"), redchan);158 G_fatal_error(_("Unable to open raster map <%s>"), redchan); 140 159 inrast_redchan = G_allocate_d_raster_buf(); 141 160 142 161 if ((infd_nirchan = G_open_cell_old(nirchan, "")) < 0) 143 G_fatal_error(_(" Cannot open cell file [%s]"), nirchan);162 G_fatal_error(_("Unable to open raster map <%s>"), nirchan); 144 163 inrast_nirchan = G_allocate_d_raster_buf(); 145 164 146 165 if (greenchan) { 147 166 if ((infd_greenchan = G_open_cell_old(greenchan, "")) < 0) 148 G_fatal_error(_(" Cannot open cell file [%s]"), greenchan);167 G_fatal_error(_("Unable to open raster map <%s>"), greenchan); 149 168 inrast_greenchan = G_allocate_d_raster_buf(); 150 169 } … … 152 171 if (bluechan) { 153 172 if ((infd_bluechan = G_open_cell_old(bluechan, "")) < 0) 154 G_fatal_error(_(" Cannot open cell file [%s]"), bluechan);173 G_fatal_error(_("Unable to open raster map <%s>"), bluechan); 155 174 inrast_bluechan = G_allocate_d_raster_buf(); 156 175 } … … 158 177 if (chan5chan) { 159 178 if ((infd_chan5chan = G_open_cell_old(chan5chan, "")) < 0) 160 G_fatal_error(_(" Cannot open cell file [%s]"), chan5chan);179 G_fatal_error(_("Unable to open raster map <%s>"), chan5chan); 161 180 inrast_chan5chan = G_allocate_d_raster_buf(); 162 181 } … … 164 183 if (chan7chan) { 165 184 if ((infd_chan7chan = G_open_cell_old(chan7chan, "")) < 0) 166 G_fatal_error(_(" Cannot open cell file [%s]"), chan7chan);185 G_fatal_error(_("Unable to open raster map <%s>"), chan7chan); 167 186 inrast_chan7chan = G_allocate_d_raster_buf(); 168 187 } … … 174 193 /* Create New raster files */ 175 194 if ((outfd = G_open_raster_new(result, DCELL_TYPE)) < 0) 176 G_fatal_error(_(" Could not open<%s>"), result);195 G_fatal_error(_("Unable to create raster map <%s>"), result); 177 196 178 197 /* Process pixels */ 179 198 for (row = 0; row < nrows; row++) 180 199 { 181 DCELL d;182 200 DCELL d_bluechan; 183 201 DCELL d_greenchan; … … 190 208 191 209 if (G_get_d_raster_row(infd_redchan, inrast_redchan, row) < 0) 192 G_fatal_error(_("Could not read from <%s>"), redchan); 210 G_fatal_error(_("Unable to read raster map <%s> row %d"), 211 redchan, row); 193 212 if (G_get_d_raster_row(infd_nirchan, inrast_nirchan, row) < 0) 194 G_fatal_error(_("Could not read from <%s>"), nirchan); 213 G_fatal_error(_("Unable to read raster map <%s> row %d"), 214 nirchan, row); 195 215 if (greenchan) { 196 216 if (G_get_d_raster_row(infd_greenchan, inrast_greenchan, row) < 0) 197 G_fatal_error(_("Could not read from <%s>"), greenchan); 217 G_fatal_error(_("Unable to read raster map <%s> row %d"), 218 greenchan, row); 198 219 } 199 220 if (bluechan) { 200 221 if (G_get_d_raster_row(infd_bluechan, inrast_bluechan, row) < 0) 201 G_fatal_error(_("Could not read from <%s>"), bluechan); 222 G_fatal_error(_("Unable to read raster map <%s> row %d"), 223 bluechan, row); 202 224 } 203 225 if (chan5chan) { 204 226 if (G_get_d_raster_row(infd_chan5chan, inrast_chan5chan, row) < 0) 205 G_fatal_error(_("Could not read from <%s>"), chan5chan); 227 G_fatal_error(_("Unable to read raster map <%s> row %d"), 228 chan5chan, row); 206 229 } 207 230 if (chan7chan) { 208 231 if (G_get_d_raster_row(infd_chan7chan, inrast_chan7chan, row) < 0) 209 G_fatal_error(_("Could not read from <%s>"), chan7chan); 232 G_fatal_error(_("Unable to read raster map <%s> row %d"), 233 chan7chan, row); 210 234 } 211 235 … … 280 304 } 281 305 if (G_put_d_raster_row(outfd, outrast) < 0) 282 G_fatal_error(_("Cannot write to output raster file")); 306 G_fatal_error(_("Failed writing raster map <%s> row %d"), 307 result, row); 283 308 } 284 309 … … 313 338 G_command_history(&history); 314 339 G_write_history(result, &history); 340 315 341 exit(EXIT_SUCCESS); 316 342 }
Note:
See TracChangeset
for help on using the changeset viewer.
