Package: splat
Version: 1.2.1-2
Followup-For: Bug #498443

I received the following message from John Magliacane, developer of SPLAT!:

Hi Nate.

Sorry to hear you're getting a blank graph.  As it turns out, that's
normal based on some assumptions I made when I wrote the program.  The
elevation angles at short distances tend to be largely negative, and to
display them over a fairly long path would significantly reduce the detail
in the resulting elevation plot.

So, I added a conditional statement in the GraphElevation() function that
modifies the y-range of the plot over short (2 mile or less) distances.

Please try replacing the existing GraphElevation() function with the
attached code and re-compile.

Let me know how it works out for you.

Thanks for bringing this to my attention.

73, de John, KD2BD



The patch he supplied applies to version 1.2.3 as I had tried the latest
source version to see if the bug was still present.  I can report that
his patch does work and I get the expected plot on the graph.

- Nate >>

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.25-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages splat depends on:
ii  gnuplot                4.2.3-1           A command-line driven interactive 
ii  libbz2-1.0             1.0.5-1           high-quality block-sorting file co
ii  libc6                  2.7-13            GNU C Library: Shared libraries
ii  libgcc1                1:4.3.1-9         GCC support library
ii  libstdc++6             4.3.1-9           The GNU Standard C++ Library v3
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

splat recommends no packages.

splat suggests no packages.

-- no debconf information
--- splat.cpp.orig	2008-07-21 09:46:23.000000000 -0500
+++ splat.cpp	2008-09-11 18:54:55.000000000 -0500
@@ -4656,12 +4656,13 @@
 
 	int	x, y, z;
 	char	basename[255], term[30], ext[15];
-	double	angle, refangle, maxangle=-90.0;
+	double	angle, refangle, maxangle=-90.0, minangle=90.0, distance;
 	struct	site remote;
 	FILE	*fd=NULL, *fd2=NULL;
 
 	ReadPath(destination,source);  /* destination=RX, source=TX */
 	refangle=ElevationAngle(destination,source);
+	distance=Distance(source,destination);
 
 	fd=fopen("profile.gp","wb");
 	fd2=fopen("reference.gp","wb");
@@ -4687,6 +4688,9 @@
 
 		if (angle>maxangle)
 			maxangle=angle;
+
+		if (angle<minangle)
+			minangle=angle;
 	}
 
 	if (metric)
@@ -4755,18 +4759,23 @@
 	fd=fopen("splat.gp","w");
 
 	fprintf(fd,"set grid\n");
-	fprintf(fd,"set yrange [%2.3f to %2.3f]\n", (-fabs(refangle)-0.25), maxangle+0.25);
+
+	if (distance>2.0)
+		fprintf(fd,"set yrange [%2.3f to %2.3f]\n", (-fabs(refangle)-0.25), maxangle+0.25);
+	else
+		fprintf(fd,"set yrange [%2.3f to %2.3f]\n", minangle, refangle+(-minangle/8.0));
+
 	fprintf(fd,"set encoding iso_8859_1\n");
 	fprintf(fd,"set term %s\n",term);
-	fprintf(fd,"set title \"SPLAT! Elevation Profile Between %s and %s (%.2f%c azimuth)\"\n",destination.name,source.name,Azimuth(destination,source),176);
+	fprintf(fd,"set title \"%s Elevation Profile Between %s and %s (%.2f%c azimuth)\"\n","SPLAT-1.2.3",destination.name,source.name,Azimuth(destination,source),176);
 
 	if (metric)
-		fprintf(fd,"set xlabel \"Distance Between %s and %s (%.2f kilometers)\"\n",destination.name,source.name,KM_PER_MILE*Distance(source,destination));
+		fprintf(fd,"set xlabel \"Distance Between %s and %s (%.2f kilometers)\"\n",destination.name,source.name,KM_PER_MILE*distance);
 	else
-		fprintf(fd,"set xlabel \"Distance Between %s and %s (%.2f miles)\"\n",destination.name,source.name,Distance(source,destination));
+		fprintf(fd,"set xlabel \"Distance Between %s and %s (%.2f miles)\"\n",destination.name,source.name,distance);
 
 
-	fprintf(fd,"set ylabel \"Elevation Angle Along LOS Path Between %s and %s (degrees)\"\n",destination.name,source.name);
+	fprintf(fd,"set ylabel \"Elevation Angle Along LOS Path Between\\n%s and %s (degrees)\"\n",destination.name,source.name);
 	fprintf(fd,"set output \"%s.%s\"\n",basename,ext);
 	fprintf(fd,"plot \"profile.gp\" title \"Real Earth Profile\" with lines, \"reference.gp\" title \"Line of Sight Path (%.2f%c elevation)\" with lines\n",refangle,176);
 
@@ -4791,6 +4800,7 @@
 		fprintf(stderr,"\n*** ERROR: Error occurred invoking gnuplot!\n");
 }
 
+
 void GraphHeight(struct site source, struct site destination, char *name, double f, unsigned char n)
 {
 	/* This function invokes gnuplot to generate an appropriate

Reply via email to