rfl.tar.bz2 (updated 22 Mar 2026)
which will untar into a directory named rfl. Move into the rfl directory and run rfl.py.
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. A link budget is simply taking transmit power, adding gains and subtracting losses to estimate power level at a receiver. Rfl provides a full link budget implemented a shown.
Antennas can be characterized either simply as a single number, isotropic gain, or using NSMA antenna data files, described on the NSMA viewer page.
Longley-Rice ITM (Irregular Terrain Model) estimates RF path loss and the GUI provides controls for all aspects of the ITM. Especially useful are options for terrain profile or area modes and statistical characterization of results. An important part of using ITM for path loss is elevation data. The easiest source of data to use is SRTM, Shuttle Radar Topography Mission, which is available freely from NASA. Rfl will query the SRTM server to retrieve and cache the data without user intervention. Faster is to use local copies of DTED level 1 or Open Elevation. However, Open Elevation support will likely be removed because of Open Elevation API changes and Open Elevation uses SRTM, anyway.
Rfl geodetic 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. These values are a bit opaque at first glance and it is worthwhile to read that portion of the "Area Guide" report at the ITM link (in next paragraph) so that you can characterize your results with, can't resist the pun, confidence.
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 configuration file can be created by hand or by using a GUI. Two sections follow describing how to run rfl with GUI or command line.
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. If you downloaded DTED1, again be sure to maintain that same directory structure. Rfl will find the files in either directory structure. When you don't have DTED1 data, use SRTM. Most will use SRTM because DTED remains challenging to get.
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. Then I use a program like gimp to overlay map with coverages and choose layer transparencies myself. In those cases, an idea is to create one map with filled iso's, and another with only isolines themselves drawn. But that is uncommon and you will nearly always want the map. Experiment with alpha (transparency) value on a coarse grid first because it will finish quickly. When you get the transparency level that looks best, rerun with a finer grid.
Broadcast studies do not need the detail provided by terrain data. Instead, they require 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 elevation data source setting (SRTM, etc.) is ignored in area mode.
|
|
While significant detail is lost compared to the profile mode, area mode has the advantages of not needing terrain data and of providing just gross coverage that is sometimes more useful. 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 that 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 -h shows all options):
prof.py -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. Command line arguments indicate that 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.
The plot takes into account earth curvature but RF propagates as if the earth radius is about 4/3 its actual value, not addressed in the plot.
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.
In the Data Directories panel, change elevation and paths to suit your machine.
Change 'Path loss' from Profile to Area to create area mode plots, but remember to reduce the coverage cells. Much less are needed for area mode. Change 'Output' from Coverage to Link for the 5 node model to re-create the CSV output shown on this page.