Skip to content

CST Far Fields

SERVAL reads CST far-field exports into a CSTFarfield: one port's field on the export's own grid, as the Ludwig-3 components

\[ E_\mathrm{ref0} = \cos\phi \, E_\theta - \sin\phi \, E_\phi, \qquad E_\mathrm{ref90} = \sin\phi \, E_\theta + \cos\phi \, E_\phi, \]

in the export's own \((\theta, \phi)\) coordinates, called CST \(\theta\) and CST \(\phi\) below. You state what the files cannot:

  • which dipole the port is (port_polarisation);
  • how the CST frame is turned about the boresight relative to SERVAL's pointed frame (cst_phi_offset, default 0; see below). An azimuthally symmetric beam does not need it.

TIRSVoltageBeam.from_cst_farfields then projects the field into a voltage beam.

from serval.containers import CSTFarfield, TIRSVoltageBeam

farfield = CSTFarfield.from_ffs(
    "model_farfield_source_broadband_[1].ffs", port_polarisation="X", cst_phi_offset=0.0
)
farfield = farfield.interpolated(frequencies_MHz)  # optional: other frequencies
beam = TIRSVoltageBeam.from_cst_farfields(
    farfield, lmax=200, polarisation="X", latitude=latitude, longitude=longitude
)

The readers cover only the CST exports and settings described on this page, not CST's options in general. For anything else, read the field yourself and build the beam with TIRSVoltageBeam.from_thetaphi or TIRSVoltageBeam.from_ludwig3, which take any callable.

Supported formats

  • .ffs (CST Farfield Source File, data type Farfield). It holds \(E_\theta\), \(E_\phi\) as Re/Im at high precision, with all frequencies in one file.
  • Use it for anything that depends on smoothness in frequency, such as delay spectra.
  • Tested on version 3.0. Other versions are parsed with the 3.0 layout and warn.
  • ASCII, one file per frequency, with Horiz/Verti or Cross/Copol columns.
  • Magnitudes are rounded. That is fine for beam patterns, fits and calibration models, but the rounding adds noise from one frequency to the next, which matters for delay spectra.
  • Both CST layouts are read: \(\theta \in [0, 180]\) with \(\phi \in [0, 360)\), and the 2D export with \(\theta \in [-180, 180)\), \(\phi \in [-90, 90]\).

Required export settings

These are the only supported settings. Some are checked; the rest cannot be read from the files.

For both formats:

  • The far-field \(z\) axis along the dish's boresight (for ASCII, the propagation direction).
  • A tilt cannot be expressed through cst_phi_offset, which only turns the frame about the boresight.
  • Only a reversed axis is caught, by the boresight check.
  • Fixed, explicit axes, so the frame cannot follow the main lobe and absorb a squint.
  • The far-field origin at the dish point SERVAL places at the antenna position.
  • SERVAL does not move it.
  • A common shift of every beam's origin cancels in the visibilities. Beams with different origins (different models, or per-dish exports) differ by a direction-dependent phase that gains cannot absorb.
  • Beams from different simulations that are used together need the same far-field origin, axes and phase convention. SERVAL uses the phases as written.

For ASCII, also:

  • An E-field quantity, in V/m or dB(V/m). Checked: directivity or gain exports are rejected.
  • The Ludwig 3 coordinate system, with linear-directional polarisation and slant angle 0.
  • Horiz/Verti or Cross/Copol columns, with one export setting for every file of a port. Columns 3-4 are read as \(E_\mathrm{ref0}\) and 5-6 as \(E_\mathrm{ref90}\) for both namings.

The HIRAX collaboration's Copol/Cross export (CST Farfield Plot, Axes tab) uses:

Setting Value
Axes type Polarization dependent
Polarization Linear-Directional, slant angle 0
Polarization vector (\(y'\)) \((0, -1, 0)\)
Propagation direction (\(z'\)) \((0, 0, -1)\)
Coordinate system Ludwig 3

Choosing cst_phi_offset

The CST frame shares the boresight with SERVAL's pointed frame and is turned about it:

\[ \text{CST } \phi = \text{pointed } \phi + \texttt{cst\_phi\_offset}. \]

Pointed \(\phi = 0\) is the dish's direction of increasing altitude. Seen from the dish looking out, with pointed \(\phi = 0\) as up, \(\phi\) increases to the right; boresight turns both. For the default zenith pointing, pointed \(\phi\) = 0, \(90^\circ\), \(180^\circ\), \(270^\circ\) is North, West, South, East. SERVAL puts each port's co-pol where its feed belongs (Y along pointed \(\phi = 0\), X along \(90^\circ\)), so one value serves both ports of a model.

The default 0 means the export's \(x\) axis is the dish's direction of increasing altitude \(\hat{U}\). Otherwise, with the export's axes \(\hat{x}\), \(\hat{y}\) in model coordinates (for a .ffs, the header's xAxis and zAxis, \(\hat{y} = \hat{z} \times \hat{x}\)), \(\texttt{cst\_phi\_offset} = \operatorname{atan2}(\hat{U} \cdot \hat{y}, \hat{U} \cdot \hat{x})\). For example, with \(\hat{U} = -\hat{x}_\mathrm{model}\), a .ffs with \(\hat{x} = -\hat{x}_\mathrm{model}\) needs 0, and a Copol/Cross export with the collaboration's settings (\(\hat{x} = +\hat{x}_\mathrm{model}\)) needs \(\pi\).

An offset wrong by \(180^\circ\) flips asymmetric features, such as squint or feed displacement, on the sky; no check can catch it.

What is checked

The readers check:

  • the header: format, column names and units;
  • that the grid covers the sphere uniformly;
  • that the beam peaks at \(\theta < 90^\circ\) at every frequency.

Construction checks that the co-pol implied by port_polarisation and cst_phi_offset is stronger than the cross-pol at boresight. This catches a mislabelled port, or a cst_phi_offset off by \(90^\circ\).

Nothing is taken from file names.

Limitations

  • Whole-sphere, uniform grids only. Partial spheres and irregular grids raise.
  • .ffs blocks are taken in the order of the header's power table, as CST writes them. The blocks themselves do not state their frequency.
  • The field is unnormalised: CST's V/m at 1 m from the far-field origin.
  • The power table (radiated, accepted and stimulated power) and the header's position and axes are recorded in metadata, but not applied.
  • Normalise the projected beam in SERVAL.
  • Interpolation removes only the common phase wrapping. interpolated fits a delay to the boresight phase and removes it before interpolating.
  • Structure narrower than the sample spacing is not recovered. Export finer samples there.
  • Under-sampled phase wrapping raises when the sampling is non-uniform. Uniform under-sampling aliases and cannot be detected.
  • \(\theta = 180^\circ\) is unreliable. Ludwig-3 components are singular there; for a dish it is below the horizon.
  • CSTBeamInterpolator reads columns 5-6 as the co-pol, so it does not support a port exported with another port's polarisation vector; use from_cst_farfields there.