Copyright 2014-2015 NZRS Ltd
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
This application allows for batch processing of radio propagation modelling. It takes a CSV as input and generates the following:
- A KML file with a georeferenced image for use in the likes of Google Earth.
- A raster file suitable for use in GIS packages.
- A shapefile (currently not implemented but trivial)
The model is derived from a Digital Elevation Model (DEM), the base data at present is from the NASA Shuttle Radio Topography Mission (SRTM). Though there may be bettter localised sources available.
Install the following packages setup.md
- network_name
- site_name
- latitude
- longitude
- antenna height
- frequency (MHz)
- power (EIRP)
- polarisation
- bearing
- horizontal beamwidth
- vertical beamwidth
- antenna downtilt
The Longely Rice Prediction Model is used to model coverage.
- Get the Digital Elevation Model Files and convert of .sdf
- Either get from NASA using get_data.py which scrapes and converts to .sdf files, or;
- Copy already processed .sdf files from a local source
- Or download from NZRS (once we have a site up)
- Pass -h to enable splat-hd when using get_data.py
- Ensure you have a .csv file that matches the column headings of sample_data.csv in this repository. The file must contain the following:
- network_name
- site_name latitude
- longitude
- antenna_height
- frequency_mhz
- power_eirp
It may optionally contain
- polarisation
- bearing
- horizontal_beamwidth
- vertical_beamwidth
- Antenna downtilt
- Use make_files.py to create the model files based off of the .csv file.
- Azimuth file
- Elevation file
- QTH file
- LRP file
- Map coverage using create_output_from_dir.py. The following will be created:
- A KML file you can use in Google Earth
- A georeferenced .tif file (raster - 1 file)
- A shapefile (vector - 4 files)
The get_data.py scrapes the data from NASA. Some tweaks can be made to limit the area by specifying the latitude and longitude. At present the default is to acquire New Zealand data only. Though the query_url in 'get_data.py' can be modified easily.
get_data.py also processes the data into what can be used in the model. It unzips and converts to .sdf and cleans up intermediate files.
python get_data.py
If using splat-hd, to get srtm1 data (1 Arc Second), add the HD flag to scrape the srtm1 data:
python get_data.py -h
get_data.py does the following:
- Scrapes the Shuttle Radar Topography Mission (SRTM) data from NASA
- Unzips the downloaded data
- Converts the downloaded .hgt files to .sdf files
- Cleans stuff up
The model uses four files, two required and two optional but created empty by default. Required files:
- LRP - Contains Longley Rice Parameters. Where not read from the .csv file they default to New Zealand specific parameters, they may need changed for other climates and locales.
- Earth Dielectric Constant (Relative permittivity)
- Earth Conductivity (Siemens per meter)
- Atmospheric Bending Constant (N-units)
- Frequency in MHz (20 MHz to 20 GHz)
- Climate type (Maritime Temperate, over land)
- Polarization (0 = Horizontal, 1 = Vertical)
- Fraction of situations (50% of locations)
- Fraction of time (50% of the time)
- Power EIRP
- QTH - Geographic
- Latitude
- Longitude
- Antenna height above ground
- AZ - Azimuth
- Bearing
- Horizontal beamwidth
- EL - Elevation
- Downtilt
- Vertical beamwidth
The AZ and EL files use a simplified model where 90% of the energy is transmitted in the specified beamwidth and the other 10% outside of the beamwidth. Both files can hold full antenna patterns but this has been simplified for batch modelling.
python make_files.py
python create_output_from_dir.py
Pass -h to run splat-hd (note: this requires srtm1 data - use python get_data.py -h
)
python create_output_from_dir.py -h
This requires all the following files to be in the same directory:
- The .sdf files
- LRP files
- QTH files
- EZ files
- EL files
The above files will be processed when create_ouput_from_dir.py is run. The default system receive is modelled by default at -110 dBm receive. Other receives can be passed in as a parameter. Note this is at the chip, so includes receive antenna gain.
You may need to change received values to get something that feels right.
python create_output_from_dir.py
or for say -105dBm receive
Receive_sensitivity can be controlled with -s, or --sensitivity Positive receive_sensitivity numbers are forced to negative
./create_output_from_folder.py -h -s -105
./create_output_from_folder.py -h --sensitivity=105
./create_output_from_folder.py -hs -105
``./create_output_from_folder.py -s 105```
Currently this is not implemented but at the command line:
For all GeoTiffs in the folder:
``for f in *.tif; do gdal_polygonize.py $f -f "ESRI Shapefile" $f.shp; done```
For a single GeoTiff:
``gdal_polygonize.py -f "ESRI Shapefile" <output_file_name.shp>```