Skip to content

Pattern Formats

mcnanovna can import antenna patterns from several file formats.

CSV

Comma-separated values with angle and gain data.

3-Column Format (Full 3D)

theta,phi,gain_dbi
0,0,-40
0,10,-40
...
90,0,2.15
90,10,2.15
...
180,0,-40
ColumnDescription
thetaPolar angle (0-180°)
phiAzimuth angle (0-360°)
gain_dbiGain in dBi

2-Column Format (Single Cut)

angle,gain
0,-40
45,-10
90,2.15
135,-10
180,-40

Single-cut data is synthesized to 3D using a sin(θ) taper.

Delimiters

Auto-detected: comma (,), semicolon (;), or tab.

Headers

Optional. If first row contains non-numeric values, it’s treated as a header.

EMCAR vna.dat

Format from EMCAR antenna range software.

# EMCAR antenna pattern measurement
# Frequency: 145 MHz
0 0.5
45 0.8
90 1.0
135 0.8
180 0.5
ColumnDescription
angleAzimuth angle (degrees)
amplitudeLinear amplitude (0-1)

The gnuplot transform is applied automatically:

  • Angle: (-angle + 90) rotation
  • Gain: 20 * log10(amplitude + 0.01)

NEC2 Output

Output from NEC2/NEC4 antenna simulation.

- - - RADIATION PATTERNS - - -
- ANGLES - - POWER GAINS - - POLARIZATION -
THETA PHI VERT. HOR. TOTAL AXIAL TILT
DEGREES DEGREES DB DB DB RATIO DEG
0.00 0.00 -999.99 -999.99 -999.99 0.00000 0.00
5.00 0.00 -4.52 -999.99 -4.52 0.00000 90.00
10.00 0.00 1.43 -999.99 1.43 0.00000 90.00

Polarization Selection

OptionColumn
totalTOTAL (default)
vertVERT.
horHOR.

The frequency is auto-detected from the NEC2 header.

Touchstone S1P

Touchstone S-parameter file with S11 data.

! NanoVNA measurement
# Hz S RI R 50
144000000 0.15 -0.08
145000000 0.02 -0.01
146000000 0.12 0.05

Formats

OptionData Format
RIReal, Imaginary
MAMagnitude, Angle (degrees)
DBdB Magnitude, Angle (degrees)

Processing

  1. Find resonance (minimum |S11|)
  2. Calculate impedance at resonance
  3. Estimate antenna type from impedance
  4. Generate analytical pattern

Antenna Type Override

If auto-detection is wrong, specify the type:

import_pattern_s1p(content, antenna_type="monopole")

Internal Format

All import functions return the same structure:

{
"antenna_type": "dipole",
"frequency_hz": 145000000,
"theta_deg": [0, 5, 10, ...], # List of theta values
"phi_deg": [0, 10, 20, ...], # List of phi values
"gain_dbi": [-40, -35, ...], # Gain at each point
"peak_gain_dbi": 2.15,
"num_points": 6552
}

This format is used by:

  • Web UI visualization
  • radiation_pattern_multi comparison
  • Export functions

Interpolation

For irregular measurement grids, IDW (inverse-distance-weighted) interpolation maps data to the standard theta×phi grid:

  • Theta: 0° to 180° in 5° steps (default)
  • Phi: 0° to 355° in 5° steps (default)

Great-circle distance is used for accurate angular weighting.