(sorry for the barrage of emails, i'm finagling with nnbathy today and having some problems with import/exporting into grass). Ok, so the awk suggestions worked wonders to fix my xyz file. Now when I do an r.in.xyz, its failing because nnbathy outputted a NaN z-value for a couple of locations. Any tricks to getting r.in.xyz to just ignore NaN or do I need to do some more awk magic?
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
Cell: 415-794-5043
AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307
You can use sed to find and replace patterns within a file. So;
~> cat temp.txt
1619923.0297213|4836235.79480289|0.01571819
1619927.57223432|4836235.09835698|nan
1619910.45256599|4836241.22590928|6.82026114
To make a substitution
~> sed 's/nan/-9999/g' ./temp.txt
1619923.0297213|4836235.79480289|0.01571819
1619927.57223432|4836235.09835698|-9999
1619910.45256599|4836241.22590928|6.82026114
To remove the offending line
->sed '/nan/d' ./temp.txt
1619923.0297213|4836235.79480289|0.01571819
1619910.45256599|4836241.22590928|6.82026114
Cheers,
Mike
On 18-Jan-08, at 3:51 PM, Jonathan Greenberg wrote:
(sorry for the barrage of emails, i'm finagling with nnbathy today and having some problems with import/exporting into grass). Ok, so the awk suggestions worked wonders to fix my xyz file. Now when I do an r.in.xyz, its failing because nnbathy outputted a NaN z-value for a couple of locations. Any tricks to getting r.in.xyz to just ignore NaN or do I need to do some more awk magic?
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
Cell: 415-794-5043
AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
On 18/01/08 23:51, Jonathan Greenberg wrote:
(sorry for the barrage of emails, i'm finagling with nnbathy today and having some problems with import/exporting into grass). Ok, so the awk suggestions worked wonders to fix my xyz file. Now when I do an r.in.xyz, its failing because nnbathy outputted a NaN z-value for a couple of locations. Any tricks to getting r.in.xyz to just ignore NaN or do I need to do some more awk magic?
Also check the r.surf.nnbathy add-on script available at
http://grass.gdf-hannover.de/wiki/GRASS_AddOns#Raster_add-ons
This should give you an idea of how to manage the interaction between grass and nnbathy.
Moritz