forked from ExternalVendorCode/Signal-Server
2.8 LIDAR improvements
This commit is contained in:
BIN
1200.h.gch
BIN
1200.h.gch
Binary file not shown.
BIN
3600.h.gch
BIN
3600.h.gch
Binary file not shown.
@@ -1,5 +1,11 @@
|
||||
SIGNAL SERVER CHANGELOG
|
||||
|
||||
2.8 - 08 June 2016
|
||||
Widened scope of LIDAR / ASCII Grid input to include sub-meter accurate tiles. (ac000)
|
||||
Optimised memory usage (ac000)
|
||||
Tidied and refactored some code (ac000)
|
||||
Updated Readme and callsign because I passed my intermediate :)
|
||||
|
||||
2.75 - 22 Apr 2016
|
||||
Added Hata model logic for f < 200MHz
|
||||
|
||||
|
110
README.md
110
README.md
@@ -1,12 +1,12 @@
|
||||
# Signal Server
|
||||
Server optimised SPLAT! by Alex Farrant, M6ZUJ.
|
||||
Multi-threaded radio propagation simulator based upon SPLAT! by Alex Farrant QCVS, 2E0TDW.
|
||||
|
||||
SPLAT! Project started in 1997 by John A. Magliacane, KD2BD
|
||||
|
||||
This server application will generate RF coverage predictions, producing either 2D profile plots (Point-to-Point) or 360 degree polar plots in WGS-84 projection.
|
||||
This server application will generate RF coverage predictions, producing either 2D profile plots (Point-to-Point) or 360 degree polar plots in WGS-84 projection as PPM Bitmaps.
|
||||
For detailed information and historical reference data related to this project see the SPLAT! documentation. Propagation models added to this project have been sourced from reputable academic sources and all efforts have been taken to ensure their accurate implementation. Not all models are ITU ratified and you use them entirely at your own risk.
|
||||
|
||||
The accuracy of the output is directly proportional to the accuracy of the inputs and the time taken defining and validating them.
|
||||
WARNING: The accuracy of the output is directly proportional to the accuracy of the inputs and the time taken defining and validating them.
|
||||
|
||||
|
||||
## Requirements
|
||||
@@ -14,7 +14,7 @@ The accuracy of the output is directly proportional to the accuracy of the input
|
||||
* GCC,G++
|
||||
* Multicore CPU (optional)
|
||||
* ~2GB Memory
|
||||
* SRTM terrain tiles
|
||||
* SRTM terrain tile(s) or ASCII Grid tile(s)
|
||||
|
||||
Signal Server is a very resource intensive multicore application. Only publish it for common use if you know what you are doing and you are advised to wrap it with another script to perform input validation.
|
||||
|
||||
@@ -25,11 +25,16 @@ Additional programs/scripts will be required to prepare inputs such as .sdf tile
|
||||
$ make
|
||||
```
|
||||
## Parameters
|
||||
-- Signal Server 2.72 --
|
||||
```
|
||||
---| Signal Server 2.80 |---
|
||||
RF propagation simulator by Alex Farrant, 2E0TDW
|
||||
Set for 64 tiles at 1200 pixels/degree
|
||||
|
||||
-sdf Directory containing .sdf tiles
|
||||
-lid LIDAR ASCII tile with WGS84 bounds (Dimensions defined in file metadata)
|
||||
REFERENCE DATA
|
||||
-sdf Directory containing SRTM derived .sdf tiles
|
||||
-lid WGS84 ASCII grid tile (LIDAR) with dimensions and resolution defined in header
|
||||
-udt User defined CSV clutter file
|
||||
INPUT
|
||||
-lat Tx Latitude (decimal degrees) -70/+70
|
||||
-lon Tx Longitude (decimal degrees) -180/+180
|
||||
-txh Tx Height (above ground)
|
||||
@@ -38,42 +43,109 @@ $ make
|
||||
-f Tx Frequency (MHz) 20MHz to 100GHz (LOS after 20GHz)
|
||||
-erp Tx Effective Radiated Power (Watts)
|
||||
-rxh Rx Height(s) (optional. Default=0.1)
|
||||
-rt Rx Threshold (dB / dBm / dBuV/m)
|
||||
-hp Horizontal Polarisation (default=vertical)
|
||||
-gc Ground clutter (feet/meters)
|
||||
-udt User defined terrain filename
|
||||
-dbm Plot Rxd signal power instead of field strength
|
||||
-m Metric units of measurement
|
||||
-te Terrain code 1-6 (optional)
|
||||
-terdic Terrain dielectric value 2-80 (optional)
|
||||
-tercon Terrain conductivity 0.01-0.0001 (optional)
|
||||
-cl Climate code 1-6 (optional)
|
||||
OUTPUT
|
||||
-dbm Plot Rxd signal power instead of field strength
|
||||
-rt Rx Threshold (dB / dBm / dBuV/m)
|
||||
-o Filename. Required.
|
||||
-R Radius (miles/kilometers)
|
||||
-res Pixels per tile. 300/600/1200/3600 (Optional. LIDAR res is defined within the tile)
|
||||
-t Terrain background
|
||||
-pm Prop model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,
|
||||
-pm Propagation model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,
|
||||
5: SUI, 6: COST-Hata, 7: FSPL, 8: ITWOM, 9: Ericsson
|
||||
-pe Prop model mode: 1=Urban,2=Suburban,3=Rural
|
||||
-ked Knife edge diffraction (Default for ITM)
|
||||
-pe Propagation model mode: 1=Urban,2=Suburban,3=Rural
|
||||
-ked Knife edge diffraction (Already on for ITM)
|
||||
DEBUGGING
|
||||
-t Terrain greyscale background
|
||||
-dbg Verbose debug messages
|
||||
-ng Normalise Path Profile graph
|
||||
-haf Halve 1 or 2 (optional)
|
||||
-nothreads Turn off threaded processing (optional)
|
||||
-nothreads Turn off threaded processing
|
||||
```
|
||||
|
||||
### REFERENCE DATA
|
||||
Signal server is designed for most of the environments and climates on Planet Earth but Polar region support is limited above extreme latitudes. (Svalbard is ok).
|
||||
It can run with or without terrain data and can even be used to simulate radiation of other EM emissions like light.
|
||||
|
||||
#### -sdf
|
||||
##### Directory containing Digital Elevation Models (DEM)
|
||||
SDF formatted tiles can be created by converting SRTM tiles (30m or 90m) in HGT format with the [srtm2sdf.c](https://www.google.co.uk/search?q=srtm2sdf.c) utility from SPLAT!. At the time of writing these tiles can be obtained for free from the [USGS website](https://dds.cr.usgs.gov/srtm/).
|
||||
|
||||
|
||||
#### -lid
|
||||
##### WGS84 ASCII grid tile (LIDAR) with dimensions and resolution defined in header
|
||||
LIDAR data can be used providing it is in ASCII grid format with WGS84 projection. Super tiles with up to 10000 rows by 10000 cols have been tested. Unlike a normal ASCII Grid file, this expects additional box bounds to be defined in the header as follows with this example for a 50.41km square tile. Cellsize should be in meters and co-ordinates must be in WGS84 decimal degrees.
|
||||
```
|
||||
ncols 5041
|
||||
nrows 5041
|
||||
xllcorner 6.44681098949985
|
||||
yllcorner 58.1638386261566
|
||||
xurcorner 7.28124500979768
|
||||
yurcorner 58.6306585538797
|
||||
cellsize 10
|
||||
NODATA_value 0
|
||||
```
|
||||
|
||||
#### -udt
|
||||
##### User defined CSV clutter file
|
||||
This text file allows you to define buildings with co-ordinates and heights.
|
||||
Elevations in the UDT file are evaluated and then copied into a temporary file under /tmp. Then the contents of the temp file are scanned, and if found to be unique,
|
||||
are added to the ground elevations described by the digital elevation data in memory. Height units are determined by appending M for meters or nothing for feet.
|
||||
Format: latitude,longitude,height
|
||||
```
|
||||
54.555,-2.221,10M
|
||||
54.555,-2.222,10M
|
||||
54.555,-2.223,10M
|
||||
```
|
||||
|
||||
### Antenna radiation pattern(s)
|
||||
Antenna pattern data is read from a pair of files having the same base name as the output file (-o), but with .az and .el extensions for azimuth and elevation patterns.
|
||||
```
|
||||
045.0
|
||||
0 0.8950590
|
||||
1 0.8966406
|
||||
2 0.8981447
|
||||
3 0.8995795
|
||||
4 0.9009535
|
||||
5 0.9022749
|
||||
```
|
||||
The first line of the .az file specifies the direction measured clockwise in degrees from True North. This is followed by azimuth headings (0 to 360 degrees) and their associated normalized field patterns (0.000 to 1.000) separated by whitespace.
|
||||
|
||||
The structure of SPLAT! elevation pattern files is slightly different. The first line of the .el file specifies the amount of mechanical beamtilt applied to the antenna. A downward tilt is expressed as a positive angle, while an upward tilt is expressed as a negative angle. This data is followed by the azimuthal direction of the tilt, separated by whitespace.
|
||||
The remainder of the file consists of elevation angles and their radiation pattern (0.000 to 1.000) values separated by whitespace. Elevation angles must be specified over a -10.0 to +90.0 degree range. In this example, the antenna is tilted down 2
|
||||
degrees towards an azimuth of 045.0 degrees.
|
||||
```
|
||||
2.0 045.0
|
||||
-10.0 0.172
|
||||
-9.5 0.109
|
||||
-9.0 0.115
|
||||
-8.5 0.155
|
||||
-8.0 0.157
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### 90m resolution
|
||||
- INPUTS: 900MHz tower at 25m AGL with 5W ERP, 30km radius
|
||||
- OUTPUTS: 1200 resolution, 30km radius, -90dBm receiver threshold, Longley Rice model
|
||||
- ./signalserver -sdf /data/SRTM3 -lat 51.849 -lon -2.2299 -txh 25 -f 900 -erp 5 -rxh 2 -rt -90 -dbm -m -o test1 -R 30 -res 1200 -pm 1
|
||||
|
||||
```
|
||||
./signalserver -sdf /data/SRTM3 -lat 51.849 -lon -2.2299 -txh 25 -f 900 -erp 5 -rxh 2 -rt -90 -dbm -m -o test1 -R 30 -res 1200 -pm 1
|
||||
```
|
||||
### 30m resolution
|
||||
- INPUTS: 450MHz tower at 25f AGL with 20W ERP, 10km radius
|
||||
- OUTPUTS: 3600 resolution, 30km radius, 10dBuV receiver threshold, Hata model
|
||||
- ./signalserverHD -sdf /data/SRTM1 -lat 51.849 -lon -2.2299 -txh 25 -f 450 -erp 20 -rxh 2 -rt 10 -o test2 -R 10 -res 3600 -pm 3
|
||||
```
|
||||
./signalserverHD -sdf /data/SRTM1 -lat 51.849 -lon -2.2299 -txh 25 -f 450 -erp 20 -rxh 2 -rt 10 -o test2 -R 10 -res 3600 -pm 3
|
||||
```
|
||||
|
||||
### 2m resolution (LIDAR)
|
||||
- INPUTS: 1800MHz tower at 15m AGL with 1W ERP, 1 km radius
|
||||
- OUTPUTS: 2m LIDAR resolution, 5km radius, -90dBm receiver threshold, Longley Rice model
|
||||
- ./signalserverLIDAR -lid /data/LIDAR/Gloucester_2m.asc -lat 51.849 -lon -2.2299 -txh 15 -f 1800 -erp 1 -rxh 2 -rt -90 -dbm -m -o test3 -R 1 -pm 1
|
||||
```
|
||||
./signalserverLIDAR -lid /data/LIDAR/Gloucester_2m.asc -lat 51.849 -lon -2.2299 -txh 15 -f 1800 -erp 1 -rxh 2 -rt -90 -dbm -m -o test3 -R 1 -pm 1
|
||||
```
|
||||
|
188
inputs.cc
188
inputs.cc
@@ -6,7 +6,8 @@
|
||||
#include "common.h"
|
||||
#include "main.hh"
|
||||
|
||||
void readLIDAR(FILE *fd, int hoffset, int voffset, int h, int w, int indx, double n, double e, double s, double west)
|
||||
void readLIDAR(FILE *fd, int hoffset, int voffset, int h, int w, int indx,
|
||||
double n, double e, double s, double west)
|
||||
{
|
||||
int x = 0, y = 0, reads = 0;
|
||||
char line[150000];
|
||||
@@ -36,42 +37,35 @@ void readLIDAR(FILE *fd, int hoffset, int voffset, int h, int w, int indx, doubl
|
||||
dem[indx].min_north=s;
|
||||
dem[indx].max_west=west;
|
||||
|
||||
|
||||
if (dem[indx].max_west > max_west)
|
||||
max_west = dem[indx].max_west;
|
||||
if (dem[indx].min_west < min_west)
|
||||
min_west = dem[indx].min_west;
|
||||
|
||||
if (max_west == -1)
|
||||
if (max_west == -1) {
|
||||
max_west = dem[indx].max_west;
|
||||
else {
|
||||
} else {
|
||||
if (abs(dem[indx].max_west - max_west) < 180) {
|
||||
if (dem[indx].max_west > max_west)
|
||||
max_west = dem[indx].max_west;
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
if (dem[indx].max_west < max_west)
|
||||
max_west = dem[indx].max_west;
|
||||
}
|
||||
}
|
||||
|
||||
if (min_west == 360)
|
||||
if (min_west == 360) {
|
||||
min_west = dem[indx].min_west;
|
||||
|
||||
else {
|
||||
} else {
|
||||
if (fabs(dem[indx].min_west - min_west) < 180.0) {
|
||||
if (dem[indx].min_west < min_west)
|
||||
min_west = dem[indx].min_west;
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
if (dem[indx].min_west > min_west)
|
||||
min_west = dem[indx].min_west;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (y = h-1; y > -1; y--) {
|
||||
x = w-1;
|
||||
if (fgets(line, 150000, fd) != NULL) {
|
||||
@@ -81,14 +75,12 @@ void readLIDAR(FILE *fd, int hoffset, int voffset, int h, int w, int indx, doubl
|
||||
|
||||
//dummy reads until we reach offset
|
||||
// for 5000 offset, width must be 10e3
|
||||
for(n=0;n<hoffset;n++){
|
||||
for (n = 0; n < hoffset; n++)
|
||||
pch = strtok(NULL, " ");
|
||||
}
|
||||
|
||||
while (pch != NULL && x > -1) {
|
||||
if(atoi(pch)<-999){
|
||||
if (atoi(pch) < -999)
|
||||
pch = "0";
|
||||
}
|
||||
|
||||
dem[indx].data[y][x] = atoi(pch);
|
||||
dem[indx].signal[x][y] = 0;
|
||||
@@ -101,49 +93,51 @@ void readLIDAR(FILE *fd, int hoffset, int voffset, int h, int w, int indx, doubl
|
||||
dem[indx].min_el = atoi(pch);
|
||||
min_elevation = dem[indx].min_el;
|
||||
}
|
||||
//}
|
||||
|
||||
x--;
|
||||
pch = strtok(NULL, " ");
|
||||
}//while
|
||||
}//voffset
|
||||
} else {
|
||||
fprintf(stdout,"LIDAR error @ x %d y %d indx %d\n",x,y,indx);
|
||||
fprintf(stdout, "LIDAR error @ x %d y %d indx %d\n",
|
||||
x, y, indx);
|
||||
}//if
|
||||
}//for
|
||||
|
||||
}
|
||||
|
||||
int loadLIDAR(char *filenames)
|
||||
{
|
||||
/* This function reads either 9 LIDAR tiles of n rows and n columns in ASCII grid format OR a single super tile composed of 2 or more tiles.
|
||||
The tile must have WGS84 bounds in the header in the order: WEST,SOUTH,EAST,NORTH
|
||||
ncols 5000
|
||||
nrows 5000
|
||||
xllcorner -2.291359
|
||||
yllcorner 51.788295
|
||||
xurcorner -2.146674
|
||||
yurcorner 51.878474
|
||||
cellsize 2
|
||||
NODATA_value -9999
|
||||
|
||||
Tiles must be entered in the format -lid tile1.asc,tile2.asc,tile3.asc
|
||||
/*
|
||||
* This function reads either 9 LIDAR tiles of n rows and n columns
|
||||
* in ASCII grid format OR a single super tile composed of 2 or more
|
||||
* tiles. The tile must have WGS84 bounds in the header in the order:
|
||||
* WEST,SOUTH,EAST,NORTH
|
||||
* ncols 5000
|
||||
* nrows 5000
|
||||
* xllcorner -2.291359
|
||||
* yllcorner 51.788295
|
||||
* xurcorner -2.146674
|
||||
* yurcorner 51.878474
|
||||
* cellsize 2
|
||||
* NODATA_value -9999
|
||||
*
|
||||
* Tiles must be entered in the format
|
||||
*
|
||||
* -lid tile1.asc,tile2.asc,tile3.asc
|
||||
*/
|
||||
char *filename;
|
||||
char *files[4]; // 4 tiles
|
||||
int x, y, cellsize,indx=0,fc=0,hoffset=0,voffset=0,pos;
|
||||
double xll, yll, xur, yur;
|
||||
int x, y, indx = 0, fc = 0, hoffset = 0, voffset = 0, pos,
|
||||
dem_alloced = 0;
|
||||
double xll, yll, xur, yur, cellsize;
|
||||
char found, free_page = 0, jline[20], lid_file[255],
|
||||
path_plus_name[255], *junk = NULL;
|
||||
char line[50000];
|
||||
char * pch;
|
||||
FILE *fd;
|
||||
|
||||
|
||||
// test for multiple files
|
||||
filename = strtok(filenames, " ,");
|
||||
while (filename != NULL)
|
||||
{
|
||||
while (filename != NULL) {
|
||||
files[fc] = filename;
|
||||
filename = strtok(NULL, " ,");
|
||||
fc++;
|
||||
@@ -161,60 +155,66 @@ int loadLIDAR(char *filenames)
|
||||
pch = strtok (line," ");
|
||||
pch = strtok (NULL, " ");
|
||||
width = atoi(pch);
|
||||
|
||||
if (!dem_alloced) {
|
||||
IPPD = width;
|
||||
ARRAYSIZE = (MAXPAGES * IPPD) + 10;
|
||||
|
||||
do_allocs();
|
||||
dem_alloced = 1;
|
||||
}
|
||||
if (fgets(line, 19, fd) != NULL) {
|
||||
|
||||
}
|
||||
if (fgets(line, 19, fd) != NULL)
|
||||
height = atoi(pch);
|
||||
}
|
||||
fgets(line, 24, fd); //
|
||||
fgets(line, 24, fd);
|
||||
|
||||
if (fgets(line, 24, fd) != NULL) {
|
||||
//xll=atof(pch);
|
||||
sscanf(pch, "%lf", &xll);
|
||||
}
|
||||
fgets(line, 24, fd); //
|
||||
fgets(line, 24, fd);
|
||||
if (fgets(line, 24, fd) != NULL) {
|
||||
//yll=atof(pch);
|
||||
sscanf(pch, "%lf", &yll);
|
||||
}
|
||||
|
||||
fgets(line, 24, fd); //
|
||||
fgets(line, 24, fd);
|
||||
|
||||
if (fgets(line, 24, fd) != NULL) {
|
||||
//xur=atof(pch);
|
||||
sscanf(pch, "%lf", &xur);
|
||||
}
|
||||
|
||||
fgets(line, 24, fd); //
|
||||
fgets(line, 24, fd);
|
||||
|
||||
if (fgets(line, 24, fd) != NULL) {
|
||||
//yur=atof(pch);
|
||||
sscanf(pch, "%lf", &yur);
|
||||
}
|
||||
|
||||
fgets(line, 15, fd); //
|
||||
fgets(line, 15, fd);
|
||||
|
||||
if (fgets(line, 15, fd) != NULL) {
|
||||
cellsize=atoi(pch);
|
||||
}
|
||||
if (fgets(line, 15, fd) != NULL)
|
||||
cellsize = strtod(pch, NULL);
|
||||
|
||||
// LIDAR 10m @ 10800 PPD
|
||||
if (cellsize == 10.0)
|
||||
MAXRAD = 30;
|
||||
// LIDAR 2m @ 54000 PPD
|
||||
if(cellsize==2){
|
||||
ippd=5000;
|
||||
if (cellsize == 2.0)
|
||||
MAXRAD = 15;
|
||||
}
|
||||
// LIDAR 1m @ 108000 PPD!
|
||||
if(cellsize==1){
|
||||
ippd=10000;
|
||||
if (cellsize == 1.0)
|
||||
MAXRAD = 10;
|
||||
}
|
||||
|
||||
if (xur < eastoffset)
|
||||
eastoffset = xur;
|
||||
if (xll > westoffset)
|
||||
westoffset = xll;
|
||||
|
||||
if(debug){
|
||||
if (debug)
|
||||
fprintf(stdout, "PRE yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n", yll, yur, xur, xll, delta);
|
||||
}
|
||||
|
||||
// Greenwich straddling hack
|
||||
if (xll < 0 && xur > 0) {
|
||||
@@ -222,26 +222,18 @@ int loadLIDAR(char *filenames)
|
||||
xur = 0.0; // budge it along so it's west of greenwich
|
||||
delta = eastoffset; // add to Tx longitude later
|
||||
} else {
|
||||
|
||||
// Transform WGS84 longitudes into 'west' values as society finishes east of Greenwich ;)
|
||||
if(xll > 0){
|
||||
if (xll > 0)
|
||||
xll = 360-xll;
|
||||
}
|
||||
if(xur > 0){
|
||||
if(xur > 0)
|
||||
xur = 360-xur;
|
||||
}
|
||||
if(xll < 0){
|
||||
if(xll < 0)
|
||||
xll = xll * -1;
|
||||
}
|
||||
if(xur < 0){
|
||||
if(xur < 0)
|
||||
xur = xur * -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(debug){
|
||||
if (debug)
|
||||
fprintf(stdout, "POST yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n", yll, yur, xur, xll, delta);
|
||||
}
|
||||
|
||||
if (yll < min_north)
|
||||
min_north = yll;
|
||||
@@ -252,54 +244,64 @@ int loadLIDAR(char *filenames)
|
||||
pos = ftell(fd);
|
||||
|
||||
// tile 0 [x| ]
|
||||
if(debug){
|
||||
if (debug)
|
||||
fprintf(stdout, "readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n", 0, 0, height, width, indx, yur, xur, yll, xll);
|
||||
}
|
||||
readLIDAR(fd,0,0,height,width,indx,yur,xur,yll,xll);
|
||||
|
||||
readLIDAR(fd, 0, 0, height, width, indx, yur, xur, yll,
|
||||
xll);
|
||||
//rewind
|
||||
fseek(fd, pos, SEEK_SET);
|
||||
|
||||
// tile 1 [ |x]
|
||||
if(width==10000){
|
||||
if (width == 2000 ||
|
||||
width == 10000 ||
|
||||
width == 10082) {
|
||||
indx++;
|
||||
if(debug){
|
||||
fprintf(stdout,"readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n",5000,0,height,width,indx,yur,xur,yll,xll);
|
||||
}
|
||||
readLIDAR(fd,5000,0,height,width,indx,yur,xur,yll,xll);
|
||||
}
|
||||
if (debug)
|
||||
fprintf(stdout, "readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n", width / 2, 0, height, width, indx, yur, xur, yll, xll);
|
||||
|
||||
readLIDAR(fd, width / 2, 0, height, width,
|
||||
indx, yur, xur, yll, xll);
|
||||
}
|
||||
//rewind
|
||||
fseek(fd, pos, SEEK_SET);
|
||||
|
||||
// tile 2 [x | ]
|
||||
if(height==10000){
|
||||
if (height == 2000 ||
|
||||
height == 10000 ||
|
||||
height == 10082) {
|
||||
indx++;
|
||||
if(debug){
|
||||
fprintf(stdout,"readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n",0,5000,height,width,indx,yur,xur,yll,xll);
|
||||
}
|
||||
readLIDAR(fd,0,5000,height,width,indx,yur,xur,yll,xll);
|
||||
}
|
||||
if (debug)
|
||||
fprintf(stdout, "readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n", 0, height / 2, height, width, indx, yur, xur, yll, xll);
|
||||
|
||||
readLIDAR(fd, 0, height / 2, height, width,
|
||||
indx, yur, xur, yll, xll);
|
||||
}
|
||||
//rewind
|
||||
fseek(fd, pos, SEEK_SET);
|
||||
|
||||
// tile 3 [ |x]
|
||||
if(width==10000 && height==10000){
|
||||
if ((width == 2000 && height == 2000) ||
|
||||
(width == 10000 && height == 10000) ||
|
||||
(width == 10082 && height == 10082)) {
|
||||
indx++;
|
||||
if(debug){
|
||||
fprintf(stdout,"readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n",5000,5000,height,width,indx,yur,xur,yll,xll);
|
||||
}
|
||||
readLIDAR(fd,5000,5000,height,width,indx,yur,xur,yll,xll);
|
||||
if (debug)
|
||||
fprintf(stdout, "readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n", width / 2, height / 2, height, width, indx, yur, xur, yll, xll);
|
||||
|
||||
readLIDAR(fd, width / 2, height / 2, height,
|
||||
width, indx, yur, xur, yll,
|
||||
xll);
|
||||
}
|
||||
fclose(fd);
|
||||
|
||||
if (debug)
|
||||
fprintf(stdout, "LIDAR LOADED %d x %d\n", width, height);
|
||||
} // if (fd != NULL)
|
||||
else
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
indx++;
|
||||
} // filename(s)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LoadSDF_SDF(char *name)
|
||||
|
142
main.cc
142
main.cc
@@ -1,6 +1,6 @@
|
||||
double version = 2.75;
|
||||
double version = 2.8;
|
||||
/****************************************************************************\
|
||||
* Signal Server: Server optimised SPLAT! by Alex Farrant, M6ZUJ *
|
||||
* Signal Server: Radio propagation simulator by Alex Farrant QCVS, 2E0TDW *
|
||||
******************************************************************************
|
||||
* SPLAT! Project started in 1997 by John A. Magliacane, KD2BD *
|
||||
* *
|
||||
@@ -981,6 +981,24 @@ void alloc_path(void)
|
||||
path.distance = new double[ARRAYSIZE];
|
||||
}
|
||||
|
||||
void do_allocs(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
alloc_elev();
|
||||
alloc_dem();
|
||||
alloc_path();
|
||||
|
||||
for (i = 0; i < MAXPAGES; i++) {
|
||||
dem[i].min_el = 32768;
|
||||
dem[i].max_el = -32768;
|
||||
dem[i].min_north = 90;
|
||||
dem[i].max_north = -90;
|
||||
dem[i].min_west = 360;
|
||||
dem[i].max_west = -1;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int x, y, z = 0, min_lat, min_lon, max_lat, max_lon,
|
||||
@@ -1006,66 +1024,55 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (strstr(argv[0], "signalserverLIDAR")) {
|
||||
MAXPAGES = 4;
|
||||
IPPD = 5000; // // 2m resolution default
|
||||
ARRAYSIZE = 20010;
|
||||
ppd=IPPD;
|
||||
lidar = 1;
|
||||
IPPD = 5000;
|
||||
}
|
||||
|
||||
strncpy(ss_name, "Signal Server\0", 14);
|
||||
|
||||
if (argc == 1) {
|
||||
|
||||
fprintf(stdout, "\n\t\t -- %s %.2f --\n", ss_name, version);
|
||||
fprintf(stdout,
|
||||
"\tSet for %d tiles at %d pixels/degree\n\n",
|
||||
MAXPAGES, IPPD);
|
||||
fprintf(stdout, " -sdf Directory containing .sdf tiles\n");
|
||||
fprintf(stdout, " -lid LIDAR ASCII tile with WGS84 bounds (Dimensions defined in file metadata)\n");
|
||||
fprintf(stdout,
|
||||
" -lat Tx Latitude (decimal degrees) -70/+70\n");
|
||||
fprintf(stdout,
|
||||
" -lon Tx Longitude (decimal degrees) -180/+180\n");
|
||||
fprintf(stdout, "Version: %s %.2f (Built for %d DEM tiles at %d pixels)\n", ss_name, version,MAXPAGES, IPPD);
|
||||
fprintf(stdout, "License: GNU General Public License (GPL) version 2\n\n");
|
||||
fprintf(stdout, "Radio propagation simulator by Alex Farrant QCVS, 2E0TDW\n");
|
||||
fprintf(stdout, "Based upon SPLAT! by John Magliacane, KD2BD\n\n");
|
||||
fprintf(stdout, "Usage: signalserver [data options] [input options] [output options] -o outputfile\n\n");
|
||||
fprintf(stdout, "Data:\n");
|
||||
fprintf(stdout, " -sdf Directory containing SRTM derived .sdf DEM tiles\n");
|
||||
fprintf(stdout, " -lid ASCII grid tile (LIDAR) with dimensions and resolution defined in header\n");
|
||||
fprintf(stdout, " -udt User defined CSV clutter file\n");
|
||||
fprintf(stdout, "Input:\n");
|
||||
fprintf(stdout, " -lat Tx Latitude (decimal degrees) -70/+70\n");
|
||||
fprintf(stdout, " -lon Tx Longitude (decimal degrees) -180/+180\n");
|
||||
fprintf(stdout, " -txh Tx Height (above ground)\n");
|
||||
fprintf(stdout,
|
||||
" -rla (Optional) Rx Latitude for PPA (decimal degrees) -70/+70\n");
|
||||
fprintf(stdout,
|
||||
" -rlo (Optional) Rx Longitude for PPA (decimal degrees) -180/+180\n");
|
||||
fprintf(stdout,
|
||||
" -f Tx Frequency (MHz) 20MHz to 100GHz (LOS after 20GHz)\n");
|
||||
fprintf(stdout,
|
||||
" -erp Tx Effective Radiated Power (Watts)\n");
|
||||
fprintf(stdout,
|
||||
" -rxh Rx Height(s) (optional. Default=0.1)\n");
|
||||
fprintf(stdout, " -rt Rx Threshold (dB / dBm / dBuV/m)\n");
|
||||
fprintf(stdout,
|
||||
" -hp Horizontal Polarisation (default=vertical)\n");
|
||||
fprintf(stdout, " -rla (Optional) Rx Latitude for PPA (decimal degrees) -70/+70\n");
|
||||
fprintf(stdout, " -rlo (Optional) Rx Longitude for PPA (decimal degrees) -180/+180\n");
|
||||
fprintf(stdout, " -f Tx Frequency (MHz) 20MHz to 100GHz (LOS after 20GHz)\n");
|
||||
fprintf(stdout, " -erp Tx Effective Radiated Power (Watts)\n");
|
||||
fprintf(stdout, " -rxh Rx Height(s) (optional. Default=0.1)\n");
|
||||
fprintf(stdout, " -hp Horizontal Polarisation (default=vertical)\n");
|
||||
fprintf(stdout, " -gc Ground clutter (feet/meters)\n");
|
||||
fprintf(stdout, " -udt User defined terrain filename\n");
|
||||
fprintf(stdout,
|
||||
" -dbm Plot Rxd signal power instead of field strength\n");
|
||||
fprintf(stdout, " -m Metric units of measurement\n");
|
||||
fprintf(stdout, " -te Terrain code 1-6 (optional)\n");
|
||||
fprintf(stdout,
|
||||
" -terdic Terrain dielectric value 2-80 (optional)\n");
|
||||
fprintf(stdout,
|
||||
" -tercon Terrain conductivity 0.01-0.0001 (optional)\n");
|
||||
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, "Output:\n");
|
||||
fprintf(stdout, " -dbm Plot Rxd signal power instead of field strength\n");
|
||||
fprintf(stdout, " -rt Rx Threshold (dB / dBm / dBuV/m)\n");
|
||||
fprintf(stdout, " -o Filename. Required. \n");
|
||||
fprintf(stdout, " -R Radius (miles/kilometers)\n");
|
||||
fprintf(stdout,
|
||||
" -res Pixels per tile. 300/600/1200/3600 (Optional. LIDAR res is defined within the tile)\n");
|
||||
fprintf(stdout, " -t Terrain background\n");
|
||||
fprintf(stdout,
|
||||
" -pm Prop model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,\n");
|
||||
fprintf(stdout,
|
||||
" 5: SUI, 6: COST-Hata, 7: FSPL, 8: ITWOM, 9: Ericsson\n");
|
||||
fprintf(stdout,
|
||||
" -pe Prop model mode: 1=Urban,2=Suburban,3=Rural\n");
|
||||
fprintf(stdout,
|
||||
" -ked Knife edge diffraction (Default for ITM)\n");
|
||||
fprintf(stdout, " -res Pixels per tile. 300/600/1200/3600 (Optional. LIDAR res is within the tile)\n");
|
||||
fprintf(stdout, " -pm Propagation model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,\n");
|
||||
fprintf(stdout, " 5: SUI, 6: COST-Hata, 7: FSPL, 8: ITWOM, 9: Ericsson\n");
|
||||
fprintf(stdout, " -pe Propagation model mode: 1=Urban,2=Suburban,3=Rural\n");
|
||||
fprintf(stdout, " -ked Knife edge diffraction (Already on for ITM)\n");
|
||||
fprintf(stdout, "Debugging:\n");
|
||||
fprintf(stdout, " -t Terrain greyscale background\n");
|
||||
fprintf(stdout, " -dbg Verbose debug messages\n");
|
||||
fprintf(stdout, " -ng Normalise Path Profile graph\n");
|
||||
fprintf(stdout, " -haf Halve 1 or 2 (optional)\n");
|
||||
fprintf(stdout, " -nothreads Turn off threaded processing (optional)\n");
|
||||
fprintf(stdout, " -nothreads Turn off threaded processing\n");
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
@@ -1073,12 +1080,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we know what mode we are running in, we can allocate various
|
||||
* data structures.
|
||||
* If we're not called as signalserverLIDAR we can allocate various
|
||||
* memory now. For LIDAR stuff we need to wait until we've pasred
|
||||
* the headers in the .asc file to know how much memory to allocate.
|
||||
*/
|
||||
alloc_elev();
|
||||
alloc_dem();
|
||||
alloc_path();
|
||||
if (!lidar)
|
||||
do_allocs();
|
||||
|
||||
y = argc - 1;
|
||||
kml = 0;
|
||||
@@ -1129,15 +1136,6 @@ int main(int argc, char *argv[])
|
||||
tx_site[1].lat = 91.0;
|
||||
tx_site[1].lon = 361.0;
|
||||
|
||||
for (x = 0; x < MAXPAGES; x++) {
|
||||
dem[x].min_el = 32768;
|
||||
dem[x].max_el = -32768;
|
||||
dem[x].min_north = 90;
|
||||
dem[x].max_north = -90;
|
||||
dem[x].min_west = 360;
|
||||
dem[x].max_west = -1;
|
||||
}
|
||||
|
||||
/* Scan for command line arguments */
|
||||
|
||||
for (x = 1; x <= y; x++) {
|
||||
@@ -1211,7 +1209,10 @@ int main(int argc, char *argv[])
|
||||
if (strcmp(argv[x], "-res") == 0) {
|
||||
z = x + 1;
|
||||
|
||||
if (z <= y && argv[z][0] && argv[z][0] != '-') {
|
||||
if (!lidar &&
|
||||
z <= y &&
|
||||
argv[z][0] &&
|
||||
argv[z][0] != '-') {
|
||||
sscanf(argv[z], "%d", &ippd);
|
||||
|
||||
switch (ippd) {
|
||||
@@ -1574,7 +1575,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Load the required tiles */
|
||||
if(lidar){
|
||||
loadLIDAR(lidar_tiles);
|
||||
int err;
|
||||
|
||||
err = loadLIDAR(lidar_tiles);
|
||||
if (err) {
|
||||
fprintf(stderr, "Couldn't find one or more of the "
|
||||
"lidar files. Please ensure their paths are\n"
|
||||
"correct and try again.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
ippd = IPPD;
|
||||
|
||||
if(debug){
|
||||
fprintf(stdout,"%.4f,%.4f,%.4f,%.4f\n",max_north,min_west,min_north,max_west);
|
||||
}
|
||||
@@ -1745,10 +1756,5 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
fflush(stdout);
|
||||
|
||||
// deprecated garbage collection
|
||||
/*free_elev();
|
||||
free_dem();
|
||||
free_path();
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
1
main.hh
1
main.hh
@@ -27,5 +27,6 @@ void free_elev(void);
|
||||
void free_path(void);
|
||||
void alloc_elev(void);
|
||||
void alloc_path(void);
|
||||
void do_allocs(void);
|
||||
|
||||
#endif /* _MAIN_HH_ */
|
||||
|
@@ -11,16 +11,13 @@
|
||||
#include "sui.hh"
|
||||
#include <pthread.h>
|
||||
|
||||
#define MAXPAGES 64
|
||||
#define IPPD 5000
|
||||
#define NUM_SECTIONS 4
|
||||
|
||||
namespace {
|
||||
pthread_t threads[NUM_SECTIONS];
|
||||
unsigned int thread_count = 0;
|
||||
pthread_mutex_t maskMutex;
|
||||
|
||||
bool processed[MAXPAGES][IPPD][IPPD];
|
||||
bool ***processed;
|
||||
bool has_init_processed = false;
|
||||
|
||||
struct propagationRange {
|
||||
@@ -81,13 +78,25 @@ namespace {
|
||||
|
||||
void init_processed()
|
||||
{
|
||||
for(int i = 0; i < MAXPAGES; i++) {
|
||||
for (int x = 0; x < ippd; x++) {
|
||||
for (int y = 0; y < ippd; y++) {
|
||||
int i;
|
||||
int x;
|
||||
int y;
|
||||
|
||||
processed = new bool **[MAXPAGES];
|
||||
for (i = 0; i < MAXPAGES; i++) {
|
||||
processed[i] = new bool *[ippd];
|
||||
for (x = 0; x < ippd; x++)
|
||||
processed[i][x] = new bool [ippd];
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXPAGES; i++) {
|
||||
for (x = 0; x < ippd; x++) {
|
||||
for (y = 0; y < ippd; y++)
|
||||
processed[i][x][y] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
has_init_processed = true;
|
||||
}
|
||||
|
||||
bool can_process(double lat, double lon)
|
||||
|
BIN
signalserver
BIN
signalserver
Binary file not shown.
@@ -1 +0,0 @@
|
||||
signalserver
|
@@ -1 +0,0 @@
|
||||
signalserver
|
Reference in New Issue
Block a user