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

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. We 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. 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. 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.


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 crosscorrelation power spectra studies with other LSS tracers such as termediate 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 quasioptical 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 beampattern 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 optimisa-tion 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.

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' (p WF ).The plane parallel to the xy-plane, containing p 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' ( p 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 p CF .The plane parallel to the yz plane and containing p 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.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.

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.
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 SG 1 at a frequency f 0 = 9.77 GHz to a harmonic mixer mx 1 .We use an ultra-wideband superlattice mixer (Paveliev et al. 2012), mounted in an open-ended wr4.31 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 mx 1 can move in a plane, the scanning plane, which allows us to map the instrument beam pattern as a function of mx 1 position.
The field U 2 is generated by another harmonic mixer mx 2 , identical to mx 1 but fed by another synthesizer SG 2 , at a frequency f 0 + ∆ f .The mixer mx 2 is fixed spatially and radiates a beam with a low opening angle into free space through a diagonal horn antenna.SG 1 and SG 2 generate their signals on a com-mon clock, phase-locking U 1 and U 2 together.We choose ∆ f = 12.11 Hz < f r , where f r = 1.2 kHz is the sampling frequency of the MKIDs of the spectrometer.Then U 1 (t) = n A n sin(2πn f 0 t+ ϕ n,1 ), with n ∈ {21, ..., 41} ⊂ N in our setup.This corresponds to a frequency range between 205.07 and 390.62 GHz.The mixer mx 2 radiates U 2 (t) = n B n sin(2πn( f 0 + ∆ f )t + ϕ n,2 ).These two fields radiate into free space and illuminate a mylar beamsplitter, where they are added together to generate U 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 mx 2 and the beamsplitter.Because U m is amplitude-modulated at integer multiples of ∆ f and f 0 , the detected power P det ∝ |U m | 2 in the instrument is modulated at multiple modulation frequencies, with each modulation frequency corresponding to a different harmonic contained in U 1 : (1) Where ϕ n = ϕ n,1 + ϕ n,2 , the phase of the modulation frequency n∆ f of P 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 det but contribute to the constant power entering the MKID.The amplitude A n B n for each modulation frequency n∆ f can be extracted by taking the Fourier transform of P det (t), for each point in the scanning plane, and finding the amplitudes corresponding to each n∆ 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 n f 0 , each simultaneously recorded at a single point in the scanning plane.We utilise a phase reference signal to extract ϕ n,1 from ϕ n .This signal is generated from SG 1 and SG 2 by feeding both signals into a subtractive mixer mx s .The resulting signal, after low-pass filtering, has frequency ∆ f and some phase ϕ 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 ϕ ref , by taking the Fourier transform of the blindtone readout timestreams and identifying the amplitude and phase of Fig. 2. a) Sketch of the cryostat and HPA measurement setup.In green, the two signal generators SG 1 and SG 2 .The harmonic mixers are depicted in yellow.The beamsplitter, colored pink and denoted BS, is situated such that its faces are illuminated by both mx 1 and mx 2 .A lens, depicted in red, is placed in between mx 2 and the beamsplitter to increase the coupling.The modulated signal U 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 mx 1 is located inside the yellow disk on the left.The material in which mx 1 is embedded is a sheet of radiation absorbing material.This prevents standing waves from generating in between mx 1 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 mx 2 is also colored yellow and visible in the bottom of the image, below the lens which is colored red.
the Fourier transform at ∆ 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 ϕ n of P det to the phase reference signal phase ϕ ref at each source position in the scanning plane, we can spatially map the PA beam patterns across the harmonic range indexed by n.

Measuring misalignment
We call a beam, defined on some plane P = P(x, y, z) ⊂ R 3 with beam amplitude center at some point p ∈ P, propagating in some direction β, misaligned with respect to an axis γ if: (3) Expression 2 corresponds to beam offsets, where the P − γ intersection does not coincide with 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 p CF .The beam propagation direction coming out of the cold focal plane is denoted β′ B .Before we start the measurement, we center mx 1 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 n f 0 .We fit a complex-valued, astigmatic Gaussian beam to each measured beam pattern.This fit can be used to obtain β′ 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 p CF , the cryostat focus of the actual beam.
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 p WF .The beam center in the warm focal plane is denoted p B .The beam propagation direction coming out of the warm focal plane is denoted by β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.

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 p CF .We apply the beam tilt at the cold focal plane to B by orienting B along the measured β′ B .Then, the rays are propagated through the warm optics and into the warm focal plane where the following cost function is evaluated: Here, p B represents the geometric centre of all rays in B evaluated in the warm focal plane, βB the mean propagation direction of B, p hex the simulated hexapod position, and θ hex the simulated hexapod orientation.The beam offset is optimised with respect to p 0 and the beam tilt with respect to γ0 .In this case, p 0 = p WF and γ0 = ẑ.The parameters ∆l min and ∆α min are weights that control the required accuracy in the optimisation.In this work, we adopt the following values: ∆l min = 1 mm and ∆α min = 0.1 • .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 ∆RMS 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 ∆RMS 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 ∼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.
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 p opt and θ opt , which are the p hex and θ hex corresponding to the lowest value of δ, 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 p 0 B in the warm focal plane and propagation direction β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 p 0 = p 0 B and γ0 = β0 B , we obtain p 0 hex and θ 0 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 p hex and θ hex tried by the optimisation in Eq. 4, with p 0 = p WF and γ0 = ẑ, to take into account the real-world hexapod offsets:  2b, except for the addition of the warm optics, which is colored orange.Also, the signal generators can be seen now.Note the −90 • 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).The optimisation then returns the optimised hexapod translation p opt and rotation θ opt , calculated on top of p 0 hex and θ 0 hex .When applying the optimisation result to the real-world hexapod, care should be taken to only apply p opt and θ opt , and not p 0 hex and θ 0 hex .
Then, an HPA measurement around the warm focal plane can be performed to assess the new beam center p 1 B and propagation direction β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 mx 1 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.

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 mx 1 above the warm optics, the warm optics and hexapod are rotated by −90 • 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 p 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 p CF , and hence p 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 p 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 • 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 Fig. 7. a) Decrease in focal offset, defined as p B − p 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.
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.

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 θ ′ y ≈ −0.4 • and θ ′ z ≈ −3.1 • , 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 ∼ −2.5 • .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.
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.

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.
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 η sec so is slightly lower than the design value, whilst the taper efficiency η t is slightly higher.The decrease in η sec so could be due to a higher illumination level on the edge of M 2 , which also explains the increase in η t .Nevertheless, the aperture efficiency η 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 η ap across the frequency range for the optimised configuration to be η ap = 0.73 ± 0.04.In comparison, the home (misaligned) configuration has a mean η ap = 0.39 ± 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): 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±0.7.This can have a significant impact, especially for long observations that require high S/N for faint targets.

Far-field analysis
We propagate the measured beam patterns to the telescope farfield 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 η sec so and larger η 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.
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.
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 η sec so , as

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.where E i denotes the electric field illuminating the extended reflector aperture plane S ′ a , which is defined as the spatially extended version of the secondary reflector aperture S a .In practice, we oversize S ′ a to have a radius three times that of S a , so that we capture sufficient spillover radiation.The ⋆ 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 η t .This efficiency is a measure of the uniformity of the amplitude and phase patterns of the beam in the primary aperture plane P a and is calculated as follows: where Σ denotes the physical surface area of P a , E i the electric field illuminating P a .We always orient the aperture in which we evaluate η t such that the aperture normal is parallel to the telescope pointing.In this way, we calculate η t in the direction of maximum directivity.With these two efficiencies, we can estimate the aperture efficiency η ap (Goldsmith 1998): (B.3)

Fig. 1 .
Fig.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.

Fig. 4 .
Fig. 3. a) raw timestream data for P det of MKID 171 at 205.07 GHz, taken at the center of the scanning plane.We have normalised P det to the time-averaged power < P det > entering the MKID.We plot the data for a time range of 50 ms.The modulation at n∆ 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 det and is denoted by f mod .The cyan dashed vertical line represents the n∆ f for n f 0 = 205.07GHz.Given the value of f 0 , this corresponds to n = 21 and thus n∆ f = 254.31Hz, which is where we would expect the peak.The pink dashed line corresponds to n = 22 for n f 0 = 214.84GHz and the violet dashed line to n = 23, n f 0 = 224.61GHz.
Fig.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 mx 1 .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 • 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).

Fig. 6 .
Fig. 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 β exaggerated.The coordinate system is identical to the one shown in Fig. 1a.

Fig. 8 .Fig. 9 .
Fig. 8. Calculated telescope efficiencies for the ISS at ASTE. a) Spillover efficiency η sec so calculated on M 2 .b) Taper efficiency η t calculated in the aperture of M 1 .c) Aperture efficiency η ap , defined as η sec so η 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.

Fig. 10 .
Fig. 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 dAz = dEl = 0 as.

Fig. C. 1 .
Fig. C.1.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.