From 8277fc820ed421cc1f75b29e19beff8a57b773ae Mon Sep 17 00:00:00 2001 From: root Date: Sun, 23 Jul 2017 11:40:40 +0100 Subject: [PATCH] cropping fix --- CHANGELOG | 3 +++ Makefile | 2 +- main.cc | 10 ++++++---- models/los.cc | 11 ++++++----- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 78bd7cf..bee5b60 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ SIGNAL SERVER CHANGELOG +3.06 - 23 June 2017 +Cropping edge cases with > 100km and LOS + 3.05 - 18 June 2017 LIDAR overhaul for mismatched tiles and different resolutions. No longer expects x/y grid of tiles of equal size. Dynamic resampling so user can specify *any* resolution less than maximum resolution of data. diff --git a/Makefile b/Makefile index 56926bb..828162f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/sh CC = gcc CXX = g++ -CFLAGS = -Wall -O3 -s -ffast-math +CFLAGS = -Wall -O3 -s -ffast-math -DCROPPING CXXFLAGS = -Wall -O3 -s -ffast-math LIBS = -lm -lpthread -ldl diff --git a/main.cc b/main.cc index cc58cb4..0c73a85 100644 --- a/main.cc +++ b/main.cc @@ -57,7 +57,7 @@ int ippd, mpi, unsigned char got_elevation_pattern, got_azimuth_pattern, metric = 0, dbm = 0; -bool to_stdout = false, cropping = false; +bool to_stdout = false, cropping = true; __thread double *elev; __thread struct path path; @@ -1853,8 +1853,12 @@ int main(int argc, char *argv[]) } } + if(max_range>100){ + cropping=false; + } if (ppa == 0) { if (propmodel == 2) { + cropping = false; PlotLOSMap(tx_site[0], altitudeLR, ano_filename, use_threads); DoLOS(mapfile, geo, kml, ngs, tx_site, txsites); } else { @@ -1881,8 +1885,7 @@ int main(int argc, char *argv[]) } } -#ifdef CROPPING - if(max_range<=100){ + if(cropping){ // CROPPING. croplat assigned in propPathLoss() max_north=cropLat; // MAX(path.lat[y]) // Edge case #1 - EAST/WEST @@ -1903,7 +1906,6 @@ int main(int argc, char *argv[]) return 0; } } -#endif // Write bitmap if (LR.erp == 0.0) diff --git a/models/los.cc b/models/los.cc index 670add2..fd49d2f 100644 --- a/models/los.cc +++ b/models/los.cc @@ -242,8 +242,9 @@ void PlotLOSPath(struct site source, struct site destination, char mask_value, double distance, rx_alt, tx_alt; ReadPath(source, destination); - - for (y = 0; y < path.length; y++) { + for (y = 0; (y < (path.length - 1) && path.distance[y] <= max_range); + y++) { + //for (y = 0; y < path.length; y++) { /* Test this point only if it hasn't been already tested and found to be free of obstructions. */ @@ -338,13 +339,13 @@ void PlotPropPath(struct site source, struct site destination, Longley-Rice. This information is required for properly integrating the antenna's elevation pattern into the calculation for overall path loss. */ - if(debug) - fprintf(stderr,"four_thirds_earth %.1f source.alt %.1f path.elevation[0] %.1f\n",four_thirds_earth,source.alt,path.elevation[0]); + //if(debug) + // fprintf(stderr,"four_thirds_earth %.1f source.alt %.1f path.elevation[0] %.1f\n",four_thirds_earth,source.alt,path.elevation[0]); for (y = 2; (y < (path.length - 1) && path.distance[y] <= max_range); y++) { /* Process this point only if it has not already been processed. */ - + if ( (GetMask(path.lat[y], path.lon[y]) & 248) != (mask_value << 3) && can_process(path.lat[y], path.lon[y])) {