11institutetext: Faculty of Electrical Engineering, Mathematics and Computer
Science, Delft University of Technology, Mekelweg 4, 2628 CD, Delft, The
Netherlands 22institutetext: SRON—Netherlands Institute for Space Research,
Niels Bohrweg 4, 2333 CA, Leiden, The Netherlands 33institutetext:
SRON—Netherlands Institute for Space Research, Landleven 12, 9747 AD,
Groningen, The Netherlands 44institutetext: DEMO: Electronic and Mechanical
Support Division, Delft University of Technology, Mekelweg 4, 2628CD, Delft,
The Netherlands 55institutetext: Kitami Institute of Technology, 165 Koen-cho,
Kitami, 090-8507 Hokkaido, Japan 66institutetext: Leiden Observatory, Leiden
University, PO Box 9513, 2300 RA, Leiden, The Netherlands 77institutetext:
Faculty of Aerospace Engineering, Delft University of Technology, Kluyverweg
1, 2629 HS, Delft, The Netherlands

# Optimisation-based alignment of wideband integrated superconducting
spectrometers for sub-mm astronomy

A. Moerman, Corresponding author<EMAIL_ADDRESS>11 K. Karatsu 1122 S.
J. C. Yates 33 R. Huiting 22 F. Steenvoorde 44 S. O. Dabironezare 11 T.
Takekoshi 55 J. J. A. Baselmans 1122 B. R. Brandl 6677 A. Endo 11

(Received; accepted)

###### Abstract

Context. Integrated superconducting spectrometers (ISSs) for wideband sub-mm
astronomy utilise quasi-optical systems for coupling radiation from the
telescope to the instrument. Misalignment in these systems is detrimental to
the system performance. The common method of using an optical laser to align
the quasi-optical components requires accurate alignment of the laser to the
sub-mm beam coming from the instrument, which is not always guaranteed to a
sufficient accuracy.

Aims. To develop an alignment strategy for wideband ISSs directly utilising
the sub-mm beam of the wideband ISS. The strategy should be applicable in both
telescope and laboratory environments. Moreover, the strategy should deliver
similar quality of the alignment across the spectral range of the wideband
ISS.

Methods. We measure misalignment in a quasi-optical system operating at sub-mm
wavelengths using a novel phase and amplitude measurement scheme, capable of
simultaneously measuring the complex beam patterns of a direct-detecting ISS
across a harmonic range of frequencies. The direct detection nature of the
MKID detectors in our device-under-test, DESHIMA 2.0, necessitates the use of
this measurement scheme. Using geometrical optics, the measured misalignment,
a mechanical hexapod, and an optimisation algorithm, we follow a numerical
approach to optimise the positioning of corrective optics with respect to a
given cost function. Laboratory measurements of the complex beam patterns are
taken across a harmonic range between 205 and 391 GHz and simulated through a
model of the ASTE telescope in order to assess the performance of the
optimisation at the ASTE telescope.

Results. Laboratory measurements show that the optimised optical setup
corrects for tilts and offsets of the sub-mm beam. Moreover, we find that the
simulated telescope aperture efficiency is increased across the frequency
range of the ISS after the optimisation.

###### Key Words.:

instrumentation: spectrographs – methods: numerical

##  1 Introduction

Wideband sub-mm spectroscopy could serve as a powerful tool for studying a
wide range of astrophysical phenomena (Stacey, 2011). For single-pixel
spectroscopy, one such target is the redshifted [CII] emission line, which can
be used to probe star formation over cosmic time (Lagache et al., 2018), study
the universe at the epoch of reionization (Gong et al., 2011), and study high-
redshift dusty star-forming galaxies (Rybak et al., 2022). Multi-pixel
spectrometers, also called integral field units (IFUs), can spectroscopically
observe wide field-of-views. This allows for studies on larger spatial scales,
such as line intensity mapping of the [CII] line (Yue et al., 2015; Yue &
Ferrara, 2019; Karoumpis et al., 2022) which can be used to study the growth
of large-scale structure (LSS) in the early Universe. Also, the extragalactic
rotational emission lines of CO can be used in cross-correlation power spectra
studies with other LSS tracers such as the CIB (Maniyar et al., 2023) and the
Ly-$\alpha$ forest signal (Qezlou et al., 2023).

State-of-the-art integrated superconducting spectrometers (ISSs) for ground-
based wideband sub-mm astronomy, such as Superspec (Karkare et al., 2020),
µ-spec (Mirzaei et al., 2020) and DESHIMA (Endo et al., 2019a), rely on
superconducting detectors called microwave kinetic inductance detectors (Day
et al., 2003; Baselmans, 2012) (MKIDs) to detect incoming radiation. Unlike
quasi-optical spectrometers such as CONCERTO (Ade et al., 2020), an ISS
integrates both the detectors and the dispersive element on a single chip.
This includes everything from the antenna capturing the incoming radiation,
the filterbank or dispersive element that separates spectral channels, down to
the MKID detectors. An obvious advantage of the ISS is the scalability from a
single-pixel instrument to a multi-pixel IFU: because the entire device is
already fabricated on a single chip, it is possible to fabricate multiple of
these devices on a single wafer.

Coupling the broadband single-mode signal from the telescope to the single-
pixel ISS requires good alignment of all intermediate optical components. A
simple and effective design that is often adopted for heterodyne receivers
(see for example the ALMA band 5, 8, and 9 receivers (Belitsky et al., 2018;
Satou et al., 2008; Baryshev et al., 2015)) is to rigidly mount the waveguide
feed horn of the SIS mixer (Tucker & Feldman, 1985) (and optionally a simple 4
K fore-optics for polarization separation) near the Cassegrain focus of the
telescope, relying only on the movement of the secondary mirror to adjust the
focus. The requirements on the cartridges and beam pointings are strict,
ensuring tight mechanical tolerances. However, placing the detectors in the
vicinity of the telescope focus is not always possible, in which case
intermediate mirrors are introduced. For example, switching mirrors might be
introduced for multiple instruments to share the same focus. Especially in the
case of instruments with direct-detection detectors that operate at sub-Kelvin
temperatures, the cold detector mount tends to be mechanically more complex,
and there can be a set of cold re-imaging optics to reject stray light and
out-of-band thermal influx (Lamb, 2003; Holland et al., 2013; Endo et al.,
2019b). Each of these optical components have a finite alignment tolerance,
and make it hard to achieve good total optical coupling by adjusting only the
secondary mirror of the telescope. Additionally, errors in the mounting of the
cryostat housing the ISS introduce extra alignment issues, furthering the
problem.

One approach to correct for the misalignment in the quasi-optical chain is to
make one or more mirrors adjustable in their position. However, finding the
optimum position of these components in a systematic and reproducible manner
is not a trivial problem in practice. A common method is to use a visible-
light laser (Catalano et al., 2022; Endo et al., 2019a), but it requires the
propagation axis of the sub-mm beam to be aligned well with the laser ray,
which is not always guaranteed. Moreover, the method does not offer a way to
verify the quality of alignment in the telescope, nor does it give focal
shifts.

Here we demonstrate a method to adjust the position of an optical component to
correct for misalignment in a sub-mm quasi-optical system, which utilises a
pair of reflectors mounted on a motorized hexapod, a novel phase-and-amplitude
beam-pattern measurement technique, and an optimisation algorithm. We apply
the alignment method to the DESHIMA 2.0 (Taniguchi et al., 2022) sub-mm ISS.
DESHIMA 2.0 utilises a wideband leaky-lens antenna (Neto, 2010; Neto et al.,
2010; Hähnle et al., 2020), in combination with a superconducting filterbank
(Laguna et al., 2021; Thoen et al., 2022) coupled to an array of NbTiN-hybrid
MKID (Janssen et al., 2013) detectors, to observe the electromagnetic spectrum
between 220 and 440 GHz. The MKIDs are read out using a frequency-division
multiplexed readout (van Rantwijk et al., 2016), which allows for simultaneous
readout of all spectral channels. The DESHIMA 1.0 instrument has seen first
light (Endo et al., 2019b) at the ASTE (Ezawa et al., 2004) telescope, where a
4∘ residual beam tilt after the laser alignment was established as a cause for
the low aperture efficiency and distorted far-field beam patterns during the
observations. This makes its successor, DESHIMA 2.0, a prime candidate for the
development of the alignment strategy.

The paper is structured as follows: in Sect. 2.1 we start by briefly
introducing the optical chain of DESHIMA 2.0: the cryostat optics, the cabin
optics and the ASTE Cassegrain reflector. In Sect. 2.2 we discuss the
measurement technique we employ to obtain phase-amplitude beam patterns of the
ISS across a harmonic range of signal frequencies simultaneously. In Sect.
2.3, we discuss how we can use this measurement technique to extract
misalignment of the beam with respect to the designed optical axes of the
system. In Sect. 2.4, we discuss the optimisation strategy and how this
numerical approach can be applied to the alignment of a real-world optical
system. In Sect. 2.5 we give a description of the experimental setup for the
alignment procedure. In Sect. 3.1 we present results from laboratory
measurements to illustrate the performance of the optimised optical setup. In
Sect. 3.2, the complex beam patterns obtained from the measurements are
simulated through the ASTE telescope to assess the performance and
efficiencies of the aligned ISS at the telescope. Lastly, in Sect. 3.3, we
qualitatively investigate the far-field patterns of the instrument.

##  2 Methods

###  2.1 Optical chain

We begin by discussing the elements present in the optical path of DESHIMA 2.0
at ASTE. For a graphical overview of the optical setup, see, for example, Fig.
5.2 of (Dabironezare, 2020). We recreate the setup in Fig. 1 for completeness.
We take the coordinate system given in Fig. 1 as our standard: whenever we
refer to an $x$, $y$ or $z$-coordinate in this work, we refer to this system.

The first optical element encountered by radiation coming from the sky is the
Cassegrain setup at ASTE. The primary reflector $M_{1}$ is a parabolic
reflector that forms a Cassegrain setup together with $M_{2}$, a hyperbolic
secondary reflector. The Cassegrain setup directs the light through the upper
cabin, where the Cassegrain focus is located, into the lower cabin. The lower
cabin houses a dual reflector, which is based on a Dragonian (Dragone, 1978)
reflector design. The dual reflector acts as a coupler between the Cassegrain
setup and the cryostat housing of DESHIMA 2.0 and can conveniently act as
correcting optics when attached to the mechanical hexapod. The dual reflector
and hexapod are attached to the lower cabin ceiling by a support structure.
The first dual reflector mirror in the chain, $M_{3}$, is an off-axis
ellipsoid. The second mirror, $M_{4}$, is an off-axis hyperboloid and couples
light from $M_{3}$ into the cryostat. Because this dual reflector is situated
outside the cryostat, it is referred to as the ‘warm optics’.

One focus of the warm optics coincides with the Cassegrain focus. This focus
is located above the warm optics (see Fig. 1a) and is called the ‘warm focus’
($\vec{p}_{\mathrm{WF}}$). The plane parallel to the $xy$-plane, containing
$\vec{p}_{\mathrm{WF}}$, is called the ‘warm focal plane’. The second warm
optics focus is located to the left of the warm optics. This focus, called the
‘cold focus’ ($\vec{p}_{\mathrm{CF}}$), is located inside the cryostat and
coincides with the first focus of the cryostat optics. Our coordinate system
is placed such that the origin lies in $\vec{p}_{\mathrm{CF}}$. The plane
parallel to the $yz$ plane and containing $\vec{p}_{\mathrm{CF}}$ will be
denoted the ‘cold focal plane’. The cryostat optics consists of a parabolic
relay (Dabironezare, 2020) with two off-axis paraboloid reflectors, $M_{5}$
and $M_{6}$, in an aberration compensating configuration (Murphy, 1987). The
cryostat optics couple the radiation entering the cryostat to the ISS, which
is located below the cryostat optics in the second focus. The lower cabin
ceiling acts as a mechanical reference for the placement of the entire optical
setup inside the lower cabin. Therefore, any mounting errors of the cryostat
and hexapod support structures amounts to misalignment of the system with
respect to the entire telescope.

The final element in the optical chain is the leaky-lens antenna mounted on
the DESHIMA 2.0 chip. This structure converts the radiation impinging on the
lens into guided radiation which is fed to the filterbank through a co-planar
waveguide.

Figure 1: a) Sketch of the cryostat optics, warm optics and ASTE Cassegrain
setup. In addition to the optical elements, the hexapod, cryostat, support
structures and ASTE lower/upper cabin are also sketched. The warm focal plane
is denoted ‘WFP’ and the warm optics ‘WO’ in this sketch. The drawing is not
to scale. Note the Cartesian coordinate basis illustrated in between the
cryostat and warm optics. This is the standard coordinate system for the rest
of this work. b) Render of the lower cabin setup at ASTE. the warm optics is
illustrated in orange. The cryostat and hexapod support structures are
attached to the lower cabin ceiling at the blue surfaces. For reference, we
show the coordinate system from a) again. c) Photograph of the ASTE telescope
in the Atacama desert. The primary reflector $M_{1}$ and secondary reflector
$M_{2}$ are indicated. The lower cabin is located underneath the primary
mirror in between the mounting fork.

###  2.2 Harmonic phase-amplitude measurements

In order to assess the performance of the optimisation strategy, we need a
method to calculate how our measured beam patterns would propagate through the
telescope in which the device will be mounted. Coherent propagation of
electromagnetic fields, taking into account diffraction from the telescope
reflectors, is only possible when both the phase and amplitude (PA) patterns
of the instrument are known. In addition, misalignment of the sub-mm beam can
be extracted from the PA patterns. We therefore employ a quasi-heterodyne
measurement technique (Davis et al., 2019; Yates et al., 2020) which allows us
to obtain PA beam patterns of direct detectors, such as MKIDs. We specifically
employ an extension to the measurement technique, called the harmonic phase
and amplitude (HPA) measurement. This novel measurement technique is capable
of mapping PA beam patterns across a harmonic range of sub-mm frequencies
simultaneously. See Fig. 2 for a graphical overview and the laboratory setup
for the HPA measurement.

Figure 2: a) Sketch of the cryostat and HPA measurement setup. In green, the
two signal generators SG1 and SG2. The harmonic mixers are depicted in yellow.
The beamsplitter, colored pink and denoted BS, is situated such that its faces
are illuminated by both mx1 and mx2. A lens, depicted in red, is placed in
between mx2 and the beamsplitter to increase the coupling. The modulated
signal $U_{\mathrm{m}}$ then travels through the cryostat to the ISS. b)
Photograph of the HPA measurement setup in front of the cryostat window. The
components are color coded in the same fashion as in a). The mixer mx1 is
located inside the yellow disk on the left. The material in which mx1 is
embedded is a sheet of radiation absorbing material. This prevents standing
waves from generating in between mx1 and the cryostat window. In this
photograph, the $x$-axis depicted in Fig. 1a is pointing out of the cryostat
window, into the beamsplitter and scanning plane. The scanning plane is
oriented along the $z$ and $y$-axes. The diagonal horn containing mx2 is also
colored yellow and visible in the bottom of the image, below the lens which is
colored red.

The HPA measurement technique relies on the temporal modulation of an incoming
sub-mm radiation field $U_{1}$ by another sub-mm field $U_{2}$. The field
$U_{1}$ is generated by feeding a synthesizer signal SG1 at a frequency
$f_{0}=9.77$ GHz to a harmonic mixer mx1. We use an ultra-wideband
superlattice mixer (Paveliev et al., 2012), mounted in an open-ended wr4.3111A
wr4.3 to wr2.2 transition and wr2.2 corrugated horn was used as a crosscheck
at higher frequencies, so to work as a single moded source (as wr4.3 allows
higher order modes above 260GHz), but no difference was seen in the measured
results (except higher S/N, as the efficiency of higher harmonics increased).
waveguide. This mixer generates overtones at integer multiples of $f_{0}$ and
radiates the field through the waveguide into free space, resembling a point
source in its far-field (Yaghjian, 1984). The mixer mx1 can move in a plane,
the scanning plane, which allows us to map the instrument beam pattern as a
function of mx1 position.

The field $U_{2}$ is generated by another harmonic mixer mx2, identical to mx1
but fed by another synthesizer SG2, at a frequency $f_{0}+\Delta{f}$. The
mixer mx2 is fixed spatially and radiates a beam with a low opening angle into
free space through a diagonal horn antenna. SG1 and SG2 generate their signals
on a common clock, phase-locking $U_{1}$ and $U_{2}$ together. We choose
$\Delta{f}=12.11\>\mathrm{Hz}<f_{r}$, where $f_{r}=1.2$ kHz is the sampling
frequency of the MKIDs of the spectrometer. Then
$U_{1}(t)=\sum_{n}A_{n}\sin(2\pi nf_{0}t+\phi_{n,1})$, with
$n\in\\{21,...,41\\}\subset\mathbb{N}$ in our setup. This corresponds to a
frequency range between 205.07 and 390.62 GHz. The mixer mx2 radiates
$U_{2}(t)=\sum_{n}B_{n}\sin(2\pi n(f_{0}+\Delta{f})t+\phi_{n,2})$. These two
fields radiate into free space and illuminate a mylar beamsplitter, where they
are added together to generate $U_{\mathrm{m}}=U_{1}+U_{2}$, the modulated
field. In order to increase the coupling of $U_{2}$ to the MKIDs, we place a
lens between mx2 and the beamsplitter. Because $U_{\mathrm{m}}$ is amplitude-
modulated at integer multiples of $\Delta{f}$ and $f_{0}$, the detected power
$P_{\mathrm{det}}\propto|U_{\mathrm{m}}|^{2}$ in the instrument is modulated
at multiple modulation frequencies, with each modulation frequency
corresponding to a different harmonic contained in $U_{1}$:

$P_{\mathrm{det}}(t)\propto\sum_{n}A_{n}B_{n}\cos(2\pi n\Delta{f}t-\phi_{n}).$
(1)

Where $\phi_{n}=\phi_{n,1}+\phi_{n,2}$, the phase of the modulation frequency
$n\Delta{f}$ of $P_{\mathrm{det}}$. We have dropped all modulation terms that
have a frequency higher than $f_{r}$, as these terms do not contribute to the
measurable time-dependence of $P_{\mathrm{det}}$ but contribute to the
constant power entering the MKID. The amplitude $A_{n}B_{n}$ for each
modulation frequency $n\Delta f$ can be extracted by taking the Fourier
transform of $P_{\mathrm{det}}(t)$, for each point in the scanning plane, and
finding the amplitudes corresponding to each $n\Delta f$. An example of this
is illustrated in Fig. 3, where we show the raw timestream data and Fourier
transforms for three different MKIDs with filters at $nf_{0}$, each
simultaneously recorded at a single point in the scanning plane.

Figure 3: a) raw timestream data for $P_{\mathrm{det}}$ of MKID 171 at 205.07
GHz, taken at the center of the scanning plane. We have normalised
$P_{\mathrm{det}}$ to the time-averaged power $<P_{\mathrm{det}}>$ entering
the MKID. We plot the data for a time range of 50 ms. The modulation at
$n\Delta f$ is visible as the rapid oscillation of the timestream data, which
has a period of about 3.9 ms. b) raw timestream of MKID 96 at 214.84 GHz,
taken at the center of the scanning plane. c) raw timestream of MKID 47 at
224.61 GHz, taken at the center of the scanning plane. d) Magnitude of the
Fourier transforms of the signals in a), b), and c). The abscissa represents
the frequencies present in the time-modulation of $P_{\mathrm{det}}$ and is
denoted by $f_{\mathrm{mod}}$. The cyan dashed vertical line represents the
$n\Delta f$ for $nf_{0}=205.07$ GHz. Given the value of $f_{0}$, this
corresponds to $n=21$ and thus $n\Delta f=254.31$ Hz, which is where we would
expect the peak. The pink dashed line corresponds to $n=22$ for
$nf_{0}=214.84$ GHz and the violet dashed line to $n=23$, $nf_{0}=224.61$ GHz.

We utilise a phase reference signal to extract $\phi_{n,1}$ from $\phi_{n}$.
This signal is generated from SG1 and SG2 by feeding both signals into a
subtractive mixer mxs. The resulting signal, after low-pass filtering, has
frequency $\Delta{f}$ and some phase $\phi_{\mathrm{ref}}$. We electronically
modulate the entire instrument readout with the phase reference signal. Apart
from tones coupled to MKIDs, the readout contains several ‘blindtones’ that
are not coupled to any MKIDs, in order to monitor temporal drift during
observations. In post-processing, we can extract the phase reference signal,
and hence $\phi_{\mathrm{ref}}$, by taking the Fourier transform of the
blindtone readout timestreams and identifying the amplitude and phase of the
Fourier transform at $\Delta f$, for each point in the scanning plane. After
extraction, we can use the same blindtones to remove the readout modulation
from the MKID-coupled tones, which modulate at a different frequency, to
further suppress any leakage of the phase reference. By referencing the phases
$\phi_{n}$ of $P_{\mathrm{det}}$ to the phase reference signal phase
$\phi_{\mathrm{ref}}$ at each source position in the scanning plane, we can
spatially map the PA beam patterns across the harmonic range indexed by $n$.

###  2.3 Measuring misalignment

We call a beam, defined on some plane $P=P(x,y,z)\subset\mathbb{R}^{3}$ with
beam amplitude center at some point $\vec{p}\in P$, propagating in some
direction $\vec{\hat{\beta}}$, misaligned with respect to an axis
$\vec{\hat{\gamma}}$ if:

$\displaystyle\vec{p}\notin\mathrm{span}(\vec{\hat{\gamma}}),$ (2)
$\displaystyle\vec{\hat{\beta}}\cdot\vec{\hat{\gamma}}<1.$ (3)

Expression 2 corresponds to beam offsets, where the $P-\vec{\hat{\gamma}}$
intersection does not coincide with $\vec{p}$. Expression 3 corresponds to
beam tilt, where the propagation direction of the beam does not coincide with
the specified axis.

We measure beam misalignment at the cryostat by performing an HPA measurement
in front of the cryostat window (see Fig. 2b for the laboratory setup). The
beam misalignment is with respect to the optical axis coming out of the
cryostat window, which corresponds to the $x$-axis. The optical axis
originates from the cold focus $\vec{p}_{\mathrm{CF}}$. The beam propagation
direction coming out of the cold focal plane is denoted
$\vec{\hat{\beta}}^{\prime}_{B}$.

Before we start the measurement, we center mx1 on the beam coming from the
ISS, by finding the position in the scanning plane at which the MKID responses
are the highest. Then, we start the HPA measurement and the beam patterns are
obtained, one for each frequency $nf_{0}$. We fit a complex-valued, astigmatic
Gaussian beam to each measured beam pattern. This fit can be used to obtain
$\vec{\hat{\beta}}^{\prime}_{B}$ (Tong et al., 2003; Davis et al., 2016) by
also including the rotation of the plane of the Gaussian as a free parameter
in the fit. This is possible because beam tilt introduces a mismatch between
the amplitude and phase centers of the beam pattern in the scanning plane
(Chen et al., 2000). See Fig. 4 for an illustration of this. Additionally, the
Gaussian fit produces the location of the fitted Gaussian beam focal spot with
respect to the scanning plane center, which we will assume to be equal to
$\vec{p}_{\mathrm{CF}}$, the cryostat focus of the actual beam.

Figure 4: Complex beam patterns at 205 GHz, as measured with the HPA technique
after the warm focal plane, with the hexapod in home configuration. a)
Amplitude pattern. b) Phase pattern. The co-ordinates are with respect to the
warm focus. Note that, since these are measured in the laboratory using the
setup in Fig. 5b, we use the scanning plane axes as shown in Fig. 5a, with the
warm focus in the $xz$-plane. We denote the amplitude and phase centers with
black crosses. It can be seen that these are different, which indicates that
the beam is tilted with respect to the scanning plane normal.

The hexapod and warm optics setup could also contribute misalignment due to,
for example, mounting errors of the support structure. In this case, the
optical axis is the $z$-axis and the point we take as reference is the warm
focus $\vec{p}_{\mathrm{WF}}$. The beam center in the warm focal plane is
denoted $\vec{p}_{B}$. The beam propagation direction coming out of the warm
focal plane is denoted by $\vec{\hat{\beta}}_{B}$.

To measure the misalignment in the warm focal plane, we repeat the HPA
measurement around the warm focal plane and calculate the beam offsets in the
warm focal plane using the beam offset in the scanning plane and the Gaussian
fit. The beam tilts in the scanning plane are identical to those in the warm
focal plane and can be used as-is. See Fig. 5a for a sketch and Fig. 5b for a
photograph of this HPA setup in the laboratory.

Figure 5: a) Sketch of the HPA measurement setup around the warm focal plane.
The sketch is similar to the sketch in Fig. 2a, the only difference being the
addition of the warm optics and hexapod and a change of the scanning
directions resulting from the positioning of mx1. b) Photograph of the lab
setup, with the scanning plane after the warm optics. The lab setup is
essentially the same as Fig. 2b, except for the addition of the warm optics,
which is colored orange. Also, the signal generators can be seen now. Note the
$-90^{\circ}$ rotation around the optical axis coming out of the cryostat
window with respect to the optical configuration shown in Fig. 2b. The lab
photograph has the same color coding as the sketch in a). Note that, because
the optical axis coming from the warm optics is now oriented along the
$y$-axis, the scanning plane is now oriented along the $x$ and $z$-axes. This
is also reflected in a).

###  2.4 Optimisation strategy

In essence, the optimisation strategy involves simulating the warm optics and
hexapod, and performing ray-traces through the warm optics to calculate the
optimal hexapod configuration, given some misalignment at the cryostat. All
the ray-tracing calculations and simulations of the warm optics are done using
the optical simulation software PyPO (Moerman et al., 2023).

We start by defining a ray representation $B$ of a Gaussian beam (Crooker et
al., 2006), oriented along the $x$-axis, and placing the focus in
$\vec{p}_{\mathrm{CF}}$. We apply the beam tilt at the cold focal plane to $B$
by orienting $B$ along the measured $\vec{\hat{\beta}}^{\prime}_{B}$. Then,
the rays are propagated through the warm optics and into the warm focal plane
where the following cost function is evaluated:

$\displaystyle\delta(\vec{p}_{\mathrm{hex}},\vec{\theta}_{\mathrm{hex}})=\frac{|\vec{p}_{B}(\vec{p}_{\mathrm{hex}},\vec{\theta}_{\mathrm{hex}})-\vec{p}_{0}|}{\Delta{l_{\mathrm{min}}}}+\frac{\arccos(\vec{\hat{\beta}}_{B}(\vec{p}_{\mathrm{hex}},\vec{\theta}_{\mathrm{hex}})\cdot\vec{\hat{\gamma}}_{0})}{\Delta{\alpha_{\mathrm{min}}}}.$
(4)

Here, $\vec{p}_{B}$ represents the geometric centre of all rays in $B$
evaluated in the warm focal plane, $\vec{\hat{\beta}}_{B}$ the mean
propagation direction of $B$, $\vec{p}_{\mathrm{hex}}$ the simulated hexapod
position, and $\vec{\theta}_{\mathrm{hex}}$ the simulated hexapod orientation.
The beam offset is optimised with respect to $\vec{p}_{0}$ and the beam tilt
with respect to $\vec{\hat{\gamma}}_{0}$. In this case,
$\vec{p}_{0}=\vec{p}_{\mathrm{WF}}$ and
$\vec{\hat{\gamma}}_{0}=\vec{\hat{z}}$. The parameters
$\Delta{l_{\mathrm{min}}}$ and $\Delta{\alpha_{\mathrm{min}}}$ are weights
that control the required accuracy in the optimisation. In this work, we adopt
the following values: $\Delta{l_{\mathrm{min}}}=1$ mm and
$\Delta{\alpha_{\mathrm{min}}}=0.1^{\circ}$. Note that we only consider the
beam offset in the warm focal plane and not along the optical axis. This
implies that the strategy does not explicitly correct for defocus, which is
misalignment along the optical axis, but only for lateral misalignment in the
warm focal plane. We find that the inclusion of the focal position in Eq. 4,
by means of adding the root-mean-square (RMS) size of the ray-trace beam
evaluated in the warm focal plane, divided by a weight of
$\Delta\mathrm{RMS}_{\mathrm{min}}=1$ mm, does not produce a difference in
hexapod configuration or beam RMS size compared to an optimisation without
focal position. Including the focus with a
$\Delta\mathrm{RMS}_{\mathrm{min}}=0.1$ mm results in a reduced beam RMS size,
indicating that the focus is now closer to the warm focal plane, but also
results in a large beam offset and tilt. This indicates that, at least with
some misaligned initial conditions at the cold focus, it is not possible to
fully correct for defocusing while at the same time having the beam intersect
the warm focus at perpendicular incidence to the warm focal plane. We find
that the typical distance along the $z$-axis between the warm focus to the
ray-trace beam focus is on the order of $\sim$100 mm, which can easily be
corrected for by adjusting $M_{2}$ of the ASTE telescope along the $z$-axis.
Therefore, we do not include the focal position in Eq. 4 and optimise by
minimising only the beam offset and tilt. For a sketch of the local warm focal
plane geometry with optimisation quantities, see Fig. 6.

Figure 6: 2D sketch of the warm focal plane and the parameters described in
Eq. 4. The figure is a zoom of the warm focal plane shown in Fig. 2, with the
misaligned ray direction $\hat{\boldsymbol{\beta}}$ exaggerated. The
coordinate system is identical to the one shown in Fig. 1a.

The minimisation of Eq. 4 is performed using the differential evolution
optimisation algorithm (Storn & Price, 1997), which is well suited for
optimisation problems with several degrees of freedom. The optimal hexapod
configuration is then $\vec{p}_{\mathrm{opt}}$ and
$\vec{\theta}_{\mathrm{opt}}$, which are the $\vec{p}_{\mathrm{hex}}$ and
$\vec{\theta}_{\mathrm{hex}}$ corresponding to the lowest value of $\delta$,
and can be applied as a correction to the real-world hexapod to align the
optical setup.

As mentioned before, the hexapod and warm optics setup could be misaligned as
well, in addition to misalignment at the cryostat window. To find this we
first measure the beam center $\vec{p}^{0}_{B}$ in the warm focal plane and
propagation direction $\vec{{\hat{\beta}}}^{0}_{B}$ after the warm optics
using the HPA method. The superscript ‘0’ indicates that this measurement
takes place before the optimisation procedure. By then optimising Eq. 4 with
$\vec{p}_{0}=\vec{p}^{0}_{B}$ and
$\vec{\hat{\gamma}}_{0}=\vec{{\hat{\beta}}}^{0}_{B}$, we obtain
$\vec{p}^{0}_{\mathrm{hex}}$ and $\vec{\theta}^{0}_{\mathrm{hex}}$, the real-
world translational and rotational hexapod offsets contributing to the
measured beam misalignment in the warm focal plane. These hexapod offsets can
then be added on top of the $\vec{p}_{\mathrm{hex}}$ and
$\vec{\theta}_{\mathrm{hex}}$ tried by the optimisation in Eq. 4, with
$\vec{p}_{0}=\vec{p}_{\mathrm{WF}}$ and
$\vec{\hat{\gamma}}_{0}=\vec{\hat{z}}$, to take into account the real-world
hexapod offsets:

$\displaystyle\vec{p}_{\mathrm{hex}}$
$\displaystyle\xrightarrow{}\vec{p}_{\mathrm{hex}}+\vec{p}^{0}_{\mathrm{hex}},$
$\displaystyle\vec{\theta}_{\mathrm{hex}}$
$\displaystyle\xrightarrow{}\vec{\theta}_{\mathrm{hex}}+\vec{\theta}^{0}_{\mathrm{hex}}.$

The optimisation then returns the optimised hexapod translation
$\vec{p}_{\mathrm{opt}}$ and rotation $\vec{\theta}_{\mathrm{opt}}$,
calculated on top of $\vec{p}^{0}_{\mathrm{hex}}$ and
$\vec{\theta}^{0}_{\mathrm{hex}}$. When applying the optimisation result to
the real-world hexapod, care should be taken to only apply
$\vec{p}_{\mathrm{opt}}$ and $\vec{\theta}_{\mathrm{opt}}$, and not
$\vec{p}^{0}_{\mathrm{hex}}$ and $\vec{\theta}^{0}_{\mathrm{hex}}$.

Then, an HPA measurement around the warm focal plane can be performed to
assess the new beam center $\vec{p}^{1}_{B}$ and propagation direction
$\vec{\hat{\beta}}^{1}_{B}$. Here, the ‘1’ superscript indicates that these
misalignments are measured after the optimised configuration is applied to the
real-world hexapod. If significant residual misalignment is present, an
iterative approach is taken. For this, we first generate a characterisation of
the warm optics (see Appendix A) to see how the hexapod degrees-of-freedom
(DoFs) affect the beam misalignment. Using this characterisation, we can
select hexapod DoFs to include in the optimisation and hexapod offset finding.

The optimisation strategy can directly be applied at the telescope. This
involves recreating the experimental setup shown in Fig. 5b inside the lower
cabin. The mixer mx1 needs to be placed in the upper cabin (see Fig. 1a) and
placed such that it faces $M_{3}$. This adaptability makes the strategy
versatile, as it can be applied in a variety of contexts.

###  2.5 Experimental setup

To test the alignment procedure, we recreate the lower cabin setup at ASTE
(see Fig. 5b) in the laboratory. Because the laboratory ceiling is not high
enough to place mx1 above the warm optics, the warm optics and hexapod are
rotated by $-90^{\circ}$ around the $x$-axis. This places the warm focal plane
parallel to the $xz$ plane and places the optical axis coming out of the warm
optics parallel the $y$-axis. Consequently, the beam tilts in the warm focal
plane are now defined and measured with respect to the $x$ and $z$-axes,
instead of the $x$ and $y$-axes. Also, the 30∘ tilt of the cryostat around the
$x$-axis present in the ASTE lower cabin setup (see Fig. 1b) is not applied to
the laboratory cryostat.

For the HPA measurements in front of the cryostat window, we place the
scanning plane about 30 cm after the cold focal plane along the positive
$x$-axis. For the HPA measurements after the warm optics, we place the
scanning plane about 25 cm after the warm focal plane along the $y$-axis.

We manually measure the translation of the scanning plane from the position in
front of the cryostat window to the position after the warm optics. Because we
know the distance between $\vec{p}_{\mathrm{CF}}$ and the scanning plane
center after the cryostat window, the scanning plane translation can be used
to obtain the absolute position of the scanning plane center after the warm
optics with respect to $\vec{p}_{\mathrm{CF}}$, and hence
$\vec{p}_{\mathrm{WF}}$. This allows us to place the measured beam center
after the warm optics in the co-ordinate system used for the optimisation
described in Sect. 2.4 and to quantitatively assess the offset between
$\vec{p}_{\mathrm{WF}}$ and the measured beam focus in the warm focal plane
during the iterative part of the optimisation.

In order to simulate propagation of the measured beam patterns through the
Cassegrain setup at ASTE, we rotate the beam patterns back by $90^{\circ}$
around the $x$-axis, so that the scanning plane normal is oriented along the
$z$-axis. Then, we take the fitted beam focus position, averaged across the
HPA frequency range, and assume that this position overlaps with the
Cassegrain focus of ASTE. This allows us to place the scanning plane in a
model of ASTE and simulate the propagation of the measured beam patterns using
PyPO, while keeping the distance between $M_{2}$ and the warm focal plane
fixed at the design distance. At the real telescope, this corresponds to focus
correction by $M_{2}$, as described in Sect. 2.4, such that the Cassegrain
focus overlaps with the fitted beam focus.

##  3 Results

###  3.1 Reduction of beam misalignment

The first result we find is a reduction of the beam misalignment. We measure
the beam tilt coming out of the cryostat to be
$\theta^{\prime}_{y}\approx-0.4^{\circ}$ and
$\theta^{\prime}_{z}\approx-3.1^{\circ}$, around the $y$ and $z$-axes,
respectively. The misalignment around the $z$-axis is consistent with a
rotation in the cryostat mounting, which we measured to be $\sim-2.5^{\circ}$.
We apply the iterative optimisation procedure as described. Because the
hexapod DoF characterisation (see Appendix A) indicated that rotational and
translational DoFs are degenerate (that is, they have the same effect on the
beam direction after the warm optics), we only included translational DoFs in
the iterative optimisation.

The alignment procedure required two iterations on top of the initial
optimisation in total and took roughly three hours. This corresponds to five
HPA measurements in total, one in front of the cryostat and four around the
warm focal plane. Most of the total time was spent on the HPA measurements,
which was about 30 minutes per measurement of which 10 minutes was spent
uploading and downloading measurement data. The numerical optimisation and
hexapod offset finding were negligible in the time budget, each taking about
10 seconds to complete. This is due to the efficient multi-threaded
differential evolution implementation in SciPy (Virtanen et al., 2020) and the
restriction of the DoF space of the hexapod to translational DoFs. The results
for the warm focal plane beam offset and beam tilt can be found in Fig. 7.

Figure 7: a) Decrease in focal offset, defined as
$\vec{p}_{B}-\vec{p}_{\mathrm{WF}}$. The red data points correspond to offsets
along the $z$-axis and the blue data points to offsets along the $x$-axis. b)
Decrease in beam tilts around the $x$ and $z$-axes. Both the focal offset and
beam tilt are illustrated as function of iteration number. Here, ‘0’
corresponds to the setup in the hexapod home position and ‘1’ to the initial
optimised hexapod configuration. Subsequent iteration numbers corresponds to
steps of the iterative procedure proper. The lines are drawn between the data
points to highlight the tendencies of the iterations.

It can be seen from Fig. 7 that the beam offset in the warm focal plane is
already reduced significantly after the initial optimisation. The final beam
offset is on the order of 1 mm, which is an order of magnitude smaller than
the initial beam offset. The beam tilt converges slower, but reaches an
acceptable tilt smaller than 0.1∘ after the second iteration.

###  3.2 Increase in telescope efficiency

We find that the telescope efficiency of the instrument is substantially
increased by the optimisation. The measured PA beam patterns are propagated
through a model of ASTE using physical optics (Balanis, 1999) and the
efficiency terms in Appendix B are calculated. The results are shown in Fig.
8.

Figure 8: Calculated telescope efficiencies for the ISS at ASTE. a) Spillover
efficiency $\eta^{\mathrm{sec}}_{\mathrm{so}}$ calculated on $M_{2}$. b) Taper
efficiency $\eta_{\mathrm{t}}$ calculated in the aperture of $M_{1}$. c)
Aperture efficiency $\eta_{\mathrm{ap}}$, defined as
$\eta^{\mathrm{sec}}_{\mathrm{so}}\eta_{\mathrm{t}}$. Blue dots represent the
optimised configuration, red dots the home configuration and black diamonds
the design values of an ideal setup. The errorbars are calculated from the
error in the Gaussian fit used to determine the beam misalignment.

It can be seen that the optimised setup performs considerably better than the
misaligned setup in the hexapod home configuration, for all three
efficiencies, across all measured frequencies. The secondary spillover
efficiency $\eta^{\mathrm{sec}}_{\mathrm{so}}$ is slightly lower than the
design value, whilst the taper efficiency $\eta_{\mathrm{t}}$ is slightly
higher. The decrease in $\eta^{\mathrm{sec}}_{\mathrm{so}}$ could be due to a
higher illumination level on the edge of $M_{2}$, which also explains the
increase in $\eta_{\mathrm{t}}$. Nevertheless, the aperture efficiency
$\eta_{\mathrm{ap}}$ is roughly consistent with the design value and
considerably better than the misaligned values. It should be noted that, for
both the optimised and misaligned setup, Ruze losses (Ruze, 1966) due to
surface roughness of the ASTE Cassegrain are not taken into account.

We calculate the mean $\eta_{\mathrm{ap}}$ across the frequency range for the
optimised configuration to be $\eta_{\mathrm{ap}}=0.73\pm 0.04$. In
comparison, the home (misaligned) configuration has a mean
$\eta_{\mathrm{ap}}=0.39\pm 0.03$. To put this into perspective, we can, for
the optimised and home configuration, calculate the ratio of necessary
observation times to obtain the same signal-to-noise ratio (S/N):

$R_{t}=\frac{t^{\prime}}{t}\propto\left(\frac{\eta_{\mathrm{ap}}}{\eta_{\mathrm{ap}}^{\prime}}\right)^{2},$
(5)

where the primed quantities denote either the optimised or home configuration.
Note that Eq. 5 is valid for point sources only. We find that our optimised
hexapod configuration results in a decrease in required observation time of a
factor $R_{t}=3.5\pm 0.7$. This can have a significant impact, especially for
long observations that require high S/N for faint targets.

###  3.3 Far-field analysis

We propagate the measured beam patterns to the telescope far-field using PyPO
and analyse the results. In Fig. 9 we show the effect of the optimisation on
the half-power beamwidths (HPBWs) in the E and H-plane. Here, we define the
E-plane to lie along the semi-minor axis of the far-field main beam and the
H-plane to lie along the semi-major axis. We find that the HPBWs of the
optimised setup are decreased with respect to the misaligned setup and are
slightly smaller than the design values across all measured frequencies. This
is consistent with a higher edge illumination on the secondary, which was
already hypothesised as an explanation for the lower
$\eta^{\mathrm{sec}}_{\mathrm{so}}$ and larger $\eta_{\mathrm{t}}$. By design,
the primary reflector of the telescope is under-illuminated at the edges and
by slightly increasing the illumination level towards the outer sections on
the primary, we slightly decrease our beam size.

Figure 9: Calculated HPBWs for the home and optimised configuration as
function of signal frequency. a) HPBWs in the E-plane. b) HPBWs in the
H-plane.

Lastly, we perform a qualitative comparison of the far-field beam patterns. We
restrict the discussion to the lowest and highest measured frequencies, at 205
and 391 GHz respectively. In Fig. 10 we compare the 2D far-field beam
patterns.

Figure 10: 2D far-field beam patterns on-sky. a) 205 GHz, hexapod in home
configuration. b) 205 GHz, hexapod in optimised configuration. c) 391 GHz,
hexapod in home configuration. d) 391 GHz, hexapod in optimised configuration.
All beam patterns are centered such that the beam centers are at
$\mathrm{dAz}=\mathrm{dEl}=0$ as.

It is clear that the optimisation reduces the beam ellipticity. This is
consistent with Eq. 4, because the optimisation criteria favour a centrally
illuminated secondary. With the hexapod in home configuration, the beam
pattern is asymmetrically illuminating the secondary reflector and, therefore,
primary aperture, giving rise to elliptical beam patterns in the far-field.
This also indicates that the home configuration suffers from lower
$\eta^{\mathrm{sec}}_{\mathrm{so}}$, as a smaller fraction of the beam pattern
is intercepted by the secondary. This finding supports the observation from
Fig. 8 and is another indication of the veracity of the alignment procedure.

##  4 Conclusions

We have developed an alignment procedure for the DESHIMA 2.0 wideband sub-mm
ISS, utilising an optimisation strategy together with a hexapod and a modified
Dragonian dual reflector. We used the novel HPA measurement technique to
obtain the phase and amplitude beam patterns of the instrument and used these
to quantitatively measure the misalignment in our optical chain. Because we
directly utilise the sub-mm beam of the ISS instead of a more conventional
laser guide, we can accurately quantify the misalignment in the optical
system. Then, using the optimisation strategy, we obtained a hexapod
configuration which successfully mitigated the misalignment that was present.
This was verified by laboratory measurements that show that the beam
misalignment with the optimised hexapod configuration was sufficiently
reduced. The calculated aperture efficiencies of the aligned ISS at the ASTE
telescope are improved with respect to the misaligned case. Moreover, the
calculated far-field after the telescope shows improvement in the form of
reduced main beam size and more symmetric beam shapes. All these findings are
mutually consistent and support the veracity of the alignment procedure.

The proposed alignment procedure can be directly employed at the telescope by
putting the HPA setup in the lower cabin, emulating Fig. 5b. The scanning
plane itself can be placed in the ASTE upper cabin. Although this would be a
complex effort due to the limited space present in the telescope lower and
upper cabin, it is not impossible. For example, the scanning plane movement
stage could be attached to the top of the hexaport support structure (see Fig.
1b) with the stage protruding upward into the upper cabin, allowing the
scanning source itself to be located in the upper cabin and eliminating the
need for additional support structures in the upper cabin. The importance of
the alignment procedure can be appreciated in the context of the upcoming
science verification campaign of DESHIMA 2.0. One science case of the
campaign, rapid redshift surveys of dusty star-forming galaxies (Rybak et al.,
2022), predicts a 400 hour observation period to yield robust redshifts of the
targets. This assumes a well-aligned system and if misalignment is present,
the required observation time will increase significantly.

The alignment procedure is also of interest for future extensions of the
single-pixel ISS towards an ISS-based IFU. The cost function in Eq. 4 is
designed to align the ISS to the optical axis of the telescope. Because the
HPA technique can be used to measure the beam patterns of the pixels in the
IFU individually, alignment information can be extracted for each pixel
individually. Then, the optimisation procedure in this work can be used again
by using a cost function more suitable for multi-pixel instruments.

###### Acknowledgements.

This work was supported by the European Union (ERC Consolidator Grant No.
101043486 TIFUUN). Views and opinions expressed are however those of the
authors only and do not necessarily reflect those of the European Union or the
European Research Council Executive Agency. Neither the European Union nor the
granting authority can be held responsible for them. TT was supported by the
MEXT Leading Initiative for Excellent Young Researchers (Grant No.
JPMXS0320200188).

## References

  * Ade et al. (2020) Ade, P., Aravena, M., Barria, E., et al. 2020, A&A, 642, A60
  * Balanis (1999) Balanis, C. A. 1999, Advanced engineering electromagnetics (John Wiley & Sons), 755
  * Baryshev et al. (2015) Baryshev, A. M., Hesper, R., Mena, F. P., et al. 2015, A&A, 577, A129
  * Baselmans (2012) Baselmans, J. 2012, J. Low Temp. Phys., 167, 292–304
  * Belitsky et al. (2018) Belitsky, V., Bylund, M., Desmaris, V., et al. 2018, A&A, 611, A98
  * Catalano et al. (2022) Catalano, A., Ade, P., Aravena, M., et al. 2022, EPJ Web of Conferences, 257, 00010
  * Chen et al. (2000) Chen, M.-T., Tong, C., Papa, D., & Blundell, R. 2000, in 2000 IEEE MTT-S International Microwave Symposium Digest (Cat. No.00CH37017) (IEEE)
  * Crooker et al. (2006) Crooker, P. P., Colson, W. B., & Blau, J. 2006, Am. J. Phys., 74, 722
  * Dabironezare (2020) Dabironezare, S. O. 2020, PhD thesis, Delft University of Technology
  * Davis et al. (2016) Davis, K. K., Jellema, W., Yates, S. J. C., et al. 2016, IEEE Trans. Terahertz Sci. Technol., 7, 1
  * Davis et al. (2019) Davis, K. K., Yates, S. J. C., Jellema, W., et al. 2019, IEEE Trans. Terahertz Sci. Technol., 9, 67
  * Day et al. (2003) Day, P. K., LeDuc, H. G., Mazin, B. A., Vayonakis, A., & Zmuidzinas, J. 2003, Nature, 425, 817
  * Dragone (1978) Dragone, C. 1978, Bell System Technical Journal, 57, 2663
  * Endo et al. (2019a) Endo, A., Karatsu, K., Laguna, A. P., et al. 2019a, J. Astron. Telesc. Instrum. Syst., 5, 035004
  * Endo et al. (2019b) Endo, A., Karatsu, K., Tamura, Y., et al. 2019b, Nat. Astron., 3, 989
  * Ezawa et al. (2004) Ezawa, H., Kawabe, R., Kohno, K., & Yamamoto, S. 2004, in Proc. SPIE, ed. J. Jacobus M. Oschmann (SPIE)
  * Goldsmith (1998) Goldsmith, P. F. 1998, Quasioptical Systems (New York: Wiley)
  * Gong et al. (2011) Gong, Y., Cooray, A., Silva, M., et al. 2011, ApJ, 745, 49
  * Hähnle et al. (2020) Hähnle, S., Yurduseven, O., van Berkel, S., et al. 2020, IEEE Trans. Antennas Prop., 68, 5675
  * Holland et al. (2013) Holland, W. S., Bintley, D., Chapin, E. L., et al. 2013, MNRAS, 430, 2513
  * Janssen et al. (2013) Janssen, R. M. J., Baselmans, J. J. A., Endo, A., et al. 2013, Appl. Phys. Lett., 103, 203503
  * Karkare et al. (2020) Karkare, K. S., Barry, P. S., Bradford, C. M., et al. 2020, J. Low Temp. Phys., 199, 849
  * Karoumpis et al. (2022) Karoumpis, C., Magnelli, B., Romano-Díaz, E., Haslbauer, M., & Bertoldi, F. 2022, A&A, 659, A12
  * Lagache et al. (2018) Lagache, G., Cousin, M., & Chatzikos, M. 2018, A&A, 609, A130
  * Laguna et al. (2021) Laguna, A. P., Karatsu, K., Thoen, D., et al. 2021, IEEE Trans. Terahertz Sci. Technol., 11, 635
  * Lamb (2003) Lamb, J. 2003, IEEE Trans. Antennas Prop., 51, 2035
  * Maniyar et al. (2023) Maniyar, A. S., Gkogkou, A., Coulton, W. R., et al. 2023, Phys. Rev. D, 107
  * Mirzaei et al. (2020) Mirzaei, M., Barrentine, E. M., Bulcha, B. T., et al. 2020, in Millimeter, Submillimeter, and Far-Infrared Detectors and Instrumentation for Astronomy X, ed. J. Zmuidzinas & J.-R. Gao (SPIE)
  * Moerman et al. (2023) Moerman, A., Gafaji, M. H., Karatsu, K., & Endo, A. 2023, J. Open Source Softw., 8, 5478
  * Murphy (1987) Murphy, J. A. 1987, Int. j. infrared millim. waves, 8, 1165
  * Neto (2010) Neto, A. 2010, IEEE Trans. Antennas Prop., 58, 2238
  * Neto et al. (2010) Neto, A., Monni, S., & Nennie, F. 2010, IEEE Trans. Antennas Prop., 58, 2248
  * Paveliev et al. (2012) Paveliev, D. G., Koshurinov, Y. I., Ivanov, A. S., et al. 2012, Semiconductors, 46, 121
  * Qezlou et al. (2023) Qezlou, M., Bird, S., Lidz, A., et al. 2023, MNRAS, 524, 1933
  * Ruze (1966) Ruze, J. 1966, Proc. IEEE, 54, 633
  * Rybak et al. (2022) Rybak, M., Bakx, T., Baselmans, J., et al. 2022, J. Low Temp. Phys.
  * Satou et al. (2008) Satou, N., Sekimoto, Y., Iizuka, Y., et al. 2008, Publ. Astron. Soc. Jpn., 60, 1199
  * Stacey (2011) Stacey, G. J. 2011, IEEE Trans. Terahertz Sci. Technol., 1, 241
  * Storn & Price (1997) Storn, R. & Price, K. 1997, J. Glob. Optim., 11, 341
  * Taniguchi et al. (2022) Taniguchi, A., Bakx, T. J. L. C., Baselmans, J. J. A., et al. 2022, J. Low Temp. Phys., 209, 278
  * Thoen et al. (2022) Thoen, D. J., Murugesan, V., Laguna, A. P., et al. 2022, J. Vac. Sci. Technol. B, 40, 052603
  * Tong et al. (2003) Tong, C.-Y., Meledin, D., Marrone, D., et al. 2003, IEEE Microw. Wirel. Compon. Lett., 13, 235
  * Tucker & Feldman (1985) Tucker, J. R. & Feldman, M. J. 1985, RMP, 57, 1055
  * van Rantwijk et al. (2016) van Rantwijk, J., Grim, M., van Loon, D., et al. 2016, IEEE Trans. Microw. Theory Tech., 64, 1876
  * Virtanen et al. (2020) Virtanen, P., Gommers, R., Oliphant, T. E., et al. 2020, Nature Methods, 17, 261
  * Yaghjian (1984) Yaghjian, A. 1984, IEEE Trans. Antennas Prop., 32, 378
  * Yates et al. (2020) Yates, S. J. C., Davis, K. K., Jellema, W., Baselmans, J. J. A., & Baryshev, A. M. 2020, J. Low Temp. Phys., 199, 156
  * Yue & Ferrara (2019) Yue, B. & Ferrara, A. 2019, MNRAS, 490, 1928
  * Yue et al. (2015) Yue, B., Ferrara, A., Pallottini, A., Gallerani, S., & Vallini, L. 2015, MNRAS, 450, 3829

##  Appendix A Characterising hexapod DoFs

In order to link hexapod DoFs to beam misalignment parameters, a
characterisation can be performed. This involves performing ray-traces through
the warm optics, from $\vec{p}_{\mathrm{CF}}$ into the warm focal plane. We do
not apply $\vec{\hat{\beta}}^{\prime}_{B}$ to the ray-trace beam for the
characterisation. For each ray-trace, we adjust the hexapod configuration
along a single degree of freedom (DoF), whilst keeping the other DoFs fixed at
home position, i.e. at zero translation/rotation. In this way, we can
characterise the effect a single DoF has on the simulated beam offset and tilt
in the warm focal plane. Then, specific DoFs that couple to the measured beam
misalignment can be selected in the matching or optimisation run. Here we
present an example in the context of the optical system treated in this work.
We show a characterisation for $Z$, the hexapod DoF which lies along the
$z$-axis in Fig. 1a.

Figure 11: Beam misalignment parameters versus the hexapod DoF along the
$z$-axis, in millimeters. The ray-trace beam is evaluated in the warm focal
plane, according to Fig. 1a. a) Beam offset $\Delta x$ along the $x$-axis in
mm. b) Beam offset $\Delta y$ along the $y$-axis in mm. Both offsets are
calculated with respect to $\vec{p}_{\mathrm{WF}}$. c) Beam tilt $\theta_{x}$
around the $x$-axis in degrees. d) Beam tilt $\theta_{y}$ around the $y$-axis
in degrees.

It is evident from Fig. 11 that this particular DoF strongly couples to the
beam offset along the $x$-axis and the beam tilt around the $y$-axis. If a
measured beam is misaligned in these two parameters, this DoF would be
included in the matching-optimising steps of the iterative optimisation
procedure. It does not couple to the beam offset along the $y$-axis and the
beam tilt around the $x$-axis. This indicates that, if misalignment is found
in any of the non-coupling parameters, another DoF needs to be considered for
inclusion in the matching-optimising.

##  Appendix B Telescope efficiencies

Here we give the used expressions for $\eta^{\mathrm{sec}}_{\mathrm{so}}$,
$\eta_{\mathrm{t}}$ and $\eta_{\mathrm{ap}}$. The secondary spillover
$\eta^{\mathrm{sec}}_{\mathrm{so}}$ is calculated over the secondary aperture
and is given by:

$\eta^{\mathrm{sec}}_{\mathrm{so}}=\frac{|\int_{S_{\mathrm{a}}}E^{\star}_{i}E_{i}\mathrm{d}{S_{\mathrm{a}}}|^{2}}{\int_{S_{\mathrm{a}}}|E_{i}|^{2}\mathrm{d}{S_{\mathrm{a}}}\int_{S^{\prime}_{\mathrm{a}}}|E_{i}|^{2}\mathrm{d}{S^{\prime}_{\mathrm{a}}}},$
(6)

where $E_{i}$ denotes the electric field illuminating the extended reflector
aperture plane $S^{\prime}_{a}$, which is defined as the spatially extended
version of the secondary reflector aperture $S_{a}$. In practice, we oversize
$S^{\prime}_{a}$ to have a radius three times that of $S_{a}$, so that we
capture sufficient spillover radiation. The $\star$ denotes complex
conjugation. This efficiency is a measure of how much illumination is
intercepted by the secondary reflector. Because the spillover losses on the
primary reflector are negligible in both the misaligned and optimised
configuration, these are not discussed.

The second efficiency we discuss is the taper efficiency $\eta_{\mathrm{t}}$.
This efficiency is a measure of the uniformity of the amplitude and phase
patterns of the beam in the primary aperture plane $P_{\mathrm{a}}$ and is
calculated as follows:

$\eta_{\mathrm{t}}=\frac{1}{\Sigma}\frac{|\int_{P_{\mathrm{a}}}E_{P}\mathrm{d}{P_{\mathrm{a}}}|^{2}}{\int_{P_{\mathrm{a}}}|E_{P}|^{2}\mathrm{d}{P_{\mathrm{a}}}},$
(7)

where $\Sigma$ denotes the physical surface area of ${P_{\mathrm{a}}}$,
$E_{i}$ the electric field illuminating ${P_{\mathrm{a}}}$. We always orient
the aperture in which we evaluate $\eta_{\mathrm{t}}$ such that the aperture
normal is parallel to the telescope pointing. In this way, we calculate
$\eta_{\mathrm{t}}$ in the direction of maximum directivity. With these two
efficiencies, we can estimate the aperture efficiency $\eta_{\mathrm{ap}}$
(Goldsmith 1998):

$\eta_{\mathrm{ap}}\approx\eta^{\mathrm{sec}}_{\mathrm{so}}\eta_{\mathrm{t}}.$
(8)

##  Appendix C Directivities of aligned ISS

The increase in performance after aligning is also reflected in the increase
of directivity of the instrument beam. The directivity depends on
$\eta_{\mathrm{ap}}$ and is given by:

$D_{\mathrm{dBi}}=\log_{10}\left(\frac{4\pi}{\lambda^{2}}\eta_{\mathrm{ap}}\Sigma\right).$
(9)

Here, $D_{\mathrm{dBi}}$ is the directivity in decibels (with respect to the
isotropic radiator), $\lambda$ is the wavelength of radiation and $\Sigma$ is
the surface area of the primary aperture. Because of the prevalence of this
metric in certain fields, we include the directivities in Fig. 12 for
completeness.

Figure 12: Directivities of the ISS after the ASTE telescope. In red,
directivities with the hexapod in home position. In blue, directivities with
the optimised hexapod position. In black, design directivities for an aligned
ISS.