NSMA Antenna Data File Viewer and Plotter

Please report bugs and suggestions. My set of antenna files is limited resulting in equally limited testing. Thanks.
Mike Markowski, mike.ab3ap@gmail.com

Here is a small python program (latest 30 Mar 2023) to view slices stored in an NSMA antenna pattern file as described by Antenna Systems – Standard Format for Digitized Antenna Patterns WG16.99.050. The program's main goal is to quickly and easily view the cuts. A supplementary function, gain(), calculates gain based on azimuth and elevation of an RF ray. This function can be called from your programs and an example follows the plots. The gain function is used in link budget program rfl, Radio Frequency Link.

The NSMA document linked to includes a sample antenna pattern which I saved to a file named ant.adf. The first step is to find frequencies, cuts and polarizations in the pattern file:

  $ nsma.py -s ant.adf 
  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 shows us that there is a single frequency and polarization pair. Slices can be viewed in 3d and note that the 4 degree electrical downtilt is apparent:

  $ nsma.py -f 851 -p v/v -3 ant.adf

or in a traditional 2d manner using the command:

  $ nsma.py -f 851 -p v/v -2 ant.adf

To find gain, the -a az and -e el arguments are used. We see in the elevation cut above that there is a deep null at elevation 34 degrees. To find how deep:

  $ nsma.py -f 851 -p v/v -a 0 -e 34 ant.adf
  gain(az=0.0, el=34.0) = -21.4 dBi

Note that mid-band gain units from the file were added to the dBr pattern, resulting in dBi gain 16.8 dB (in plot title) greater than the -38.2 read from the dBr plot.

On occasion it can be useful to view the text file itself. To do so with indentation to more easily see what groups with what, use the -t text option:

$ nsma.py -t ant.adf 
revnum: NSMA WG16.99.050
revdat: 19990520
comnt1: This is a sample file for 1 frequency and 2 cuts
antman: ABC Antenna Company
modnum: 800A-065-25-4N
descr1: 800 Mhz 65 deg AZ BW 2.5meter 4 deg E-tilt base station antenna
dtdata: 19971216
lowfrq: 806.0
hghfrq: 896.0
gunits: ['DBI', 'DBR']
mdgain: [16.8  0.5]
azwidt: [65.  0.]
elwidt: [7. 0.]
contyp: n connector
atvswr: 1.4
frtoba: 30.0
eltilt: [4.  0.5]
maxpow: 500.0
antlen: 2.367
antwid: 0.366
antdep: 0.178
antwgt: 19.0
pattyp: typical
patfre:
  851 MHz
    patcut:
      EL: 
        polari: V/V
        fstlst: [-180.  178.]
        pattern:
          -180.000, -29.799, 0.000
          -178.000, -28.912, 0.000
          ...
          176.000, -34.614, 0.000
          178.000, -31.966, 0.000
      AZ: 
        polari: V/V
        fstlst: [-180.  178.]
        pattern:
          -180.000, -32.219, 0.000
          -178.000, -32.353, 0.000
          ...
          176.000, -32.275, 0.000
          178.000, -31.982, 0.000
$