Data reduction and restoration of spectropolarimetric microlensed hyperspectral imager data

Context. A microlensed hyperspectral imager (MiHI) is an integral field spectrograph based on a double-sided microlens array. Aims. To convert the raw data frames of such an instrument to hyperspectral cubes, and restore them to high-resolution science-ready Stokes data, a new kind of data reduction procedure is required. Methods. An optimized ad hoc transfer map of a MiHI prototype was used to convert the raw data into raw hyperspectral form. The transfer map was modified to match the position of the image on the detector, which was found to drift considerably during the course of an observing day. The determination of this position was used to move the recorded flat-field images to the position of the observation, which was found to be a critical step in the accurate gain correction of the raw data cubes. The converted data were found to be suitable for image restoration but still contained unwanted polarimetric structure that needed to be removed. Results. The extracted and restored data were found to be of a similar spatial resolution as the equivalent data from the context imager, while retaining a spectral resolution of approximately 300 000. The noise properties of the raw data were determined by the photon statistics and were found to be consistent with the estimated transparency of the instrument and the integration time of the image sensor. As for all image-restored data, the noise properties of the restored data were found to be dependent on the instrumental and atmospheric point spread function. An attempt to compare the data to other similar data suggested that the data had a spectral and spatial information content comparable to that of a Hinode spectro-polarimetric scan, but with a higher spatial resolution and a temporal cadence of approximately 10s


Introduction
In the study of stellar atmospheres, the solar atmosphere occupies a special position since it can be resolved spatially.Whereas the study of the atmospheres of stars other than the Sun can typically only make use of spectral information averaged over significant fractions of the stellar surface, the high spatial resolution that can be achieved with solar observations allows for many elementary structures on the solar surface to be spatially resolved.
Many such high spatial resolution observations contain spectral details in the radiation field that carry information about the physical processes taking place in the solar atmosphere and which are easily lost when the resolution is degraded (see for instance Graham et al. 2002).Moreover, spectral information can usually only be obtained as part of a blend of a spatial distribution of different atmospheric structures, which can be separated only if their differences exceed the noise level of the data (e.g., van Noort 2012).
On the small scales that can be observed in the solar atmosphere, however, the differences in the atmospheric conditions are usually relatively small, and the separation of blended contributions is typically almost entirely dependent on the signal-tonoise ratio (S/N) of the data.Moreover, the evolution timescale of such data is dependent on the spatial scale and varies from a few minutes for large-scale structures to mere seconds for highly resolved chromospheric details.
To study such small-scale structures, a variety of hyperspectral instruments aimed at delivering high-resolution spatiospectral data have been developed.They can be broadly divided into those that are based on diffraction, such as scanning spectrographs (e.g., Schroeter et al. 1985;Elmore et al. 1992;Keller & Solis Team 2001;Lites et al. 2013;Chae et al. 2013;van Noort 2017), and those that are based on interference, such as narrowband tunable filters (e.g., Kentischer et al. 1998;Cavallini 2006;Scharmer 2006).Both types produce hyperspectral data but must scan through the spatio-spectral domain in different directions to do so, which leads to limitations in the S/N and cadence that can be achieved.
For diffractive instruments, a so-called integral field unit (IFU) can be used to obtain an entire hyperspectral domain instantaneously, which offers several significant advantages, such as elimination of seeing-induced spectral crosstalk, improved overall instrumental efficiency, and access to a very high time cadence.Several such units have been constructed in the recent past (e.g., Weis & Lin 2012;Schad et al. 2014;Calcines et al. 2014), with varying degrees of operational success.The primary difficulty in manufacturing IFUs is achieving a sufficiently large spectral range over a field of view (FOV) that is large enough to capture an entire elementary solar structure.
A microlensed hyperspectral imager (MiHI; van Noort et al. 2022, hereafter Paper I) is an integral field spectrograph based on a microlens array (MLA).A prototype was built to determine if such an IFU instrument is able to reduce the restrictions on A151, page 1 of 17 Open Access article, published by EDP Sciences, under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0),which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.This article is published in open access under the Subscribe-to-Open model.Open access funding provided by Max Planck Society.
spectral and temporal resolution imposed by the current generation of IFU instruments.This prototype critically samples the focal plane of the Swedish Solar Telescope (SST; Scharmer et al. 2003) with 128×115 image elements (7.9 ′′ ×7.1 ′′ @632nm), each producing a spectrum spanning a useful range of ∼450 pixels (4.5 Å@632 nm) with a resolving power of R ≈ 315 000 on a single 20 Megapixel active pixel detector.The instrument has been in operation at the SST since 2016 and is described in detail in Paper I.
To fully exploit the high spectral resolution and S/N of the data produced by the MiHI prototype, however, the data need to be reduced and calibrated to the highest level of accuracy so that the interpretation of subtle details is not spoiled by instrumental artifacts.In van Noort & Chanumolu (2022, hereafter Paper II), a transfer map describing the instrumental properties of the prototype was developed and fitted to flat-field data recorded with the prototype from Paper I. This paper, the third in the series, concerns the extraction, reduction, and image restoration of solar observations recorded with this prototype.It includes a brief introduction to the main properties of the fully reduced data sets.

Data extraction and reduction
Before we can calibrate and restore the data obtained with the MiHI prototype from Paper I, we must first convert the raw images to hyperspectral cubes, for which we require the transfer map from Paper II.Since simplifications were made in Paper II, to keep the problem computationally tractable, the reduction of the data cannot proceed by a direct application of the inverse of the transfer map onto the data.It instead requires some initial cleaning steps.
Apart from the obvious subtraction of the dark level of each pixel, we must remove scattered light that lands onto the detector on scales that are very large.This stray light was modeled using a strongly simplified point spread function (PSF) of the form with fitted parameter values of α = 0.085 and γ = 2.3.All data were first corrected in this way before being mapped to hyperspectral coordinates.
We then applied the procedure described in Paper II.In this procedure, the raw data frame is first interpolated onto the coordinates of the transfer map, transforming it into a data cube, which is then iteratively improved by the repeated application of the following sequence: (1) calculate a synthetic frame from the extracted cube using the transfer map, (2) calculate the difference between the synthetic and the actual data frame, and (3) interpolate the defect onto the coordinates of the transfer map, and add the result to the data cube.This method converges in 10-15 iterations.
It is vital that the number of iterations is kept fixed, and that no premature truncation of the scheme is permitted, even if convergence appears to be reached.This is because the inverse operator must be exactly the same for observed and flat-field data if the fixed pattern structure is to be removed completely.Truncation of the expansion with different numbers of terms is not satisfying that requirement, and leaves fixed pattern noise in the data after division by the flat-field image.
The data extracted in this way are now ready to be processed using standard methods for gain correcting and calibrating data.We discuss the remaining issues that are specific to these data below in more detail.The specific implementations of the methods described in this paper that were used for the reduction of the data presented here, are available for download to interested readers 1 .

Image motion
Thus far, we have only attempted to model the instrumental transfer function and extract a data cube using this model.The raw data, however, are never void of contrast, and thus there is no way to record an image containing only detector and instrumental transmission variations.It is, however, of critical importance that, if we are to use the extracted data cubes in an image restoration, all instrumental imprints are removed, since any fixed pattern imprint on the data will disturb the restoration process.
In Paper II it was observed that the contrast of the raw data is dominated by the dark and bright bands of spectra, the contrast of interpolated data is dominated by a moiré pattern, the result of the interference of the MLA grid with the pixel grid of the detector.The transfer map that was calculated in that paper includes not only the position of the (x, y, λ) coordinates, but also the spatial structure of the PSF, which makes it possible to obtain a nearly fringe free extracted data cube.
Unfortunately, the phase of the moiré pattern is very sensitive to the precise position of the image on the sensor, and the stability of the instrument over periods of hours or even minutes is insufficient for this to remain unchanged.Consequently, as the image is moving around on the image sensor, it causes the transfer map to leave residual moiré fringes in the data.Recording flat-field data frequently can offer some relief, but is clearly undesirable, as it makes it impossible to record long, uninterrupted time series.However, since we have a model of the transfer map, it might be possible to address this problem by calculating the map as it really was at the time of the observation, extract the data cube with that, and then correct it with the flat-field cube.
This approach does a rather good job at removing the moiré fringes, but it does not lead to the removal of the instrumental fixed pattern structure.The reason for this is that the map is not the same for the data and the flat-field frames, and therefore, the imprint of the instrumental fixed pattern noise leaves a different pattern in the data cube when it is mapped.The center panel of Fig. 1 shows an image obtained using the transfer map, moved to the location of the observed image; It is recorded at a displacement value of (∆x, ∆y) = (0.10,0.15) pixels but gain-corrected using the original transfer map applied to the flat field, which was recorded at a displacement value of (∆x, ∆y) = (0.00,0.00) pixels.The difference in the mapping of the fixed pattern noise is clearly visible as predominantly horizontally oriented grainy structures in the image.
If we try to address this problem using the same map for both the data and the flat field, the fixed pattern residuals are removed but the moiré fringes are not, and they remain visible in the data.This is clearly visible in the left panel of Fig. 1, which shows the effect of moving the transfer map to the location of the observed image, and applying it to the original flat field.
The solution to this problem is to move the raw, un-extracted flat-field image on the detector to the location of the observed image at the time of acquisition, but without moving the detector defects.To accomplish this, we calculate the response of the fitted flat-field image to a move of the map in the x, the y, and the focus directions, using the derivatives of the transfer map.These derivatives can be calculated from the model, and do not contain the fixed pattern structure, assuming that these were successfully filtered out by the regularization procedure from Paper II.
Provided that the move is only a small fraction of a pixel, the moved flat field can now be calculated from the recorded one using where z represent a movement in the focus direction.This expression represents a first-order approximation to the flat field as it moves across the sensor, and is only valid for small values of δ x,y,z .In the regime of validity, however, the linear approximation term does not contain the fixed pattern structure, because it was calculated from the model.Thus, the moved flat field still has the original fixed pattern noise where it belongs, but the image itself has been moved to the location of the observations.The same mapping function can now be used to extract the data cube from the observational and from the flat-field image, thus allowing the fixed pattern structure to be eliminated.The right panel of Fig. 1 shows the image obtained using this method.The grainy structures appear to be largely absent, and the residual moiré fringes are significantly reduced compared to both other flat-fielding methods.
Image position.To use the flat-fielding method described above, the position of the image in the observed frame, needs to be determined somehow.Although it contains image structure, the contrast is overwhelmed by the spatial structure introduced by the MLA, and by the moiré interference fringes.However, because the image is spectrally and spatially structured, the spectral lines need to be considered separately, since they may differ significantly from the average solar spectrum.
We therefore rewrite Eq. ( 1) under the assumption that the observed image on average looks like the flat field, but that the solar spectrum has an unknown shift in the wavelength direction δ λ , which only affects the solar lines, but not the telluric lines or the pre-filter transmission curve.The equation then becomes where ∂im im∂λ is the image generated by applying the transfer map to a spectral cube, where each spectrum is replaced by the wavelength derivative of a reference spectrum (Neckel 1999), multiplied with the pre-filter curve, for all spatial elements.This term allows for the separation of the position of spectral features originating on the Sun from other features that move with the image position on the detector, such as the pre-filter curve and the telluric lines.
We now evaluate Eq. ( 2) for each pixel in the raw image that is sufficiently bright, yielding a system of around 1 × 10 7 equations of the form ∂im x,y im x,y ∂x ∂im x,y im x,y ∂y ∂im x,y im x,y ∂λ ∂im x,y im x,y ∂z x,y Multiplying both sides by J T yields a symmetric system of four coupled equations that can be readily solved.
Figure 2 shows the result for part of a flat-fielding run, in which the telescope made a circular movement across the solar disk in an attempt to average out all solar structure.Clearly, in the short period of time shown here, the position and focus of the image on the detector did not change appreciably, but the little change that is visible does not appear to be correlated, suggesting that the linear problem is sufficiently well posed.
A periodic variation with a period of several seconds is clearly visible in the Doppler shift of the spectrum.This is caused by the circular motion of the telescope across the solar disk, which samples the solar rotation curve periodically.
The positions recovered for a representative observation of 37 min show a considerable drift across the detector, as can be seen in the top panels of Fig. 3.The wavelength shift initially shows erratic behavior, due to several losses of the lock by the correlation tracker, but from cycle 5000 to the end of the observation, a smooth change of the Doppler shift can be observed, with occasional sharp excursions toward zero.The amplitude and timescale of the Doppler shift appears to be typical for the radial 5 min P-mode oscillations, averaged over the 7 ′′ × 8 ′′ FOV of the MiHI prototype.Whenever the seeing is sufficiently bad to blur the image over an area that is much larger than that, however, Fig. 3.As in Fig. 2, but for a 37-min observation at disk center.
the amplitude is averaged over a much larger number of modes, significantly reducing the amplitude.
A careful analysis of the positions for the four polarimetric states reveals that the positions recovered for each differ by a small offset.Since we use a flat-field image that has the same polarimetric modulation state, this has no effect on the quality of the gain correction of the observations, since for that only the relative displacement is important.When the positions for a polarimetric calibration are analyzed, however, a significant dependence of the position of the data on the state of the calibration optics is observed.Particularly, there appears to be a wavelength shift that is dependent on the Stokes vector that is presented to the instrument.
The most logical explanation for this is that the pre-filter, which is composed of multiple layers of dielectric coatings, modulates the signal polarimetrically, and does so inhomogeneously across the wavelength range of transmission.The variation in the modulation causes the pre-filter transmission profile to change, which appears as a wavelength shift, and which is different for every Stokes vector that is offered.While this effect is small enough to ignore in most observed data, since the degree of polarization is generally low, in the calibration data the degree of polarization is so high that it leaves an imprint on the corrected data.
To prevent this issue from contaminating any of the fitted positions, the average over four images, covering a full polarimetric modulation cycle, was used.Unfortunately, this implicitly assumes that the position of the image on the detector varies on a timescale that is much longer than the polarimetric modulation cycle.If this is not the case, clearly the image will be blurred, and, although the effect of the blurring on the determined position is unclear, it is clear that in that case the use of a polarization free position will most likely result in a less than optimal flat-field correction.

Flat-field correction
With the cube extraction procedure and flat-field data cube obtained with the procedures described above, we are ready to flat-field the data.In doing this, it is important to realize that the flat-field cube not only contains the transmission properties of the instrument, but also the properties of the average solar spectrum.Direct application is therefore not possible, since this would result in division by this average spectrum.
As described in Paper II, we based the model on the assumption that the flat-field image we used to optimize the model on is a good representation of a reference spectrum, multiplied with Fig. 4. Raw extracted spectrum of pixel (x,y) = (85,75), averaged over a 10s period.The red lines are the wavelengths at which the filter has half of the peak transmission; outside of this range the contamination of the spectra from the rows above and below this row significantly contaminate this spectrum.
the transmission properties of the instrument.While the main task of building the model was to approximate those transmission properties in a simplified but representative manner, here we are interested in quantifying these properties with precision so that they can be corrected accurately.
Motivated by the quality of the fit of the model in Paper II, we use the assumption of equivalence of the flat-field and reference spectra, and divide the extracted flat-field cube by a suitable reference spectrum (Neckel 1999).The resulting cube indeed contains the transmission properties we are after, but is contaminated by the difference in the telluric lines between the reference spectrum and the flat-field image.Division of the data by the normalized flat-field cube thus not only removes all the transmission properties from the data, it also converts the telluric lines into the ones in the reference spectrum.
Using this to correct the data cubes results in a data set with a rather well-corrected continuum level, as shown in Fig. 4. In the spatial dimension, the data show no obvious sign of residual fringes or fixed pattern noise, in the central section of the pre-filter.
For filter transmission values below 0.5, moiré fringes remain in the monochromatic images and get stronger the lower the transmission is.Since the intensity in the core of some of the spectral lines is considerably lower than 0.5 times the continuum value, but the monochromatic images do not show fringes to anywhere near the same extent at those wavelengths, it is unlikely that these fringes are the result of the nonlinear detector response.More likely, they are caused by contamination from the spectra from the neighboring image elements above and below each row, which apparently was not modeled sufficiently accurately.
Until the accuracy is improved, information obtained from these contaminated regions should therefore be approached with the appropriate caution.This limits the effective bandwidth of the data, highlighted by the red shaded area in Fig. 4, to approximately 3.5 Å.
In addition to the fringes near the extremes of the wavelength range, the flat-fielded data frequently still show some weak moiré fringes across the main part of the spectral range.Although the level is very low, and nearly always well below the noise level for A151, page 4 of 17 individual exposures, image restoration generally enhances them sufficiently to make them visible.The considerably larger amplitude of these fringes compared to the residuals in the extracted flat-field cubes (see Paper II) suggests that the transfer map describing the average flat-field image does not exactly match that for the individual data frames.A possible reason for that is that the flat field is an average over many frames, all of which have a slightly different position.The blurring that this causes may change the transfer map sufficiently to explain this effect.

Polarimetry
The MiHI prototype was built not only to obtain spectra for every point in the FOV, but to obtain those spectra in all four Stokes parameters.The polarimeter that is required for this, consisting of two ferroelectric liquid crystals and an analyzer polarizer, must first be calibrated.This was done using a polarimetric state generator that consists of a high contrast linear polarizer and a quarter wave retarder; the state generator was inserted into the beam below the exit window of the telescope but before any of the relay and corrective optics placed on the optical table.The polarimetric properties are described by a so-called modulation matrix that contains, as the matrix elements, the contributions of each Stokes parameter to the measured intensity, for each of the modulator states.The elements of this matrix were determined by fitting a model of the state generator and the modulation matrix simultaneously to the calibration data.A more complete description of this procedure is provided in, for instance, van Noort & Rouppe van der Voort (2008).To obtain the response of the polarimeter for the data we wish to demodulate, the calibration was carried out on hyperspectral data cubes of the calibration data, generated using the same extraction procedure that was used for the data set.
A monochromatic slice through the modulation matrix at a wavelength near the peak transmission in the continuum is shown in Fig. 5, and can be seen to contain a significant amount of spatial structure.An offset in most matrix elements between the top and bottom half of the FOV can be seen; it corresponds to the left and right half of the detector.This appears to indicate that an uncalibrated error in the detector response must be still present, an assessment that is reinforced by the presence of what looks like moiré fringes in the matrix elements.Both features point at either a dependence of the transfer map on the state of the modulator, which should then also show up in the observations, or a dependence of the gain on the intensity, which was less than half of the value it had when recording the flat-field data, due to the insertion of the polarimetric state generator.
Finally, there are a number of sets of concentric rings visible in many matrix elements, which are clearly wavelength dependent, and appear to be associated with interference of the light between several optical surfaces.This is unfortunate, since the uniformity of the instrumental response is critical, because any spatial structure introduced in the data by the instrument will not be affected by atmospheric seeing, and will therefore be incorrectly enhanced when the image is restored using a deconvolution based method (e.g., Schnerr et al. 2011).
As shown in the center panel of Fig. 6, a pattern is indeed observed in the reduced and demodulated data that resembles the circular structures in the modulation matrix elements, even after the data are gain-corrected using the method described in Sect.2.1.The amplitude of the structure is clearly fluctuating as a function of the Fried parameter R 0 , indicating that the effect described above is likely involved.
The pattern closely resembles a simple interference fringe, produced by a cavity that is positioned somewhere near a pupil plane.The low amplitude of only 1-2%, makes the fringe hard to see in the intensity image, as can be seen in the left panel of Fig. 6, but it obviously leaves a significant polarimetric imprint.Although the fringe properties are a close match for the wire grid linear polarizer used as the polarimetric analyzer in the single beam setup in 2017, removal of the polarizer in the 2018 campaign did not remove the pattern from the data.An alternative candidate that can account for the fringe has thus far not be identified.
A consistent solution for this problem can be obtained by including the modulation of the image data in the image restoration and restoring the Stokes parameters directly.Unfortunately, such a straightforward extension of the restoration process, as described in Sect.2.4, is currently beyond the ability of available numerical resources.This is because it involves taking into account the detailed space-and wavelength-dependent structure of the modulation matrix, which is incompatible with the implicit assumption that the PSF is wavelength independent.This is not a fundamental problem, since the variation of the modulation matrix with wavelength is known; however, much of the work that is currently shared between all wavelengths can no longer be shared.In addition, an alternative method for solving the linear system must be used, since the one currently in use, a variation on the Lucy-Richardson method of deconvolution, is only stable if the signal is strictly positive.
An approximate but effective way to mitigate this problem for weak polarimetric signals is to follow Schnerr et al. (2011) and apply the space-variant-and wavelength-dependent modulation matrix to a featureless image, which is polarized according to the telescope polarization model, to generate the correct flat A151, page 5 of 17 field.If we do that here, however, we do not produce the correct fixed pattern noise in the raw image, since the fixed pattern noise is not included in the mapping function.The fixed pattern noise present in the demodulated hyperspectral cubes is incomplete, so when it is mapped back to raw image space, moved to a different position, and mapped back to hyperspectral form, it does not match the fixed pattern noise of an observation at that position.Therefore, we find the closest flat-field data that is available to the data set, and use that instead.Although there is a slight difference in the telescope polarization between the time of the flat field and the time of the observation, it was found to be effective in removing the features produced by instrumental nonuniformities in the polarimetric response coming from Stokes I, and correctly eliminates all other non-uniformities.This procedure does not correct any artifacts produced by the nonuniform response to real polarization signals coming from the Sun, but this generally does not constitute a serious problem, since the associated error is usually only a small fraction of the signal, which is itself relatively small, whereas the original error was a small fraction of Stokes I, and clearly dominates the Stokes images in the absence of real signal.The right panel of Fig. 6 shows how effective this method can be in removing instrumental polarimetric structure, in the case of very weak solar polarization signals.

Image restoration
Although the initial motivation behind the MiHI prototype was to build a spectrographic instrument that would allow for the application of multi-frame blind deconvolution (MFBD) image restoration to the data (e.g., Paxman et al. 1992;Löfdahl & Scharmer 1994;van Noort et al. 2005), this was recently shown to be possible also for data acquired using a slit spectrograph (see also van Noort 2017, and references therein).Since the data can be regarded as a instantaneously acquired scan, obtained using a traditional slit spectrograph, it is straightforward to restore the data in much the same way as for a spectrograph scan, but with the notable difference that each data frame contributes new constraints to the solution across the entire FOV.
This leads to a significantly increased signal level of the restored data as compared to a scan with a long slit spectrograph, and allows for a time cadence that is limited only by the modulation rate of the polarimetric modulator.This image restoration technique further benefits from the high S/N of the context image data, which translates to an optimal estimate of the PSF.This, in addition, can have a higher cadence than the spectral data, so the assumed frozen seeing condition underlying the MFBD wavefront sensing technique is approached much more accurately than in the spatio-spectral data.The PSF of the spatio-spectral data can be obtained by averaging the PSF of the context data over the period of exposure of the spatio-spectral data.
One particularly interesting benefit of using the spectral restoration technique over standard MFBD is that, unlike in MFBD, the solution is not obtained by using Fourier transforms, but rather by means of an iterative deconvolution.This makes it possible to include data pixels in the solution that are located outside the area covered by the data, but that are nonetheless represented in the data through the convolution with the PSF.Although the S/N of the solution in such pixels typically decreases rapidly with distance to the area covered by the data, under typical seeing conditions, an additional 2 pixels can be constrained on all sides of the data area with a reasonable S/N.While this may not seem very impressive, compared to the small FOV of the MiHI prototype it represents an increase in the restored area of the solar surface of more than 5%.
The data are typically restored in bursts, with a typical length of 10s for photospheric data, and down to 1.33s for chromospheric data.This interval is not fixed and can be changed as required by the data, down to the modulation cycle rate of 7.5 Hz.Clearly, a reduced burst length represents a shorter total integration time, and leads to data with a reduced S/N, but this choice is flexible, and can be optimized post facto for each specific data set or even for the particular analysis that one wishes to carry out on a given data set A specific complication that arises for a high cadence reduction is the implicit assumption made by the MFBD image restoration code that the tip-tilt coefficients average out to zero over the burst.This is a fairly good assumption over a period of 10s or more, but it becomes increasingly inaccurate the shorter the time span is that is covered by the burst of images.Using a context image at a nearby continuum wavelength is an obvious solution to this problem, since the evolution timescale for the continuum image does not require a very high cadence image restoration.When such a continuum context image channel is not available, however, as was the case for most of the data recorded in the 2017 and 2018 campaigns, an alternative solution needs to be found.
The solution employed here is to reduce the entire time series of the context imager with overlap in time, as was done for the spectral restoration in van Noort (2017).From the requirement that the same image in two different MFBD reductions can only have one true tip-tilt coefficient in x and y, the relative displacement of the frame of reference of the two restored images can be calculated.By calculating the differential offsets of overlapping bursts of data in this way, the change in the position of the PSF of each image in the burst can be determined.By removing the running mean of that change, the position of the PSF in low cadence coordinates is obtained, which can then be used to restore the hyperspectral data.The resulting restored data shows a strongly reduced warping, which enables the reliable tracking of solar features over time.
To invert the linear system that needs to be inverted to obtain the restored data, van Noort (2017) used an iterative, Lucy-Richardson-like approach.Here, in addition to this method, we applied the Ortomin(k) acceleration technique (Vinsome 1976), with a k value of 5, which proved to be particularly effective.Figure 7 shows the RMS of the difference between the linear operator applied to the current solution and the right-hand side (RHS), as a function of iteration number.For every invocation of the Orthomin acceleration, the metric can be seen to make a significant drop compared to the nominal convergence rate that immediately precedes it, increasing the convergence rate by one order of magnitude on average.

Demodulation and residual crosstalk removal
Because for mechanical reasons the modulator had to be located in the pupil, there is potential for degradation of the image, due to inhomogeneities in the polarimetric modulation.Although no evidence for higher-order aberrations was found, a small but persistent image displacement, associated with the modulation cycle, was found in the data.At a wavelength of 6300 Å, this displacement was determined to have an amplitude of 0.09 pixels in the x direction, and 0.004 pixels in the y direction, more than sufficient to produce a persistent ∇I −→ Q, U, V crosstalk, with an amplitude well above the noise floor.The top panel of Fig. 8 shows an example of a data set, recorded in good seeing conditions, that clearly suffers from this problem.The displacement was measured by calculating the misalignment of the RHS of each of the polarimetric states of the linear problem with respect to the RHS of all other polarimetric states.There are a total of six such displacements, each of which adds an equation to a linear system, which is solved under the requirement that the sum of the displacements of all the polarimetric states vanishes.It is straightforward to solve this over-constrained problem, yielding those corrections to the positions of the polarimetric states that best eliminate all misalignments simultaneously, while not on average displacing the image.
The shifts determined in this way were then added as a phase diversity term, consisting only of tip-tilt coefficients, to the corresponding wavefronts obtained from the context image data.Subsequent application of the resulting PSF for the restoration of the spectral data restores the data to a fixed frame of reference, thus removing the crosstalk, as shown in the bottom panels of Fig. 8.
In the case of the polarimetric dual beam data from the 2018 campaign, the two beams were fully processed as described above, and added only after restoration.This is the least complicated, since the displacement described above was found to differ somewhat between the two beams, possibly due to a differential polarimetric instrumental response.In addition, due to the proximity of the final field lens in the secondary re-imager to the detector plane, the polarizing beam splitter needed for the dual beam configuration could not be inserted as the final element in the beam.For this reason, the reflected and transmitted beams do not share all active optical components, which can lead to differential image distortions.Such distortions, as well as any other differential shifts between the two beams, are effectively removed when the two beams are restored separately.
The result are rather clean Stokes spectra that still show a small amount of uncorrected seeing-induced crosstalk.This can be removed by subtraction of the mean value of [Q, U, V]/I over the continuum points in the spectra.This removes all I to [Q, U, V] crosstalk, except for a small amount (<0.5%) of residual fixed pattern crosstalk from the data.To remove that as well, a time average of nonmagnetic pixels was generated for a 40 min time series of quiet Sun at disk center, which was subtracted from the Stokes spectra.

Results
The MiHI prototype was used in four observing campaigns, between 2016 and 2019.The instrument was upgraded in steps from a simple integral field spectrograph to single beam integral field spectropolarimeter to a multiwavelength, dual beam integral field spectropolarimeter.On each occasion, the instrument was modified extensively, in part due to degradation of some optical parts, and in part to add the new functionality.In 2018, the context imager was in addition upgraded to contain a second camera, in a phase diversity (PD) configuration, to further enhance the accuracy of the MFBD wavefront sensing algorithm, and in 2019 a PD beam splitter was mounted on one of those, to allow for a PD true continuum channel, and a wideband context channel.In addition, significantly faster cameras were installed, allowing the context imager to operate at a frame rate of up to 600 Hz.
A151, page 7 of 17 A&A 668, A151 (2022) The instrument was, in addition to the primary pre-filter at 6302 Å, extended with two additional pre-filters, centered on the chromospheric Hα line at 6563 Å and the lower chromospheric NaI-D line at 5896 Å, respectively.The differences in wavelength from the design wavelength of the prototype are +230 Å and −400 Å, respectively, so some adjustments to the instrument optics were required to focus the instrument at each wavelength.
The image scale of the spectral camera was kept more or less the same throughout the campaigns, at 0.065 ′′ px −1 , but that of the context imager was reduced from 0.062 ′′ px −1 in 2017 to 0.054 ′′ px −1 in 2018, in part to accommodate the higher resolution that can be obtained at shorter wavelengths, and in part to allow the light level on this camera to be higher than in 2017.Together with the beam splitter needed for the PD setup, and the short exposure time of 1.5 ms, the context cameras could be used with the same filter as the spectral cameras, without the need for additional gray filters.This way, all photons that reflect off the entrance window of the instrument can be recorded, thus maximizing the signal available for determining the wavefront, and minimizing the chance of introducing differential aberrations between the context imager and the focal plane of the instrument.

Raw hyperspectral data
We start by examining the basic properties of the raw data cubes, after extraction from the raw images.It may seem that the properties of these data must be a simple function of the instrument and detector performance, but in this case, it is clearly also influenced by the extraction procedure.Moreover, this procedure is correcting for some of the instrumental degradation that is present in the raw images, which inevitably comes at the expense of an increase in the noise of the data.Although instrumental degradation is also present in the data of conventional instruments, a correction is usually not taken into account in the performance evaluation.However, since it is difficult to make meaningful statements about the instrument performance from the raw data alone, we have no choice but to include it here.

Comparison with context imager
To evaluate the optical performance of the instrument as an imager, we compare here the raw extracted data cubes, integrated over the entire wavelength range, with the images recorded by the context imager, for a data set recorded on 10 July 2017.The context images need to be averaged over three separate exposures, since the context camera was running at 90 Hz, whereas the spectral cameras can only manage 30 Hz.
An example of the two is shown in Fig. 9, where the most obvious difference is the very low noise in the integrated hyperspectral data, a direct result of the significant difference in the number of photons in both images, which is estimated at 2.5 × 10 5 in the integrated hyperspectral data, compared to only 2.4 × 10 4 for the sum of 3 context images.
Of these data, the normalized RMS, given by the standard deviation divided by the mean, was then calculated over the part of the FOV that both cameras have in common, while excluding all pixels in the hyperspectral data that are missing, so as to not artificially increase the RMS.Because there is a small rotation angle between the two cameras, and both cameras have a different pixel size, the cutout could not be made identical.
Figure 10 shows the RMS normalized contrast of the spectrally averaged data cube, co-plotted with that of the averaged context image.A significant difference between the two curves can be observed, where, untypically, the context image has a lower RMS contrast than the raw spectral cube.Adding a constant stray light contribution of about 15.5% of its mean to the context image, all but eliminates the difference, with the small amount remaining most likely the result of small truncation differences caused by residual seeing-induced image motion, and rotation of the telescope image.This suggests that the difference in RMS is not the result of a low-order aberration in either the primary re-imager or the context re-imager, because residual errors in the wavefronts of the solar image would, on occasion, compensate for such an error, and cause an erratic RMS difference between the two channels, which is not observed.Instead, the consistency of the agreement is so high that the most credible, if unexplored, explanation seems to be an actual stray light contamination of the context imager.
There are multiple possible causes for such stray light contributions, such as a significant out-of-band contribution of the pre-filter that is de-focused by the singlet aspherical lens from the context re-imager, excessive surface roughness of the aspherical lens from the context re-imager, or a drifting offset level of the camera.Since any drift in the offset of the camera would need to be very severe, and the dark images recorded regularly do not show significant changes over time, this explanation does not seem very plausible.Surface roughness is a known problem associated with aspherical surfaces and is probably responsible for some stray light in the image; however, 15.5% seems rather excessive.
A151, page 8 of 17 The transmission data of the pre-filter specified by the manufacturer, however, shows that there is possible out-of-band transmission in the blue and red parts of the spectrum, which would be dispersed by the spectrograph and therefore unlikely to generate a significant contribution in the hyperspectral data, but which could reach the context camera unhindered, albeit in de-focused form due to the use of singlet lenses throughout the optical design.This is probably the most likely source of stray light in the context images.
Fortunately, whatever the reason, a constant added background signal does not affect the MFBD analysis, and the coefficients to be used in the spectral restoration are not compromised in any way.

Noise properties
We examine the noise properties of the raw data here, and check it for quality and consistency.Since the data are based on the raw images, we start by making an estimate of the number of electrons in each pixel in the data cube.Since the wavelength spacing of the data cubes was chosen to be close to one pixel, the maximum data values in the raw image are pixels in which the spectra occupy the center of the pixel; therefore, it can be assumed that nearly all light in that spectrum is contained in that particular pixel.With a gain of around 10e-px −1 , this value of approximately 120 DU indicates that around 1200e-are present in each spectral bin, which should have a statistical noise of around 2.8%.
If we consider two successively recorded images, im i , with a noise content σ i , that are sufficiently similar to assume that they are identical, their difference is a statistically distributed quantity with zero mean and standard deviation σ d = √ 2σ i .The normalized RMS, n i , in one image is then where im i represents the mean of the image.
If we apply this expression to two consecutive raw images, and calculate n i for the brightest 5% of the pixels, we arrive at 2.9%, which is in good agreement with the expected value, considering the maximum measured counts level of about 100DU, which translates into approximately 1000 photo electrons.
For the raw data shown in Fig. 9, the extracted data cubes appear to contain noise at a level of around 6.1%, which is about twice the value expected from the photo electron count.This number can be confirmed by selecting a small piece of spectrum that is without spectral features, and calculating the normalized RMS.This exercise yields a number that is on average 6.5%, more than twice the 2.9% that would be expected on the basis of the photon noise measured in the raw images.A spatial map of the normalized RMS in the continuum, shown in Fig. 11, shows that this noise figure has a significant spatial structure, with a minimum of around 3%, but with a maximum of about 15%.This noise is, however, clearly dependent on the light level, as can be seen in the plot of the spatial RMS as a function of wavelength, which suggests it stems from photon noise, and is merely enhanced.
The root cause of this noise enhancement must originate in the data extraction, since nothing else has happened so far.The most obvious candidate is the spatial smearing caused by a less than perfect optical performance of the spectrograph.A comparison of the Strehl ratios, shown in Fig. 13 of Paper II, with the normalized RMS from Fig. 11, is shown in Fig. 12, and confirms that clearly there is a dependence.A linear fit to the points shows a small negative trend, which returns a normalized RMS value of 4.4% for a Strehl of 1.This indicates that the poor optical performance indeed degrades the S/N rather rapidly, but also that even with a perfect optical system, we would not recover the S/N of the original data.This result seems rather counterintuitive since the spectra are visually clearly separated and since the contrast of more than 70% between the bright and dark areas on the image sensor indicates that the spectral cross contamination cannot increase the noise by more than a few percent.However, the strong increase in the noise can be understood by realizing that the instrument is designed to optically separate the individual image elements spatially, but it still disperses the light in a continuous manner.The resulting data are therefore convolved in the spectral direction, as they are for any other spectrograph, and mapping it to a hyperspectral data cube effectively de-convolves them.
The power spectrum of the continuum points that were selected to calculate the normalized RMS map from Fig. 11, shown in Fig. 13, indeed confirms that the power that remains after removing all trends and large-scale variations from the spectrum is blue: it increases in power with the wave number.Such behavior is typical for deconvolved data, where the noise is enhanced as a consequence of the decreasing value of the transfer function for increasing values of the wave number, approaching infinity at the resolution limit of the data.This noise enhancement, although it is always present, is almost never considered in spectrographic data.Unfortunately, due to the blending of spatio-spectral information in this instrument, it must be considered here.

Restored data
In two SST campaigns in 2017 and 2018, a number of active regions were observed during periods of good seeing.In this paper we make no attempt to give an exhaustive overview.Instead, we present a sample of the data that were obtained with the prototype, focusing heavily on the first campaign with good seeing in July 2017, and leave detailed analyses or interpretation of the data for future publications.
To do some justice to the multidimensional character of the data, a large amount of information needs to be presented, requiring a complex figure format.A figure consisting of slices of the hyperspectral volume in all three dimensions, along with a plot of the spectrum in a feature of interest, for each of the Stokes parameters, was found to give a good impression of the observational interest and the image quality of the data.
The left hand side of the figures shows the restored image obtained with the context imager, and is strictly co-temporal with the restored data cube.The section of the context image in which light is able to enter the primary re-imager is outlined in red, and an enlarged cutout of the context image in that region is shown on the left hand side above the context image.
In the right half of the figure, a number of slices through the restored hyperspectral cube are shown in four individual panels, each containing images in the four Stokes parameters, with which they are labeled.The central image of each panel (i.e., closest to the point where the four panels come together) show virtual filtergrams, obtained by integration of the appropriate Stokes parameter between the wavelength limits indicated with orange dashed vertical lines in the profile plots (shown on the outer corner of each panel).
Each of the virtual filtergrams is annotated with two dashed lines, each of which represents a virtual slit, along which a traditional spectrogram was extracted from the data cube.These spectrograms are shown beside the filtergrams, with their spatial axis aligned with the direction of the virtual slit.In the outer corner of each panel (i.e., farthest away from the point where the four panels come together), the spectrum is plotted at the point where the two virtual slits cross.
Finally, the spectral average of Stokes I is shown above the full context image, next to the enlarged section of the context image.These two images cover the same wavelength band, and therefore they should look identical, which serves as a basic verification of the image processing pipeline required to produce a fully reduced hyperspectral cube.
From the observing runs of 2017 and 2018, four examples were selected that give a good overview of the type of observations that can be obtained with this type of hyperspectral instrument.
7 July 2017: Quiet Sun at disk center.Two examples of data sets obtained at the design wavelength of 6302 Å are shown in Fig. 14 in the format described above.The top figure shows a carefully selected patch of very quiet Sun at disk center, recorded during approximately 20 min of intermittent seeing with significant periods of very good seeing, observed around noon on 7 July 2017.The context camera was running at 90 Hz, the spectral camera at the standard frame rate of 30 Hz.
Although initially no sign of magnetic activity was visible in the FOV, after about 7 min a bright point appeared near the center of the FOV, which can be tracked continuously for the remaining 5 min of the time series.Weak signals in circular polarization, corresponding to vertical field strengths of not more than a few hundred gauss, are clearly visible throughout the FOV, roughly tracing out the intergranular lanes.The signal from the bright point, once it appears, is stronger by about an order of magnitude, and appears to be consistent with the field strength of 1-1.5 kG that is typically found for such features (see for instance Parker 1978, and references therein).
Unfortunately, during this campaign, the MiHI prototype was still operating in single beam polarimetric mode, leaving the linear polarization signals only barely visible above the noise, and in some cases it is difficult to distinguish them from residual seeing-induced crosstalk.
7 July 2017: Orphan penumbra.In a second example, recorded also on 7 July 2017 with the same configuration as above, a significant time series of an orphan penumbra in AR12665 was recorded at a mu of 0.94.A snapshot from the reduced data, shown in the bottom half of Fig. 14, has considerably stronger polarization signals than in the quiet Sun data shown above.In addition, the magnetic field is not closely aligned with the line of sight, so linear polarization signals can A151, page 10 of 17 be easily discerned, despite the much more intermittent and lower quality of the seeing at the time of recording.
From the Stokes V image, the magnetic configuration appears to be simple: a penumbra that is aligned with a magnetic loop that connects two opposite polarity micro-pores.From the spectra extracted along the vertical virtual slit, however, a much more complex picture appears, with three polarity reversals and large velocity differences along the slit.
There are clearly significant velocities along the LOS, indicated by significant Doppler shifts of all four Stokes profiles along the virtual slits.These are a known source of crosstalk in imaging polarimetry, which may explain the large difference between the simple image and the rather variable spectral behavior.The velocity structure of the orphan penumbra seems to be oriented along the filaments, has large velocity amplitudes, but it does not appear to be very dynamic.In fact, the central part of the micro-pore near the top of the FOV contains a high velocity downflow that persists for the entire time series of more than one hour.
The spectra themselves look fairly symmetric in Q and U, and antisymmetric in V, with no obvious signs of seeing-induced or polarimetric crosstalk.The difference in the Landé factor between the two FeI lines at 6301.5 and 6302.5 Å is quite clearly visible in the individual spectra, with the amplitude of all Stokes parameters larger in the line at 6302.5 Å than in the line at 6301.5 Å by almost a factor of 2. 17 August 2018.In the campaign in 2018, different prefilters were mounted on the MiHI prototype, and the instrument was modified to provide the best focus at the selected wavelength.The polarimeter was modified to a dual beam configuration, running at the default frame rate of 30 Hz, whereas the context imager was modified to provide phase diverse context data, with cameras that were able to capture images at a frame rate of 360 Hz.
The first new pre-filter that was mounted covered the wavelength range 5893.5-5897.5 Å, containing the Na-D1 line at 5896 Å.Despite the small wavelength difference between this spectral band and the design wavelength, the length of the secondary re-imager needed to be modified to focus the instrument.
The Na-D lines form in the lower chromosphere, and are not especially sensitive to the Zeeman effect.Moreover, they are formed near the temperature minimum in the solar atmosphere, making them among the lines with the lowest core intensities in the entire visible range of the solar spectrum.This makes the data sensitive to nonlinear effects, and also makes it much more challenging to collect enough photons to achieve a good S/N.
Although the side effect of the low core intensity is that the wavelength derivative of the line is rather high, which helps in boosting any Stokes signal that the line might generate, it does not compensate for the rapid decrease in the general strength of the magnetic field in the solar atmosphere with height.The obvious remedy, accumulating more signal by restoring longer bursts of data, does not work in this case, since the solar evolution timescale in the lower chromosphere is about a factor of 5 lower than it is in the lower photosphere.
Since no detailed transfer map is yet available for this wavelength, and the optical performance is significantly different from the performance at 6302 Å, we use only an interpolation based data extraction here, (see also Paper II), and perform an ad hoc spectral crosstalk correction.This correction consists of spectrally shifting the horizontal neighbors of each spectrum by the appropriate amount, to recreate how they were aligned on the raw sensor.Then the spectra are convolved with a Gaussian profile, with a standard deviation of 3 pixels, which roughly resembles the actual contamination as it is present in the spectrum under consideration.Finally, the neighboring and blurred spectra are weighted and subtracted from the spectrum to be corrected.The weights were assumed equal for both neighbors, and constrained by extracting a flat-field image, and requiring the line profiles to have the same core depth as the profile in the reference spectrum.The result is data that is suitable for visual inspection, and shows almost no sign of residual crosstalk.
The maximum accumulation time before significant blurring of the restored data occurs was experimentally determined to be 2.5s for the core of the Na-D lines.This was taken as the standard burst length for restoration of the data.
Figure 15 shows an example of an observation in a plage region near disk center, recorded on 17 August 2018.The burst used for restoration covered only 2.5s, which results in a visibly reduced S/N of the data compared to that for the 6302 Å data from Fig. 14, despite the use of a dual beam polarimeter.In the continuum, an RMS noise of around 1% was reached, which, although the plage contains strong magnetic field, is not negligible compared to the circular polarization amplitude of about 10%.
The spatial distribution of the circular polarization roughly follows the bright points and ribbons visible in the broadband image, but show signs of significant horizontal expansion of the magnetic field at the height of the Na-D lines.The linear polarization is only barely visible above the noise, and shows no discernible small-scale spatial structure at all.24 August 2018.The final pre-filter that was tested covered the wavelength range 6561-6565 Å, containing the H-α line at 6562.8 Å.The observational setup was modified to focus the instrument, but besides that the configuration was kept as described for 17 August 2018.
The H-α line forms in the middle chromosphere, and is very hard to polarize.The magnetic field in the chromosphere is at least an order of magnitude lower than in the photosphere, but the evolution timescale is an order of magnitude higher.Blurring of the restored data already occurs at burst periods exceeding 1.3s, which makes it hard to accumulate many photons.
For this wavelength, as for 5896 Å, a model for the transfer map is still missing.Interpolation had to be combined with the ad hoc crosstalk correction described above.
The bottom panel of Fig. 15 shows an example of the data obtained with the MiHI prototype in this mode.The clear change in the morphology of the context image is the consequence of the large line width compared to the spectral range of the instrument.The pre-filter, used also as a context filter, is therefore not dominated by any particular atmospheric layer, but instead is a homogeneous blend of many heights.While this provides a very useful context image, it results in a rather low image contrast.This makes it harder for the image restoration code to separate the image and the wavefront information, resulting in reduced accuracy of the restored wavefront.
The restored spectral data show that the core of the H-α line is so broad that it occupies nearly 30% of the 4.5 Å spectral range of the instrument.The wings of the line are much broader than 4.5 Å, so the continuum cannot be reached anywhere.Moreover, the Doppler shifts caused by the very high chromospheric velocities are large enough to shift the line core out of the spectral range, despite the relatively quiet nature of the target, an AR filament.
A151, page 12 of 17 The H-α intensity profile in Fig. 15 is highly asymmetric, typical of a multi component atmosphere.This is particularly obvious in the virtual spectrum from the vertical slit, which shows a dark, Doppler shifted and broadened component, on top of a relatively static and much weaker background component.
Besides Stokes I, the other Stokes parameters do not show a lot of signal, except for a few blobs in Stokes U and V.The ones in Stokes V are probably real signal, but based on the wide separation between the antisymmetric lobes of the profiles, they must originate in rather deep layers, close to the photosphere.The ones in Stokes U, however, appear to be uncorrelated to any of the structures visible in Stokes I, and appear wherever rapid evolution in the spectrum can be seen.This association suggests that they might be evolution-induced crosstalk; however, with the dual beam configuration that was used here, this crosstalk should be strongly reduced.
The normalized RMS due to noise in the continuum is, at 2%, decidedly high.With an integration time of only 1.3s, this is not surprising.
Restored data properties.We now take a closer look at the noise properties of the reduced data.This can only be done thoroughly for the data in the 6302 Å spectral band, since it is the only wavelength for which the transfer map was calculated, but in Sect.3.4 we make an estimate of what can be expected for other wavelengths once the transfer map for them is determined.
One of the main problems we have in evaluating the noise level is that even if the input images have purely white Gaussian noise, the noise of the restored data is no longer white, due to the deconvolution applied by the restoration algorithm.For critically or over-sampled data, the S/N is even guaranteed to reach zero at the diffraction limit.The more extended the PSF that was corrected for, the lower the S/N of the data at any given image frequency will be.
We proceed as in the case of the raw data cubes, by evaluating the normalized RMS of the data in the continuum, but this time of the restored data cubes, and limit the evaluation to a fully converged data set containing only one polarimetric state, restored from a burst of data spanning a total of 2.5s integration  16 shows the power in the image as a function of the spatial wave number, for images of varying spectral width.
The inflection point of the curves indicates the wave number for which the image information has the same power as the noise (i.e., by definition, the point where the S/N is unity).Above this threshold, noise dominates and no image information can be accessed.From the behavior in Fig. 16 it is clear that reducing the noise by averaging over multiple wavelengths increases the image resolution.The power spectrum does not show the expected rise of the noise power to infinity toward the diffraction limit of the spectrograph, but shows a bump instead, a rise, followed by a drop to the power level of the raw image at and beyond the diffraction limit.This is a consequence of using the Lucy-Richardson deconvolution algorithm, which only boosts spatial frequencies below the diffraction limit, and has a convergence rate that decreases to zero at and beyond the diffraction limit.This means that it is slow to converge fully, and even 4000 iterations, complemented with ORTHOMIN acceleration, still do not suffice to reach the highest frequencies that are available in the data cube.
As a consequence, it is possible to reliably evaluate the noise properties in this way only for images for which the inflection point in the power spectrum is visible.This is not obviously the case for the integration over 320 and 640 mÅ, but we can still make an estimate by using a one sided fit.
We calculate the noise level by filtering a demodulated full Stokes set at the inflection point of the Stokes I image, to exclude the noise dominated regime, and determine the RMS noise in the polarimetrically demodulated data, in the continuum.We repeat this for five different bandwidths, ranging from 10 to 640 mÅ, the results are summarized in Table 1 and shown in Fig. 17.
Clearly, there is a considerable dependence of the spatial resolution in Stokes I on the bandwidth of the image, which is entirely driven by the increase in the S/N from the wavelength averaging.However, the noise for the other Stokes parameters, which should be approximately twice the noise in Stokes I, is also decreasing, but not very fast, and even the average over more than 10% of the spectral range has a noise of around 0.3-0.4%.This is partly because there is residual seeing-induced crosstalk, which cannot be eliminated because we do not have dual beam data, and partly because the noise filter is designed to remove the noise in the Fourier domain where the S/N drops below unity, the location of which depends on the amount of power present in the image at that wave number.Since this power is a decreasing function of the wave number, provided we have resolved all primary spatial scales (in this case, the solar granular scales; see, e.g., Danilovic et al. 2016), the signal power and therefore the noise power decreases with increasing wave number, thus decreasing the overall noise power of the data.

Backward compatibility
Clearly, spatial resolution, spectral resolution, and noise levels of the data cannot be easily separated, making a comparison with traditional instruments difficult.We nonetheless make an attempt here to put these noise figures into an established context.The de facto standard in solar spectro-polarimetry has been set by the spectropolarimeter (SP) Lites et al. (2013) on board the Hinode Solar Optical Telescope (Tsuneta et al. 2008) since its launch in 2006.The Hinode SP is not a hyperspectral instrument, but produces data cubes of a very similar type to the MiHI prototype, with the notable difference that a scan across a FOV the size of the FOV of the MiHI prototype takes 240s, and has a spatial and spectral sampling of less than half that of the MiHI prototype.
Raw data.When we assess the noise level of the raw data and compare it to that of Hinode, it is important to consider the differences in the data sets carefully.The Hinode SOT is a 50 cm telescope, which has an area that is almost four times smaller than that of the SST.For that, however, it has a dual beam polarimeter, which, in the first observing season, MiHI did not, and it has a 21.54 mÅ spectral bin size.It also has a A151, page 15 of 17 A&A 668, A151 (2022) very different image sensor, with an assumed quantum efficiency (QE) of 0.8 or more, whereas the CMV20000 sensors used in the MiHI cameras have a QE of only 0.6 at a wavelength of 630 nm.
We consider the noise level in Stokes V/I of 1.1×10 −3 in 4.8s, as measured in the continuum of a full mode Hinode SP data set from 2007, and compare this to the noise level of 6.4×10 −3 that we obtain for a single monochromatic spectral value with MiHI in 10s.Since the MiHI data are sampled critically whereas the Hinode SP data are sampling at the Rayleigh limit, and the spectral sampling is 2.15 times higher in MiHI than in Hinode SP, we can calculate that the MiHI data would have had a noise figure of 3.4×10 −3 in 4.8s if the same sampling had been used.Repeating this estimate using the MiHI data binned to 20 mÅ px −1 yields a value of 3.9×10 −3 , which is somewhat higher, and most likely an indication that the noise in the spectral direction is not completely statistically independent.
Additionally correcting for the lower QE of the MiHI image sensor, the single beam configuration, and the fraction of the light that is sent to the Hinode SP (43.5%), the noise level we would have had, had we observed with the same sampling relative to the diffraction limit, at a spectral sampling of 21.549 mÅ px −1 would be 2.9×10 −3 .This noise level is substantially higher then that of Hinode SP, which is most likely primarily driven by the transparency of the SST and the MiHI prototype compared to the Hinode SP.Estimates of the transparency of SST have been made, arriving at numbers varying between 20 and 40%, depending somewhat on the wavelength.Taking these values and the instrumental transparency of 25%, estimated in Paper I, the overall transparency is estimated to be between 5 and 10%.An estimate of the transparency of Hinode SP, on the other hand, estimated using the numbers from Lites et al. (2013), yields a value of around 25%.
The lower transparency value for MiHI is compatible with the ratio of the noise levels of Hinode SP and MiHI.However, the indication that the noise between the spectral bins might be partly correlated suggests that, despite the care taken to remove it, fixed pattern noise may still be playing a role.
Restored data.Comparing the noise properties of the restored data with the Hinode SP scans is more complicated since we cannot directly compare the restored MiHI data, which are deconvolved, with the Hinode data, which are not.
Attempts to iteratively deconvolve a Hinode SP scan without significant regularization are usually only partially successful, converging initially but then diverging.Because the PSF is well characterized (Suematsu et al. 2008), this is most likely due to each monochromatic image actually representing a diagonal slice through a spatio-spectral-time hypercube, thus containing internal inconsistencies due to solar evolution that cannot be recovered from by using a simple deconvolution.In addition, since the data are compressed on board the spacecraft using a lossy compression algorithm before being transmitted to the ground, some subtle information that may be required to deconvolve the data correctly can be irretrievably lost.
Without obvious alternatives, we evaluate the increase in the noise level as compared to the raw data for both the Hinode and the MiHI data.For lack of a better option, we use a deconvolved Hinode SP scan for which the Lucy-Richardson iterations were stopped when the corrections reached a minimum.Unlike the spatial deconvolution, the spectral deconvolution, carried out using the measured spectral transmission profile, converges very well, which presents us with the problem of deciding after how many Lucy-Richardson iterations to terminate the deconvolution algorithm.Fortunately, applying more than 30 iterations, the solution does not appear to change appreciably anymore.Although such behavior is untypical for data containing white noise and may well be the result of the onboard compression applied to the data before transmission, we exploit it by terminating the Lucy-Richardson algorithm after 100 iterations.
The measured noise levels of 0.0019, 0.0019, and 0.0018 for Q/I, U/I, and V/I, respectively, are a factor of 1.7 higher than for the raw data.Nevertheless, they are likely still an underestimate of the true noise levels we would have obtained had it been possible to continue the spatial deconvolution to a fully converged solution.The enhancement factor of the noise is relatively low, partly owing to the excellent optical performance of the Hinode SOT, but most probably also partly because of the undersampling of the focal plane, which prohibits access to the highest spatial frequencies, and avoids the high noise enhancement associated with those.
By comparison, the equivalent restored MiHI data have noise levels of 0.011, 0.011, and 0.010 for Q/I, U/I, and V/I, respectively, a factor of 2.7 higher than those of the raw data.An increase in the total noise by a factor of around 3 is quite typical for deconvolved ground based data, which have to be corrected not just for the optical degradation by the telescope but also for the atmospheric wavefront errors that are not corrected by the adaptive optics (AO).
Although the overall noise at a given fraction of the DL is thus nearly an order of magnitude higher for MiHI data than it is for Hinode SP data, the signals at a specific absolute spatial scale are considerably less damped by the larger aperture of the SST.The combination of spatial binning and a higher value for the telescope transfer function, yields a S/N that is more or less the same as that of normal mode Hinode SP data, on most spatial scales that can also be resolved by Hinode.Only for the highest spatial frequencies that can still be resolved by Hinode and beyond is the S/N of the MiHI data superior.

Other wavelengths
During the campaigns in 2018 and 2019, the MiHI prototype was tested using two new filters, around the wavelengths of the NaI-D lines at 589 nm, and the H-α line at 656 nm.Since the prototype was designed for 630 nm, and uses many singlet lenses, some adjustments were needed to make it work at these wavelengths.Consequently, the optical performance of the primary and secondary re-imagers was not as good as at the design wavelength of 630 nm.
Since the transfer model developed in Paper II was thus far only optimized at 630 nm, we do not have an accurate estimate of the PSF of the instrument at these new wavelengths, or an estimate of the contamination by gray stray light.To nonetheless give a rough estimate of the deconvolved data properties, we can use the contrast ratio of the raw data frames, which is a fairly good proxy for the Strehl ratio of the system.
The best contrast ratios in the flat-field images for the Na and H−α data were 0.35 and 0.40, respectively, which is clearly higher than the 0.30 found at 630 nm, but not catastrophically so.The noise is thus expected to be enhanced by around 30-40% for these two wavelengths, compared to the data at 630 nm.For that, however, the instrument was operating in a dual beam polarimeter configuration.Therefore, the final noise figure in the demodulated data should be comparable to that of the single beam data at 630 nm when scaled for the total exposure time contained in the burst of data that was used to restore the data set.

Summary
In this paper the reduction, restoration, and demodulation of hyperspectral solar data, recorded with the MiHI prototype hyperspectral instrument, have been discussed, using real data acquired between 2016 and 2018 at the SST on La Palma.A fraction of the data were of sufficient quality to be considered typical of observing conditions in which science-grade image data would normally be recorded.
The raw data were found to be affected by instrumentally induced image structure, instrumental crosstalk, drift of the image on the image sensor, and camera nonlinearities, most of which could be calibrated and modeled to a high degree of accuracy.Despite the persistence of some residual imprints of the instrument in the data, the extracted hyperspectral cubes were of sufficient quality to be suitable for image restoration, which was found to be as effective as expected for typical image data.As expected, the image restoration comes at the cost of raising the noise level in the restored data cubes by a factor of approximately 3.
The spatial resolution of the restored data recorded with the prototype was found to be dependent on the S/N, and thus on the number of spectral samples that it is integrated over.For a sufficiently high S/N, a resolution that is comparable to that of a typical broadband imager, and close to the diffraction limit of the telescope, was achieved.The spectral resolution of the data was determined in Paper I and Paper II to be at least 315 000, which is achieved uniformly across the entire FOV.
The prototype was demonstrated to be able to generate data at wavelengths of up to 40 nm from the design wavelength of comparable quality to the data at the design wavelength of 630 nm.The dynamic timescales of the chromospheric data recorded at these new wavelengths were found to often be significantly below those of the photospheric data, which presents new challenges for the data reduction and interpretation.
The possibility to select the time cadence of restored data sets post facto for these types of data is of great benefit since the evolution timescale of a specific data set is in principle unknown until the data are fully reduced and can be adjusted as required.The ability to access the data on a sub-second timescale, without making any compromises to the spectral range and resolution, makes this instrument uniquely suitable for time-resolved observations of even the most dynamic parts of the solar chromosphere.

Fig. 1 .
Fig. 1.Effect of the flat field on a reduced monochromatic image.Left: original flat field and image extracted with a displacement-corrected map.Center: flat field extracted with the original map and image extracted with a displacement-corrected map.Right: flat field moved to the image location, and the flat field and image extracted with a displacement-corrected map.

Fig. 5 .
Fig. 5. Histogram-trimmed spatial distribution of the modulation matrix elements at a continuum wavelength near the peak transmission of the pre-filter.The histogram is scaled between 0.1 and 99.9% of the values, and the axis units are in pixels.

Fig. 6 .
Fig. 6.Polarimetric fringes in the reduced data.Ticks on both axes indicate the angular size of the FOV in arcseconds.Left: Stokes I image in the red wing of the FeI line at 6302.5 Å. Center: continuum-corrected Stokes V image corresponding to the right image, reduced with an unpolarized gain correction.Right: same image as in the center panel, but reduced using a polarized gain correction.
Fig.7.Converge of the Lucy-Richardson approach for solving the spectral restoration problem.The plot shows the RMS of the difference between the linear operator applied to the current solution and the RHS of the linear system as a function of iteration number.The relatively linear correlation between the RMS difference and the iteration number on a log-log scale is typical of a power-law-type functional relation.

Fig. 8 .
Fig. 8.Comparison of images restored with and without considering systematic image motions.Top: images in the red wing of the FeI line at 6302.5 Å in the four Stokes parameters.Ticks on both axes indicate the angular size of the FOV in arcseconds.Bottom: same images as shown in the top panels, but with the motion-induced crosstalk removed by realigning the images for each of the modulated states and subtracting the remaining residual I to Q, U, and V crosstalk, averaged over a 20 min period.

Fig. 9 .Fig. 10 .
Fig. 9. Raw images from 10 July 2017 for a selected part of the FOV.Left: average over three context images.Right: wavelength-integrated hyperspectral data, simultaneously recorded with the average over the context images.The horizontal and vertical scales are in arcseconds.Black pixels indicate either image elements for which the transmission is very low or image elements that are vignetted over a significant part of the spectral range.

Fig. 11 .Fig. 12 .
Fig. 11.Noise properties of the extracted hyperspectral cubes.Top left: histogram-trimmed difference between two consecutive frames at the peak intensity wavelength in the continuum.Top right: normalized RMS of the spectrum in each pixel in the cleanest part of the continuum, indicated in the bottom-right panel.The intensity scale runs from 0.045 to 0.075.Bottom left: normalized RMS of the entire FOV as a function of wavelength.Bottom right: mean intensity over the FOV as a function of wavelength.The two vertical lines indicate the spectral region over which the normalized RMS in the map in the top right was calculated.The horizontal and vertical scales are in arcseconds.

Fig. 14 .
Fig. 14.Examples of restored photospheric data.Top panel: quiet Sun at disk center, in the spectral band 6299-6303 Å, moments after a bright point has emerged.The spectral gray scale for Q, U, and V is ±2%.Bottom panel: orphan penumbra in AR12665, in the same spectral band as in the top panel.The spectral gray scale for Q, U, and V is ±15%.All spatial scales are in arcseconds, and all wavelength scales are in Å.

Fig. 15 .Fig. 16 .
Fig. 15.Examples of restored chromospheric data.Top panel: network near disk center in the spectral band 5893.5-5897.5 Å, which contains a Na-D line at 5896 Å and a Ni/Fe line pair around 5893 Å. Bottom panel: active region loop in a newly emerging active region near disk center, in the spectral band 6561-6565 Å, which contains the H-α line at 6562.8 Å.All spatial scales are in arcseconds, and all wavelength scales are in Å.

Fig. 17 .
Fig. 17.Stokes image properties for different bandwidths in the quiet Sun.The bandwidth varies from 10 mÅ on the left to 640 mÅ on the right.Each image is filtered at the inflection point shown in Fig. 16.The image resolution increases from the left to the right from 0.58 to an estimated 0.85.The spatial scales for the I, Q/I, U/I, and V/I panels are in arcseconds, and the wave number scales in the bottom panels are in arcseconds −1 Fig. 13.Power spectrum of the deconvolved intensity cube in the spectral direction in a spectral range with a relatively clean continuum.After an initial drop in the power as a function of scale for large spectral scales, a steady increase can be discerned, typical for deconvolved data.

Table 1 .
Noise vs. image resolution in Stokes Q/I, U/I, and V/I for a frame restored from a 10s burst of data.