From 9ca403c4d108a895e614373b00201ba23b3acd87 Mon Sep 17 00:00:00 2001 From: Alex Farrant Date: Sat, 24 Dec 2016 19:39:41 +0000 Subject: [PATCH] ITM model reliability re-enabled --- inputs.cc | 10 +++++----- main.cc | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/inputs.cc b/inputs.cc index f4594f9..9245766 100644 --- a/inputs.cc +++ b/inputs.cc @@ -128,7 +128,7 @@ int loadClutter(char *filename, double radius, struct site tx) void readLIDAR(FILE *fd, int h, int w, int indx,double n, double e, double s, double west) { int x = 0, y = 0, reads = 0, a=0, b=0, avg=0, tWidth = 0, tHeight = 0; - char line[150000]; + char line[25000]; char *pch; dem[indx].max_north=n; @@ -180,7 +180,7 @@ void readLIDAR(FILE *fd, int h, int w, int indx,double n, double e, double s, do for (y = h-1; y > -1; y--) { x = w-1; - if (fgets(line, 150000, fd) != NULL) { + if (fgets(line, 25000, fd) != NULL) { pch = strtok(line, " "); // split line into values while (pch != NULL && x > -1) { @@ -220,7 +220,7 @@ int loadLIDAR(char *filenames) double xll, yll, xur, yur, cellsize, avgCellsize; char found, free_page = 0, jline[20], lid_file[255], path_plus_name[255], *junk = NULL; - char line[100000]; + char line[25000]; char * pch; double TO_DEG = (180 / PI); FILE *fd; @@ -259,8 +259,8 @@ int loadLIDAR(char *filenames) }else{ IPPD = height; } - // add fudge as reprojected tiles sometimes vary by a pixel or two - IPPD+=5; + // add fudge as reprojected tiles sometimes vary by a pixel or ten + IPPD+=10; ARRAYSIZE = (MAXPAGES * IPPD) + 10; do_allocs(); dem_alloced = 1; diff --git a/main.cc b/main.cc index 3e68c44..20bb00c 100644 --- a/main.cc +++ b/main.cc @@ -1,4 +1,4 @@ -double version = 2.94; +double version = 2.95; /****************************************************************************\ * Signal Server: Radio propagation simulator by Alex Farrant QCVS, 2E0TDW * ****************************************************************************** @@ -1041,7 +1041,7 @@ int main(int argc, char *argv[]) if (strstr(argv[0], "signalserverLIDAR")) { MAXPAGES = 100; // 10x10 lidar = 1; - IPPD = 5000; // will be overridden based upon file header... + IPPD = 6000; // will be overridden based upon file header... } strncpy(ss_name, "Signal Server\0", 14); @@ -1075,6 +1075,7 @@ int main(int argc, char *argv[]) fprintf(stdout, " -terdic Terrain dielectric value 2-80 (optional)\n"); fprintf(stdout, " -tercon Terrain conductivity 0.01-0.0001 (optional)\n"); fprintf(stdout, " -cl Climate code 1-6 (optional)\n"); + fprintf(stdout, " -rel Reliability for ITM model 50 to 99 (optional)\n"); fprintf(stdout, "Output:\n"); fprintf(stdout, " -dbm Plot Rxd signal power instead of field strength\n"); fprintf(stdout, " -rt Rx Threshold (dB / dBm / dBuV/m)\n"); @@ -1480,6 +1481,18 @@ int main(int argc, char *argv[]) z = x + 1; use_threads = false; } + + // Reliability % for ITM model + if (strcmp(argv[x], "-rel") == 0) { + z = x + 1; + + if (z <= y && argv[z][0]) { + sscanf(argv[z], "%lf", &LR.rel); + sscanf(argv[z], "%lf", &LR.conf); + LR.rel=LR.rel/100; + LR.conf=LR.conf/100; + } + } } /* ERROR DETECTION */