summaryrefslogtreecommitdiff
path: root/contrib/skyview.php
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2008-02-10 19:14:56 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2008-02-10 19:14:56 +0000
commitcd89a454740936e15e836ffc3ca118674589aef4 (patch)
treece5fe2e2e2029dc13be6a5c46458348a7cd28957 /contrib/skyview.php
parentdc05a08337cde5e588f3fd2351327569d198c859 (diff)
downloadgpsd-cd89a454740936e15e836ffc3ca118674589aef4.tar.gz
stop slurping the whole file into a buffer in memory;
just pull in a line at a time. also, change the colour scheme a bit so unusably weak sectors are set to a dark gray.
Diffstat (limited to 'contrib/skyview.php')
-rwxr-xr-xcontrib/skyview.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/skyview.php b/contrib/skyview.php
index 58efd99a..e127a271 100755
--- a/contrib/skyview.php
+++ b/contrib/skyview.php
@@ -36,8 +36,9 @@ legend($im, $sz, $C);
$sky = array();
-$lines = file($argv[1]);
-foreach ($lines as $line_num => $line) {
+$fd = @fopen($argv[1], 'r');
+while (!feof($fd)){
+ $line = fgets($fd);
if (preg_match('/,Y=\S+ [0-9\.]+ (\d+):/', $line, $m)){
$n = $m[1];
$s = explode(':', $line);
@@ -159,8 +160,8 @@ function cellplot($im, $sz, $C, $cellsize, $e){
$color = $C['yellow'];
if ($snr < 30)
$color = $C['red'];
- if ($snr == 0)
- $color = $C['black'];
+ if ($snr < 15)
+ $color = $C['dkgray'];
#consider an N-degree cell plotted at (0,0). its top left corner
#will be (0,0) and its bottom right corner will be at (N,N). The