[GRASS-SVN] r42787 - grass-addons/imagery/i.topo.corr
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jul 14 11:14:01 EDT 2010
Author: neteler
Date: 2010-07-14 15:14:01 +0000 (Wed, 14 Jul 2010)
New Revision: 42787
Modified:
grass-addons/imagery/i.topo.corr/correction.c
Log:
Jorge Tizado: fix for cosine correction
Modified: grass-addons/imagery/i.topo.corr/correction.c
===================================================================
--- grass-addons/imagery/i.topo.corr/correction.c 2010-07-14 15:03:19 UTC (rev 42786)
+++ grass-addons/imagery/i.topo.corr/correction.c 2010-07-14 15:14:01 UTC (rev 42787)
@@ -135,9 +135,21 @@
}
else {
ref_i = (double)*((DCELL *) pref);
- G_debug(3,"Old val: %f, cka: %f, cos_i: %f, ckb: %f, kk: %f, New val: %f", ref_i, cka, cos_i, ckb, kk, (DCELL) ref_i * pow(cka / (cos_i + ckb), kk));
- ((DCELL *) out->rast)[col] =
- (DCELL) (ref_i * pow(cka / (cos_i + ckb), kk));
+ if (method == MINNAERT) {
+ G_debug(3,
+ "Old val: %f, cka: %f, cos_i: %f, ckb: %f, kk: %f, New val: %f",
+ ref_i, cka, cos_i, ckb, kk, (DCELL) (ref_i * pow(cos_z / cos_i, kk)));
+ ((DCELL *) out->rast)[col] =
+ (DCELL) (ref_i * pow(cos_z / cos_i, kk));
+ }
+ else {
+ G_debug(3,
+ "Old val: %f, cka: %f, cos_i: %f, ckb: %f, kk: %f, New val: %f",
+ ref_i, cka, cos_i, ckb, kk, (DCELL) (ref_i * (cka / (cos_i + ckb))));
+ ((DCELL *) out->rast)[col] =
+ (DCELL) (ref_i * (cka / (cos_i + ckb)));
+ }
+
}
}
G_put_raster_row(out->fd, out->rast, out->type);
More information about the grass-commit
mailing list