# Checking Antenna Spectra

This is typically performed in either `swlevel 2` or `swlevel 3`, with the methodology differing between the modes. This is a sample of commands used while in `swlevel 3`,

```shell
user1@lcu$ # Initialisation
user1@lcu$ swlevel 3
user1@lcu$ rspctl --bitmode=8
user1@lcu$ 
user1@lcu$ # Beamforming the zenith to use RCUs
user1@lcu$ # LBA mode 3
user1@lcu$ beamctl --antennaset=LBA_OUTER --band=10_90 --rcus=0:191 --subbands=0:487 --beamlets=0:487 --anadir=0,0.7853982,AZELGEO --digdir=0,0.7853982,AZELGEO
user1@lcu$ # HBA mode 5
user1@lcu$ beamctl --antennaset=HBA_JOINED --band=110_190 --rcus=0:191 --subbands=0:487 --beamlets=0:487 --anadir=0,0.7853982,AZELGEO --digdir=0,0.7853982,AZELGEO
user1@lcu$ # HBA mode 7
user1@lcu$ beamctl --antennaset=HBA_JOINED --band=210_250 --rcus=0:191 --subbands=0:487 --beamlets=0:487 --anadir=0,0.7853982,AZELGEO --digdir=0,0.7853982,AZELGEO
user1@lcu$ 
user1@lcu$ # Shutdown
user1@lcu$ swlevel 0
```

After initialisation, `rspctl --stati --select rcuN:rcuM,rcuA:rcuB` can be run in a separate shell (or the same shell if the `beamctl` commands are run in the background) and will plot the SST data for visual inspection, for a given range of RCUs. Using the `beamctl` method, RCUs not provided to a beam are not plotted by default.

If an antenna spectrum is looking suspicious, the RCUs used for the beamctl commands can be used to limit the range of antennas to make it easier to try down the misbehaving antenna.

`swlevel 2` method, courtesy of Pearse Murphy,

```shell
user1@lcu$ # Initialisation
user1@lcu$ swlevel 2
user1@lcu$ 
user1@lcu$ # RCU Warming, LBA, HBALo, HBAHi
user1@lcu$ rspctl --mode=3
user1@lcu$ rspctl --mode=5
user1@lcu$ rspctl --mode=7
user1@lcu$ 
user1@lcu$ # Shutdown
user1@lcu$ swlevel 0
```