To "Understand Dark Energy and Inflation" was identified as one of the DOE's five priority science missions in the 2014 report of the High Energy Physics "P5" prioritization panel. Since then, optical instruments (such as the Dark Energy Survey, 1 Dark Energy Spectroscopic Instrument, 2 Vera Rubin Observatory's LSST 3 and others) have begun observing and are expected to lead to major advances in the field. More recently, 21 cm intensity mapping has been gaining attention as a promising new method, complementary to optical and CMB surveys, for studying the nature and evolution of Dark Energy and for investigating signatures of inflation. The intensity mapping technique uses neutral hydrogen as a tracer to map the large scale structure of the Universe by employing precisely calibrated radio interferometers operating between ∼200 MHz and ∼1.4 GHz to measure the redshifted emission of the neutral hydrogen spin-flip transition. Source redshifts in the range 0 ≤ z ≤ 6 are thus unambiguously resolved, since there are no interfering lines. These instruments are very different from traditional radio telescopes, which have much higher angular resolution, smaller collecting area, and less precise calibration requirements than what is needed for 21 cm IM. Moreover, in intensity mapping experiments, individual sources are not resolved -instead the number density of sources across space and time is traced by the cumulative emission in the rest-frame 21 cm transition. A significant advantage of 21 cm experiments is that they will benefit from the dramatic cost/performance improvements in digital RF and high-performance computing technologies, driven by the explosive growth of commercial wireless telecommunications technology and machine learning.
In 2010 a 4σ detection of the cosmological large scale structure signal in 21 cm IM was reported, in an experiment at the Green Bank telescope (GBT). 4 The authors cross-correlated the radio intensity map with the DEEP2 optical galaxy redshift survey to robustly reject residual systematics from either survey. The 21 cm signal in auto-correlation from current-generation observations remains significantly contaminated by foregrounds, but the obstacles to detection are purely technical in nature. Current efforts include CHIME, 5 HIRAX, 6 and BINGO 7 among others. We expect results from these experiments to become competitive over the next few years.
Work towards a large next generation US funded Stage II experiment was started a few year ago within the DOE Dark Energy Cosmic Visions group. 8 Several interesting science objectives have been identified, among them measuring the expansion history and growth of structure across cosmic ages, as well as probing inflationary physics. Owing to their great sensitivity, these instruments are naturally very competitive also in non-DOE areas of interest, such as the search for Fast Radio Bursts and monitoring pulsars. A concrete implementation of this concept has been proposed in the Packed Ultra-wideband Mapping Array (PUMA). 9, 10 It is now clear that major technical obstacles remain to be solved before 21 cm intensity mapping is ready for prime time. We have therefore embarked on designing and building a small prototype instrument situated at the Brookhaven National Laboratory grounds as a testbed for these future technologies. The main motivation was to have a real, operating system, which is conveniently located for agile testing and debugging and contains many of the same features as a Stage II experiment: large bandwidth, low-cost construction, closed-packing of interferometric elements, and transit array observation modes. The main purpose of this instrument is to act as a small-scale test-bed for future technologies allowing fast turn-around times. In particular, we wanted to be able to investigate:
• The possibility of operating a radio telescope in an RFI unfriendly environment to learn about possible RFI mitigation techniques
• Possible high precision measurements of the beam responses using sources suspended on unmanned aerial vehicles (UAV) such as hexacopter drones and small fixed-wing planes • The overall system stability and various approached towards complex gain calibration
• The usability of navigational satellite signals for clock synchronization and possibly relative beam calibration.
Based on these requirements we have designed BMX, a 4-dish interferometer testbed. The instrument is described in the next section with some results in Section 3.
BMX is configured as an array of four, 4-m off-axis parabolic reflectors, each with a pyramidal feedhorn, quadridge orthomode transducer (OMT), and dual-polarization receiver operating in the 1.1 -1.55 GHz band (Fig. 1) . The array is located at (40.869929N, 72.866062W) on the Brookhaven Lab campus (Fig. 2) ; the site was chosen after it was found to have an acceptable RFI environment while providing convenient access for maintenance and upgrades and having AC power and data connections already installed. The four dishes are built as a square array along cardinal directions with 8.8 m N-S and E-W baselines. Digitizer and correlator electronics (described in Section 2.3) are housed in a shielded, weatherproof enclosure at the base of the central tower and Ethernetover-power is used to connect to the campus network. BMX was originally built as a single-dish spectrometer in 2017, and upgraded to the interferometer configuration in early 2019. Since then we have logged about 290 days of visibility observations of the ∼4 degree wide strip at δ=+40.9 • which passes over the BMX zenith. 
The basic goal that set the reflector and OMT design was (i) to capture a 4 m wide circular beam directed at the zenith, and (ii) to do so with the beam being completely unobstructed. Accordingly an off-axis paraboloid arrangement was chosen, as laid out in Figure 3 . For each antenna, the main reflector approximates an off-center cut-out from a parent paraboloid. The 3-D focal point of this off-axis dish is then the same as that of the parent and lies outside the beam cylinder. An overall optimization led to the choice of a 2.9 m focal length, as shown in the figure. The green-shaded bowl shows the beam's intersection with a parent paraboloid, and so represents the ideal off-axis reflector. The green dot marks the paraboloid focus at 2.9 m above its vertex. Right: The ideal reflector is approximated as an array of "petals", e.g. radial wedge segments of the parent, shown here in blue. The resulting reflector circumscribes the 4 m vertical beam and brings it to the focus outside the beam path. Units are in meters.
The reflector was built up out of a series of flat sheets, here termed "petals", visible in the right sides of Figures 3 and 4 . Each petal occupies a narrow 15 o -wide radial wedge, and is curved in only one direction to avoid the cost and complexity of a compound curved surface. Photogrammetry measurements of the first completed reflector showed ±2mm deviation from a parabolic surface. The zenith-pointing beam is focused by the off-axis parabolic reflector into the pyramidal horn containing the parent paraboloid's focus (see Figure 3 ). The horn then feeds into the ortho-mode-transducer (OMT) which couples the received power out via coaxial cable. The dimensions are chosen so that the beam is completely un-obscured by the horn and support structure. Right: The reflector, horn and OMT are shown in an electromagnetic simulation of the beam system. The colored "heat pattern" shows the illumination of the horn+OMT onto the reflector, showing it is well contained and in fact somewhat under-illuminated.
The front end electronics boxes are mounted directly behind the horn/OMT assemblies and receive the RF output of each OMT via low-loss coax. Inside the front end box identical amplification and filtering circuits for each polarization are mounted to each side of a rail which provides mechanical support. Peltier elements are sandwiched between the amplifier packages and the rail to allow closed-loop thermal control (not yet activated). A -30dB coupler in front of the first LNA allows broadband noise from a calibrated source to be periodically injected for gain determination. A cavity filter with stopband attenuation of -70dB defines the 1100 -1550MHz bandpass. The overall chain provides 74dB of gain at the lower band edge, decreasing monotonically by about 7dB across the band. Noise temperature for the signal chain (including directional coupler) measured in the laboratory is 36K at 1100MHz, increasing to 40K at 1500MHz. The OMT and 0.3m low-loss coax are expected to add another 17K. System temperature is measured to be around 70K including losses in the horn and beam spillover to the ground. Power consumption is about 1W per channel, for a total front end power of 8W for all four receivers. A schematic diagram of one channel and a photo of one of the amp boxes is shown in Fig. 5 . 
Data is acquired by two commercial PCs, each taking care of one polarization mode. Looking down at the telescope from the above, there are two polarization modes, corresponding to the electic field oscillating N-S and E-W. Note that the N-S mode maps on the vertical horn polarization on the N and S dish and horizontal polarization for the E and W dishes. A mirror arrangement holds for the E-W polarization.
Each PC is equipped with two Spectrum M4-2223-x8 digitizers. Each digitizer cards supports streaming two channels at 1.1GS/s rates with 8-bit precision. While Spectrum provides 4-channel cards with the same sampling rate, the bus connection at PCI Express x8 Gen 2 would not allow a continuous streaming without loss of data. The cards are designed to sample at 1.25GS/s and we are undercloking them using an external clock source. Despite being clocked outside their nominal range we have founds the digitizers to be extremely stable. The data acquisition software streams raw samples to the main computer memory and then to the GPU for further processing.
The 1.1GS/s data rate gives a 500MHz Nyquist frequency and our bandpass defining filter at 1.1-1.55GHz means that we sample the signal in the third Nyquist zone. Data are processed in GeForce GTX 1050 Ti cards using custom CUDA code in chunks of 2 25 samples, corresponding to approximately 30 ms of data, although this is a configurable parameter. We have implemented an asynchronous data transfer and compute on the GPU using CUDA streaming functionality. That is, while one data buffer is being processed, the other data buffer is being transferred onto the graphics cards. The steps in the processing are as follows:
• Transfer 4-channels worth of data from main memory to GPU (∼ 16 ms)
• Convert data from 8 bit integer ADC samples to 32 bit floats (∼ 2ms)
• FFT all 4 buffers (∼ 14ms)
• Calculate all 4 auto and 6 complex cross-correlations (∼ 6ms)
• Transfer reduced data back (negligible time)
The data is averaged in so-called "cuts". For example, during typical operation we average in 2 13 = 8192 FFT measurements across the full band, giving 2048 spectral channels and additionally a finer grid of 2 9 = 512 FFT measurements for fine spectral resolution zoom in around the galactic 21 cm line.
Because we employ long FFT buffers, the frequency aliasing after averaging is minimal and in fact considerably better than in typical polyphase-filterbank based approaches (which are, however, computationally much cheaper).
We further average 32 individual 30ms measurements into a sample that is saved to disk. This results in approximately 1GB of data produced every hour. Before each sample is saved to disk we also perform as simple RFI reduction algorithm as follows:
• For each spectral bin, we calculate the median signal.
• All samples below the median are used to estimate the variance of the signal around the median.
• Any sample that is greater than 4 standard deviations above the median is removed from the average and stored separately an "RFI rejects" file.
This RFI cleaning approach is motivated by the fact that RFI always adds power rather than removing it. Therefore, for short duration RFI, samples at or below the median level should not be affected. This removes approximately 1% of the data. The "RFI rejects" file is structured to be space efficient (it stores indices and rejected means) allowing one to recover the signal prior to RFI rejection.
The data are transferred to a local cluster every day and processed overnight using cron jobs. The daily processing involves collating data into a useful format and calculating auxiliary information such as GNSS satellite transits.
The distribution of HI in the Milky Way galaxy is readily visible in BMX observations using the fine spectral resolution channels centered around the galactic 21cm line. In Fig. 6 we show two views of the galactic HI in the BMX strip. The view on the top is BMX data acquired over ∼ 28 hours starting at 21:45 UTC on 20 October 2020 (data is from the N-Y polarization channel). The western arm of the Milky Way, with nearby Cygnus A, is seen at 20:00 RA near the beginning and end of the run, with the eastern arm visible at 05:00 RA. On the lower panel is the map produced from the high-resolution HI4PI survey, 11 binned to the same RA and frequency resolution as BMX. A second comparison in shown in Fig. 7 , which reveals more detail during passage of the galactic plane around 20:10 UTC on 1 Dec. 2017. For each of five 130-kHz frequency bins, the BMX signal vs time or RA (blue) is fitted to the predicted signal from the corresponding binned RA-frequency sections of the HI4PI map (green). Each section of Fig. 7 corresponds to the same ∼ 100 degrees of RA. The BMX frequencies were first adjusted to the local system of reference used by HI4PI, which takes into account the motion of the Sun and Earth relative to nearby stars. A beam model with shape (pointing and width), frequency offset, gain, and amplitude offset terms was fit to the data using all frequency bins. Very good fits were obtained for FWHM = 4 degrees, small pointing offsets in RA and Dec (±0.5 deg from zenith), 20kHz frequency offset, and very small offset and gain drifts. Figure 6 . Milky Way map in RA and frequency for the BMX strip. Top map is BMX data, bottom is rebinned data from the HI4PI survey. Note, both maps start at 18h RA (left). After 24 hours, the BMX map extends to 22h the following day while the HI4PI map simply wraps around. A more detailed structure comparison is given in Fig.7 . Figure 7 . Detail of galactic HI structure. Each of the five sub-panels shows BMX spectrometer data in adjacent 130kHz frequency bins during the MW transit of 1 Dec 2017. The x-axis in each sub-panel covers the same ∼ 100 degrees of RA. After transforming frequencies to a Local Standard of Rest (LSR) which takes into account motions of the Earth and Sun, we fit the data to a Gaussian beam model (shape, pointing, frequency offset) with the HI signal predicted by the HI4PI map. Excellent agreement between the measured (blue) and fitted (green) data is observed for a beam profile with 4 degree FWHM, small (±0.5 deg) departures from nominal zenith pointing, and 20kHz constant frequency offset.
GNSS satellite transmissions in the L5 (1176.43 MHz) and L2 (1227.6 MHz) bands are observed clearly (Fig. 8 , left) and can be used to measure beam pointing and beam widths. For each dish and polarization, we used the following method:
• For each day of observing, identify GNSS satellites that pass near the BMX zenith. We use the two-line element orbit parameters on that day for each satellite to determine local altitude and azimuth as a function of MJD, then sort by maximum altitude and select the 16 satellite transits closest to the BMX nominal (zenith) pointing.
• Convert (altitude, azimuth) to a coordinate system centered at zenith with (x,y) axes oriented along (E-W, N-S) directions
• Identify windows of length 65 minutes centered around the MJD of transit for each satellite.
• Extract the auto-spectrum signal for each window where a satellite is predicted to pass. Integrate over the band of frequencies 1105 -1369 MHz containing the GNSS transmissions.
• Assemble a data cube by stitching together the predicted locations and BMX signals for each of the 16 time windows
• Perform a joint fit to all 16 transits using a simple Gaussian beam model of the form
Note that the amplitude and offset parameters A and C are treated as invariant and included in the joint fit, even though they may be expected to vary from transit to transit due to satellite transmit power differences and gain drifts. The fit for the shape parameters x 0 , y 0 , σ x , σ y was found to be insensitive to these variations. Also, frequency dependence is disregarded and the fitted shape parameters may be taken as an average over the 269 MHz GNSS L2+L5 band.
An example of the resulting fit for 16 transits occurring on 25 Jan 2020 is shown in the center upper panel of Fig.  8 , along with the predicted tracks for each (center lower panel). Satellites from GPS, GALILEO, GLONASS, and BEIDOU constellations were observed. Note, not all GPS satellites transmit in the L5 band. Fits were poor for the GLONASS constellation satellites, posibly due to ephemeris errors, but generally good for GPS, GALILEO, and BEIDOU. The extracted shape parameters for the West dish, Y polarization channel over the 5-day period from 21 to 25 January 2020 were found to be stable to better than 0.2 • (Fig. 8, right panel) . 
Of the 24 cross-correlation products that a 4-dish, dual-polarization configuration like BMX can produce, we compute only the 12 like-polarization visibilities. Fig.9 shows an example waterfall plot of the real part of the East-West, Y-polarization visibilities over a 3.8-hour period near a transit of the radio source Cygnus-A. Dashed horizontal lines are labeled with frequencies for which visibilities were analyzed. Transmissions from four GNSS satellites are seen in the figure in addition to CygA; their signals are confined to the L2 and L5 bands between 1130-1230 MHz while CygA exhibits a falling power-law spectrum. The observed fringes from CygA can be used to estimate beam parameters using fitting methods similar to those used for UAV, GNSS satellite, and galactic HI calibrations, with the advantage that CygA is effectively a point source, its horizon coordinates can be known with high accuracy, and its fringe rate is compatible with BMX's baselines, beam width, frequency bandpass, and integration time. BMX was upgraded from a single-dish spectrometer to a 4-dish interferometer in early 2019, and after commissioning the instrument regular observations began in early 2020. Between 14 January and 17 April we logged 81 days of observations; 16 non-observing days involved weather events, hardware and software maintenance, and coronavirus-related site restrictions starting in late March. Stability of the system is illustrated by the histograms of baseline length and RA offset fitted to CygA transits in Fig.11 . Fig.12 gives the statistics for the fitted baselines over this period. After rejecting outliers, pointing and beamwidth fits for a given visibility were generally stable to 0.1 -0.2 degrees and baseline fits to within 6 -10 cm during this period. 
Beam calibration measurements of BMX were performed in March of 2020 using a drone based radio calibration source developed at Yale University. The noise source was a commercial broadband source from the Ziyang Junying Technology Co. (junying-mw.com), with a 50 kHz -1.5 GHz band, which was filtered down to 1.15 GHz -1.5 GHz. The source had ENR 90 dB, though it was attenuated down by 43 dB when mapping the main lobe, and 30 dB when mapping the sidelobes, in order to avoid compressing the BMX amplifiers. The drone platform was a Matrice 600 Pro hexacopter produced by DJI. The DJI Realtime Kinematic (RTK) GPS add-on for the Matrice was used to improve the accuracy of the drone positioning. We have verified that the location of the drone is accurately recorded by the RTK system to < 1cm RMS. The transmitting antenna was a biconical Bicolog 20300 antenna from Aaronia. The transmitting antenna was chosen for its uniform gain across the BMX band, and for its isotropic radiation pattern.
Beam calibration was performed by flying in a grid pattern at constant altitude in the farfield of the telescope, with passes along north-south and east-west directions, while holding the heading of the drone constant. Holding the heading constant ensured the polarization angle of the transmitting antenna was maintained as a constant throughout the flight. Two square grids were flown, one 120 m on a side with 6 m spacing between passes to map the main lobe and sidelobes of the beam, and one 70 m on a side with 3.5 m spacing between passes to produce a finer resolution map of the main lobe of the beam.
For each dish, the drone's 3D position in geodetic coordinates was transformed into a 2D coordinate system centered on the zenith. The BMX signal as a function of time was matched to the drone's instantaneous position in that coordinate system. The interpolated beam power patterns are shown in Fig.13 . Each beam was further modeled as either a 2D Gaussian or a symmetric Airy disk. Fits were made for pointing centers and RMS width in the N-S and E-W directions, as functions of frequency. It was found that the absolute time synchronization between the BMX digitizers and the drone RTK clocks were offset at the < 1s level, by different amounts for each flight; these were corrected by iterating the fits over a range of time offsets and choosing the offset that resulted in the smallest residuals. All data shown is with time offsets corrected. The right panel of Fig.13 shows the fitted beam pointing centers in 2 MHz steps from 1230 -1350 MHz. The pointing centers do change with frequency by less than .003 radians, too small to be seen at the scale of the figure.
Fig.14 shows a cut through the observed power along a N-S track near the center of the beam of the S dish. The central lobe narrows with frequency as expected, and the first sidelobe can be seen. The position of the first null at 1400 MHz corresponds to that of an Airy disk from a 3.95m-diameter aperture, very close to the nominal 4m diameter of the BMX dishes. UAV is flying a wide N-S raster at high transmit power with polarization aligned along flight direction. South dish auto-correlation for the N-S polarization channel is shown. At 1400 MHz, the first sidelobe is visible and the position of the null at 3.79 degrees corresponds to that of the Airy disk from a 3.95m diameter aperture (BMX dishes are nominally 4m-diameter sections of a parent paraboloid).
We have described the BMX interferometer, a testbed for 21cm cosmology research and a pathfinder for the proposed PUMA intensity mapping array. It incorporates an off-axis optical design with four dual-polarization receivers working in the 1100 -1550 MHz band, and uses onboard GPU-based correlators to generate eight auto-correlation spectra and 12 cross-correlation visibilities. The system runs in continuous streaming mode and writes about 24GB of data to disk each day. We have presented several applications to demonstrate the performance and stability of the instrument, including beam calibrations using manmade and celestial sources.
In the near future we plan to investigate a fixed-wing UAV platform for beam calibration, and to develop a compact digitizer and F-engine utilizing the recently developed RFSoC product line from Xilinx. On the analysis side, we have started to develop machine learning techniques for RFI mitigation and will make more detailed use of the GNSS satellites by accessing their modulation codes as well as their RF power for better beam and timing calibration. Finally, we hope to detect the cosmological 21cm signal in cross-correlation with optical galaxy surveys in the redshift range 0 < z < 0.3.