Data processing
Changing the comma as decimal seperator
Depending on the selected language of the operating system, behindLight
seperates decimal places and integers with a comma. Sometimes it might be
helpful to change these commas to dots. This can be obtained by the search and
replace function of nearly any text editor or text processing software. One of
the fastest ways is to use sed
(project's homepage),
particular useful for batch processing of multiple sic
-files:
$> cat datafile.sic | sed -e s/,/\./g > newdatafile.sic
Converting sic
to ras
-format
behindLight stores data in the following order: x, y,
z [,additional recorded value]. There is the
ras
-file format that uses y, x, z [,additional recorded
value]. To convert files between these two formats you could use
awk
(gawk at gnu.org), also very useful for batch
processing:
$> cat datafile.sic | awk '{ print $2" "$1" "$3" "$4 }' > datafile.ras
Filtering the image
If you want the ground, the sample is attached to, to be flattened, one easy way is to substract a certain value from the z-data and set every value less than zero to zero. This simple command line php script sets everything containing a minus-sign to zero:
#!/usr/bin/php <?php $file = $argv[1]; $outfile= $argv[2]; if ($argv[2] === null) $outfile=$file; $lines = file($file); $handle = fopen($outfile,"w"); foreach ($lines as $line){ list($x,$y,$z) = split (" ",$line); if( strpos($z,"-") === false){ fwrite($handle, $line); } else { fwrite($handle, $x." ".$y." 0\n"); } } ?>