rfl.tar.bz2 (updated 4 Mar 2026)
which will untar into a directory named rfl. Move into the rfl directory and run rfl.py.
While I don't expect the number crunching to change much, if at all, the GUI will very likely be tweaked. Nothing major, but things like graying options that aren't available due to particular choices. Minor things that improve user experience, so check back on occasion for gradual improvements. If you're a coder please feel free to jump in, too. The more, the merrier. We can even start a github project if it becomes more than a solo effort. :-)
Rfl will not run until all python libraries are installed. I use the anaconda.org distribution, but even it does not contain all needed libraries. Commands might differ slightly from computer to computer, but here are library names and commands I used to install them on Ubuntu linux with anaconda python:
conda install -c conda-forge pil
conda install pyqt6
pip install dted
pip install python-srtm
pip install slippy
Rfl is an easy to use program to create either RF coverage maps or csv (comma separated value) link budget calculations. Longley-Rice ITM (Irregular Terrain Model) is used for RF propagation calculations and GUI controls are provided to control all aspects of the ITM. Especially useful are options for terrain profile or area modes as well statistical characterization of results. Beyond path loss, rfl provides a full link budget implemented a shown.
Antennas can be characterized either simply as isotropic gains or using NSMA antenna data files. More detail is available on the NSMA viewer page.
An important part of using the ITM for path loss is elevation data. The suggested choice is SRTM, Shuttle Radar Topography Mission, data which is available freely from NASA. Rfl will query the SRTM server and retrieve the data without user intervention. Faster is to use local copies of DTED level 1 or Open Elevation.
Rfl calculations are based on the WGS84 model of the earth. Oblate spheroid subroutines that I converted from fortran to python are in earth.py.
The rfl program uses a configuration file and can be run in either command line mode or with a GUI to perform a set of link budget calculations. The configuration file can be named anything, but I like to use a .rfl suffix. The Longley-Rice ITM provides options for link path loss calculated using either terrain profile mode, which uses terrain elevation data. or area mode, which uses general terrain properties but not elevation. Output can be either an RF coverage map or a csv file of link budget results. This means rfl can be run in 4 ways:
| Profile | Area | |
| Map | Realistic map | Smooth map |
| CSV | Terrain-based | Average roughness-based |
In addition, the calculated median path loss can be further characterized using probabilities of reliability for fractions of time, location and situation. Terrain profile calculations have a probability 1 for location since it is known.
Rfl is controlled completely by a configuration file which can be created by hand or by using a GUI. Internally, the configuration file is converted to a python dictionary. Two sections follow describing how to run rfl with GUI or command line.
The environment set up requires three numbers that most users will not have handy. Hover the mouse cursor over those boxes in the GUI and tool tips will pop up with references to publications where the values for your area can be found. The references are available as pdfs on the Longley-Rice ITM page under Section 2, "Newly Typeset in LaTeX."
The rfl GUI is separated into 5 tabs, each grouped with a set of related data needed for the link budget calculation. The GUI is started by typing or clicking on rfl.py and the GUI pops up:
Radio boxes are pre-selected for the most common use, ITM profile mode and PNG coverage map output. Because a profile means there is no location ambiguity, the 'Location fraction' box is grayed out. Similarly, 'Terrain roughness' is grayed out because it is only needed for ITM area mode. (It is also calculated from terrain data in profile mode.) When the mouse cursor hovers over a GUI item, usually a description pops up.
Each tab is clicked to move to it. The data in each tab is briefly summarized in the following list:
Unless a scenario is created from scratch, the first thing done is read in a config file. This is done by clicking the 'Open' button to navigate to a file. The GUI is now populated with data from the configuration file. After any modifications, the file name can be changed and the Create button clicked to save the new file.
When the GUI values are entered, the 'Run!' button is pushed. A progress bar reflects speed of calculations. A large grid like the one shown can take quite awhile, on the order of minutes. When DTED level 1 data is available, ensure cd's have been copied into a directory with sub-directory structure and naming identical to that on the cd's. When you don't have DTED1 data, use SRTM. Most will use SRTM because DTED remains challenging to get for some reason. There is a good chance I must update use of Open Elevation support because I think there have been changes to it since I wrote that part of rfl.
Background maps are downloaded from OpenStreetMaps, but a check box can be used to indicate whether the map is wanted or not. Sometimes I choose no map so that I can make and save multiple RF coverage maps for comparison. Finally, I use a program like gimp to overlay map with coverages and choose layer transparencies myself. You will nearly always want the map. Experiment with alpha (transparency) value on a coarse map first because it will finish quickly. When you get the transparency level that looks best, then run with a finer grid.
Broadcast studies often do not need or want the detail provided by terrain data. Instead, it requires a single number called the terrain roughness factor. Given a terrain profile, a linear least squares fit is made and vertical terrain distances from the line are sorted. The middle 80% are used, the interdecile range. The roughness value is asymptotic as distance from transmitter increases. Longley and Rice call this value delta h, abbreviated here as dh. An easy way to get dh is to run rfl in profile mode. The elevation data is used to calculate dh and printed to the screen (not gui) for use with area mode. For the example above, rfl calculates dh=127 which is put in the config file or GUI yielding the area mode result below. The rfl tab fields 'ant' and 'dted' are ignored in area mode.
|
|
While significant detail is lost compared to the profile mode, area mode has the advantage of not needing terrain data and also providing gross coverage that is sometimes what is wanted. This is the mode used in FCC studies where required coverage levels are mapped to statistics settings. As the rightmost image shows, it can help better see where directional patterns potentially have best coverage.
CSV, comma separated value, file output is often more useful than a coverage map when modeling or other software will further build on rfl results. Rfl does not support files of GPS tracks for multiple stations, but it is potentially useful in emergency or spectrum management situations. Its implementation is left as an exercise for the reader. :-) Link output creates a file containing link budget results for all transmitter-to-receiver pairs. Tx-tx and rx-rx are not calculated and receive antenna polarization is assumed to be same as transmitter's. Here is a typical file viewed with libreoffice that would be paired with the input config file.
In the spreadsheet, columns A and B are the names of transmit and receive stations and columns C through H are link budgets values. The last column indicates the type of propagation from transmitter to receiver. Notice that transmit antenna gains in column D are different. This is because the tx-rx RF ray cuts through a different part of antenna pattern. Not apparent, ITM calculates RF take off elevation angles. These are used by rfl to cut through the correct point in a 3d farfield pattern. Input values from the configuration file are not repeated in the output, so it is wise to keep both files together. I often name input and output files similarly, e.g., myTest.rfl and myTest.csv.
Looking at the propagation mode column, we might wonder why the propagation from sensor transmitter to Station 3 is diffraction. To explore that, run prof.py directly:
prof.py -n 200 -a1 24.4 -lat1 31.718025 -lon1 -110.375975 -a2 3 -lat2 31.664167 -lon2 -110.227833
using lat/lon data from the configuration file. Other command line arguments indicate that n=200 points will be plotted, antenna1 is 24.4m high and antenna2 is 3m high. The resulting plot shows that RF is indeed diffracted over the obstructing hilltop. Prof.py subroutines are normally run by rfl.py but when run directly also acts as a standalone program with its own capabilities.
rfl -d cfg.rfl
and an rfl configuration file named cfg.rfl is created. It is liberally commented and intended to be descriptive enough for easy use, but please let me know if more description is needed. The config file is an ascii file and can be modified for your scenario using your favorite editor.
Once a config file is created by either command line or GUI, rfl can be easily run from the command line generating the type of output specified:
rfl -c cfg.rfl
When using an NSMA antenna data file, rfl will quit if the specified frequency is not found in the NSMA data file. An easy way to find frequencies that you can use in rfl is to run the nsma.py program:
$ nsma.py -s /data/ant/ant.adf Line 402 warning: expected 180 points, got 179. ABC Antenna Company 800A-065-25-4N E-tilt: 4.0 deg. 851 MHz (-f 851): EL V/V (-p V/V) AZ V/V (-p V/V)
The -s (summary) option displays all cuts, frequencies and polarizations, and we see that this pattern provides only one frequency that can be used in rfl, namely, 851. Like prof.py, nsma.py contains subroutines called by rfl.py, but as mentioned earlier is a fairly capable standalone program in its own right. See the nsma.py page.