Calibration of NOMAD on ESA’s ExoMars Trace Gas Orbiter: Part 1 – The Solar Occultation channel

Nadir and Occultation for MArs Discovery (NOMAD) is a 3-channel spectrometer suite that is currently orbiting Mars onboard ESA's ExoMars Trace Gas Orbiter, measuring the composition of the Martian atmosphere in unprecedented detail. Of the three channels, two operate in the infrared: the Solar Occultation (SO) channel observes gas species in the 2.2–4.3 μm spectral region in solar occultation mode, while the Limb, Nadir and Occultation (LNO) channel observes in the 2.2–3.8 μm spectral region and can operate in limb-, nadirand solar occultation-pointing modes. The Ultraviolet–VISible (UVIS) channel operates in the UV–visible region, from 200 to 650 nm. Both infrared channels have a spectral resolution typically an order of magnitude better than previous instruments orbiting Mars, to measure molecular absorption lines and therefore determine the abundances of constituents of the Martian atmosphere and the processes that govern their distribution and transport. To maximise the full potential of the instrument, a wide range of calibration measurements were made prior to launch and continue to be made in-flight. This work, part 1, addresses the aspects of the SO channel calibration that are not covered elsewhere, namely: the SO channel ground calibration setup, boresight pointing vector determination, detector characterisation, detector illumination pattern and saturation levels, and an investigation of the instrument line shape. An accompanying paper, part 2, addresses similar aspects for LNO, the other infrared channel in NOMAD (Thomas et al., 2021, this issue).


Introduction
NOMAD (Nadir and Occultation for MArs Discovery) is one of four instruments on the ExoMars Trace Gas Orbiter that has been observing the Martian atmosphere across a wide spectral range spanning the UV and IR spectral ranges since the nominal science mission began in April 2018. It consists of three independently operating channels, two of which observe in the IR region (SO and LNO) and one that operates in the ultraviolet and visible region (UVIS). The two IR channels cannot operate simultaneously, but either can operate together with UVIS, providing simultaneous observations in the IR and UV-visible spectral ranges (Neefs et al., 2015;Patel et al., 2017).
The NOMAD SO channel has a high spectral resolution (resolving power~20000), able to detect many major and trace gases in the Martian atmosphere, including CO 2 , CO, H 2 O, HDO and HCl Korablev et al., 2021;Vandaele et al., 2019;Villanueva et al., 2021) and clouds/aerosols (Liuzzi et al., 2020). Detection limits for trace gases such as CH 4 have been improved by an order of magnitude compared to previous orbiting instruments Korablev et al., 2019) thanks to the very high Signal-to-Noise Ratio (SNR) of 2000-3000 in the solar occultation mode . The SO channel continues monitoring the major seasonal cycles on Mars, extending existing datasets made by successive space missions in the past decades and also adding vertical information. Global datasets of CO 2 , H 2 O, CO etc. generated by NOMAD will be invaluable to understanding the variable atmosphere of Mars (Vandaele et al., 2018).
This work describes the continuing effort to ensure that NOMAD is well calibrated and remains so, to achieve the science objectives of the instrument and the ExoMars programme.

NOMAD SO channel
An image of NOMAD is shown in Fig. 1. The SO channel is a re-flight of an existing spectrometer, Solar Occultation in the InfraRed (SOIR), which was part of the SPectroscopy for the Investigation of the Characteristics of the Atmosphere of Venus (SPICAV) spectrometer suite onboard ESA's Venus Express (Nevejans et al., 2006) covering the 2. 2-4.3 μm spectral range. The SO channel is optimised for solar occultation observations, i.e. directly viewing the Sun through the atmosphere during sunsets and sunrises, with a field of view (FOV) of 30 Â 2 arcminutes. The channel is comprised of: entrance optics; an acousto-optic tuneable passband filter (AOTF); a spectrometer section, consisting of a slit and echelle diffraction grating spectrometer; and a cryo-cooled infrared detector array. Unlike the LNO channel, the SO channel is designed solely for solar occultation observations.
In both infrared channels, the AOTF acts as a passband filter, selecting the spectral interval that is recorded on the detector. The bandwidth of this filter is chosen so that it corresponds approximately to the Free Spectral Range (FSR) of the echelle spectrometer section. The AOTF is driven by a radio frequency, which is chosen for each diffraction order such that the AOTF passband allows radiation from the chosen diffraction order to reach the detector (Fig. 2). The Sofradir HgCdTe MARS-MW type detectors in the SO and LNO channels contain 320 columns (spectral direction) by 256 rows (spatial direction) of pixels. During observations, they are cooled to 85K by a RICOR K508HSM rotary cryocooler, but not all of the 256 detector rows are illuminated by the Sun during a solar occultation observation, and so only the illuminated rows are read out during each frame acquisition. More technical details on the NOMAD instrument, and in particular the infrared channels, can be found in (Neefs et al., 2015).

Measurement parameters
The wavelength of the AOTF passband can be changed quasi-instantaneously, and so any diffraction order can be measured within the channel's spectral range (Fig. 2). Heritage electronics from SOIR, anticipated spacecraft data volume limitations, and SNR considerations limit an SO occultation to 5 or 6 diffraction orders per second. SO observations typically have a periodicity of 1 s, which is known as the rhythm: a normal occultation measurement is made by cycling through the chosen orders within this period, then returning to the first diffraction order and cycling through the orders again in the next rhythm period, etc., until the channel is switched off (Fig. 3). Spatial information is retained: each detector row has an FOV of~1 Â 2 arcminutes (Fig. 4), and so each row views a different slice of the atmosphere. Table 1 describes some typical observation modes: the SO channel can return 24 spectra per rhythm period, therefore if only one diffraction order is chosen, then NOMAD can return 24 spectra, each of a different detector row with different FOV. If 6 diffraction orders are chosen, then 4 spectra can be returned per diffraction order and therefore the detector rows are binned (Fig. 4). The FOV of each bin must be within the solar disk, therefore for normal solar occultations, running 5 or 6 diffraction orders, 4 bins of 4 detector rows each are chosen to give a total FOV of 16 Â 2 arcminutes (Fig. 4).
On-board background subtraction can be switched on or off for solar occultation measurements. With on-board background subtraction, a dark spectrum (with the AOTF switched off) is acquired before every occultation spectrum, both with the same integration time. The dark spectra are then subtracted from the occultation spectra and the resulting spectra are transmitted back to Earth. This has the advantage that the background is more accurately removed, however the disadvantages are that half of the observation time is lost to measuring the dark spectra, and the raw background signal is lost (as only the subtracted values are transmitted back to Earth). At the start of the mission both methods were used; since 2019 the majority of observations have been run with onboard background subtraction.
In solar occultation mode, sunset (atmospheric ingress) observations begin before the line of sight (LOS) of the channels passes through the Martian atmosphere, when the instrument directly observes the Sun. This acts as a reference measurement, from which all the following spectra are converted from Analogue-to-Digital Units (ADUs) to transmittance can be radiometrically calibrated as the line of sight passes through the atmosphere and absorption lines are subsequently observed. Conversely, at sunrise (atmospheric egress), the first observations are made at the lowest altitude when the atmosphere is already in the channels' LOS, and therefore the above atmosphere reference measurement is made at the end when NOMAD views the Sun directly. This self-calibration means that radiometric calibration of the channels in occultation mode is not necessary, and so much of the ground calibration campaign was aimed at the LNO nadir channel, which requires other means of radiometric calibration.
In addition to scientific measurements of specific diffraction orders, a method of calibrating NOMAD was also implemented, known as "stepping" measurements. These specific observation types allow a measurement parameter (such as integration time, AOTF frequency, diffraction order, detector row, etc.) to be incremented continuously from a starting value for a set number of steps. This is particularly important for calibration observations, for example by allowing us to "step" through the entire spectral range of NOMAD or measure at many different integration times in a single observation. In this mode, vertical binning is not typically used, and so the data for each pixel is returned, using the calibration mode in Table 1.
Due to the complex nature of the instrument, effectively containing three separate spectrometers that operate in multiple observation modes, the complete calibration of the instrument is divided into several separate studies: this work focusses on pointing calibration, detector calibration and instrument line shape. For SO/LNO AOTF and spectral calibration, more details are presented in . The method used to convert solar occultation observations into transmittance is the same used in SOIR, which can be found in .

Sampling resolution
One big advantage of solar occultations is that the solar disk is so bright that very small integration times can be used, and hence spectra can be acquired very rapidly, up to 6 frames per second split into 4 detector bins. This gives an altitude resolution, as shown in Fig. 5, of 10s-100s of metres depending on the geometry of the occultation. At high latitudes, where the duration of the solar occultation is the shortest, the tangent altitudes change by~150 m between spectra, and the latitudinal change approaches zero i.e. the surface location below the tangent point remains fixed. For the longest occultations that cross equatorial regions, the tangent altitudes can change by as little as 25 m, although the latitudinal change is the highest, up to 0.006 between spectra.
Latitudes, longitudes and tangent altitudes are calculated using the ExoMars 2016 SPICE (Spacecraft, Planets, Instrument, C-matrix, Events) kernels (Acton, 1996). These are data files that contain the geometric information about the location, orientation and velocity of TGO, calculated from TGO telemetry, and planetary bodies such as Mars and the Sun. The NOMAD data pipeline is primarily written in python, and so the kernels are processed using SpiceyPy toolkit (Annex et al., 2020).

SO calibration objectives
The main instrument calibration objectives are detailed in Table 2. In occultation mode, radiometric calibration is not necessary for transmission measurements, as the Sun is observed unobstructed at the start or end of every measurement, though spectral calibration and detector characterisation are still required. For successful solar occultation observations, the channel must point towards the centre of the Sun, and the best detector rows -i.e. those illuminated by the Sunand a suitable integration time must be chosen so that the detector is not saturated.

Ground calibration
NOMAD was mounted in a thermal vacuum chamber at the Centre Spatial de Li ege in Li ege, Belgium for the entire ground calibration  . Typical spectrum acquisition schemes for background subtracted and non-background subtracted ingress observations. For egress observations the occultation begins at low altitude and ascends. If background subtraction is performed onboard, only the subtracted spectra are transmitted to Earth; the dark spectra are not recorded. If background subtraction is off, then the dark spectra are transmitted to Earth in place of 1 diffraction order.
campaign. The chamber was equipped with a flange containing three window ports at the same height as the LNO FOV, the UVIS FOV, and the NOMAD reference cube (a reflective mirror for alignment purposes, see Fig. 1). Inside the chamber, NOMAD was surrounded by a temperaturecontrolled shroud. The shroud contained small cut-outs at the same heights as the window ports for the nadir channels and reference cube, whilst the solar occultation channel FOVs were pointed at the shroud.
The SO þ LNO channel calibration setup, mounted on a gantry outside the chamber, contained equipment for calibration of both the infrared and ultra-violet channels; however the latter is not described in detail here. More details are provided in the companion paper (Thomas et al., 2021, this issue). Whilst in the chamber, with the SO channel viewing the cold shroud, integration time stepping observations were made to determine bad pixels. With the chamber lid and shroud removed, measurements were made of a 10 cm gas cell containing 21 mbar of CH 4 , illuminated by an Infrared Globar operating at 1000K, to measure the detector column slant.

In-flight calibration
The main types of in-flight calibration observations are solar line scans, fixed solar observations, and dark sky observations. During solar line scans, the spacecraft is slewed such that the SO or LNO occultation channel FOV passes in and out of the solar disk. For fixed solar observations, the spacecraft points the FOV continuously towards the centre of the Sun; similarly, for the dark sky observations the FOV is pointed in a fixed direction away from the Sun or Mars. More details of each in-flight calibration observation are given in the results section.

Slit position and relative illumination
The angle subtended by the solar disk varies throughout the Martian year (Fig. 6). One pixel in SO or LNO is approximately equivalent to one arcminute of FOV, and hence the detector vertical size (256 rows) is much larger than the solar disk as observed by the SO and LNO channels (covering~20 rows). As only a limited number of detector rows are illuminated during a solar observation, the centre row and extent of each illuminated region must be defined so that the detector readout can be optimised to avoid using non-illuminated or poorly-illuminated lines.
The detector illumination pattern is found using a solar line scan observation: as the spacecraft is slewed across the solar disk, the Sun illuminates every detector row. Fig. 7 shows how the signal on one detector row changes as the FOV moves around the solar disk. As described in the measurement parameters section, during a single frame acquisition only 24 detector rows can be read out, and therefore a "window stepping" measurement is performed. In this mode, detector rows are read out sequentially, e.g. rows 1-16, 17-32, 33-48 etc. until all 256 rows have been measured and the acquisition starts again from row 1. This builds up a picture of the vertical illumination pattern on the detector, so that the width and centre of the illuminated region can be determined; results are shown in Fig. 8.
Note also that the detector rows are almost uniformly illuminated in the centre, but the signal cuts off steeply where the solar light hits the top and bottom of the spectrometer slit. The results show that the illumination patterns are centred on line 128 for the SO channel (covering lines 113-143).

Line of sight calibration
With the centre detector row defined, the same line scans could then be used to calculate the boresight pointing vector (the direction of the FOV centre with respect to the spacecraft). This is essential for solar occultation observations, where the FOV is split into four separate detector row bins that cover the solar disk (Fig. 4). The number of detector rows in each bin depends on the angular extent of the Sun as seen from Marsa single detector row subtends approximately 1 arcminute, and so the Sun illuminates~20 rows in total. It is very important that, during a solar occultation, the entire FOV remains on the Sun, and so we choose to read out 16 rows (i.e. 4 rows per bin). This minimises issues due to spacecraft pointing stability and limb darkening.
The line of sight calibration was achieved in multiple stages: during assembly of NOMAD, all the solar occultation channels were aligned in the laboratory to match the NOMAD structural and thermal model. Then shortly after launch, a line scan was performed where the FOV of each channel was raster-scanned around the Sun in two perpendicular dimensions (Fig. 7). By correlating the detector counts with the pointing direction, it was possible to determine the boresight vector in which the FOV was centred on the Sun. Then, during a second line scan, the boresight vector was refined; and finally checked with a third line scan prior to aerobraking. During a further line scan after aerobraking, the boresight vector was updated further to correct a small offset. A set of two perpendicular solar line scans are made every six months to monitor and refine the vector if required.
The solar occultation observations themselves are also monitored continuously, using Sun spectra taken above the atmosphere at the beginning or end of each observation. Due to limb darkening, the two central detector bins (1 and 2) have a higher signal than the two outermost bins (0 and 3), but when the boresight is correctly defined the limb darkening of the two outer bins should be identical and therefore both bins will have approximately the same illumination. The relative signal strength in each bin over time is shown in Fig. 6. At the beginning of the science phase, one bin had a significantly lower signal than the others, indicating that the boresight had changed. As it was not possible to modify the vector immediately, the FOV was effectively shifted towards the centre of the solar disk by modifying the detector rows that were read out. A second shift was made to improve the alignment further in mid-June 2018. In mid-August the boresight vector was updated and the choice of detector rows reverted to the nominal rows. Note that, even with the correct boresight, the relative signal strength is not constant over time. The signal on the two outermost bins, 0 and 3, is reduced as the apparent diameter of the solar disk becomes smaller, therefore the relative signal strength in Fig. 6B can be seen to follow the shape of the curve in Fig. 6A. When 6 diffraction orders are run, the illuminated region is split into 4 detector bins, where the detector rows in a bin are vertically summed together to produce a single spectrum per bin (typically 4 rows per bin). Each spectrum is transmitted back to Earth individually.

Detector slant
Detector slant refers to horizontal shift of an absorption line as a function of vertical position on the detector, such that a particular wavelength of radiation hits a different pixel in each detector bin. Both ground and inflight calibration are used to determine this as follows: during ground calibration, a gas cell containing 21 mbar of CH4 was illuminated by an Infrared Globar operating at 1000K (Thomas et al., 2021, this issue); during in-flight calibration, solar or atmospheric absorption lines were observed in orbit around Mars. In both cases, absorptions in all detector rows were fitted assuming a Gaussian distribution to find the absorption minimum and the spectral pixel number was plotted versus detector row. Some examples are shown in Fig. 9. The lines in each plot are measurements of the same absorption band, however it can be seen that the points shift to the right for each subsequent frame: this is due to the temperature of the instrument increasing, which shifts the spectral calibration. The same effect is observed in LNO (Thomas et al., 2021, this issue). All the detector rows in a single frame are measured simultaneously, so a shift of the line due to temperature changes does not affect the detector slant.
From analysis of ground and inflight observations, the average observed slant is~0.4 pixels between the top and bottom rows read out during a nominal solar occultation measurement, i.e. 0.025 pixel shift per row or 0.1 pixel shift per detector bin. Such a sub-pixel shift as calculated here can be easily corrected during the retrieval processby calculating the centre of the absorption and shifting the spectrum to match the simulation -and will therefore have a negligible effect on science.

Bad/noisy pixels
It is common for detectors such as those in the SO and LNO channels to contain bad pixels, which give a fixed output signal independent of the intensity of incident radiation. Some pixels behave non-uniformly to changes in intensity of incoming radiation. Such pixels need to be identified and removed before the spectra can be correctly analysed.
SO channel bad pixels were determined from observations of the shroud during ground calibration and from observations of dark sky during in-flight calibrations. Both used an integration time stepping observation, where each pixel is read out individually as the integration time is increased incrementally from 1 μs (the smallest readout time  possible) to 870 ms in steps of 3.4 ms. The majority of the radiation reaching the detector is thermal background from the instrument itself, and so the resulting curves are very similar for a given instrument temperature. All functioning pixels follow a similar linear fit, and therefore large deviations typically signify bad or noisy pixels. Bad pixels have large deviations from the average linear fit, and therefore stand out on a chi-squared goodness-of-fit plot such as in Fig. 10. As shown in Fig. 4, for normal science observations the detector rows are summed into four binstherefore the bad pixels all need to be defined in terms of which bin they affect. As shown in Fig. 6, the detector rows were modified twice at the start of the mission, and so the allocation of pixels into each bin is also slightly different. Therefore, whilst the bad pixels remain fixed, in the binned spectra the bad pixels vary as the detector rows change. The bad pixels identified are shown in Table 3. From analysis of solar occultation data, a few additional bad pixels were added to the table that were not detected during ground calibration. To minimise the effect of the bad pixel when analysing the spectra, the bad pixel ADU is replaced by a linear interpolation between the two adjacent pixels ADU values before conversion to transmittance.

Detector saturation
Detector saturation time curves are essential for selecting a good integration time for every measurement: if the integration time is too short, the resulting spectra will be noisy due to a lack of signal with respect to the readout noise. If the integration time is too long, the detector saturates and the spectrum is lost.
For occultation measurements, the detector is predominantly saturated by the large incident solar flux. During ground testing and calibration, there were no possibilities for NOMAD to observe the Sun, but during inflight calibration the Sun was observed directly. As the instrument sensitivity varies with diffraction order, saturation curves are calculated using a combination of two calibration observations: first an integration time stepping measurement is made while observing the Sun, for a single diffraction order to determine the saturation time. Then a diffraction order stepping observation (where the channel cycles through all diffraction orders) is made at a non-saturation integration time, so that the relative sensitivity of the instrument at each diffraction order can be determined.
Comparing the relative signal for each diffraction order to the saturation time at a single order, the time to saturate any order can be calculated (Fig. 11). As can be seen, an integration time of 4 ms in the SO channel is considered optimal to avoid saturation across the whole spectrum when viewing the Sun.  The gaps correspond to occultation-free periods, where the geometry is such that the spacecraft does not occult the planet. Occasionally the UVIS boresight vector is used instead, hence one bin has a lower relative signal. The Sun-Mars distance also affects the relative signal.

AOTF/grating spectral calibration
The AOTF is a passband filter driven by a radio-frequency generator, where the spectral region passing through the filter depends on the applied frequency. To maximise signal throughput, the input frequency must be chosen such that the central wavenumber of the AOTF passband corresponds to the central wavenumber of the diffraction order being measured.
The AOTF calibration was made in multiple steps -firstly, an approximate AOTF driver frequency vs passband wavenumber was derived in the lab, by scanning a monochromator through a range of wavelengths which were shone through the AOTF onto a detector. This approximate relationship allowed further observations to be programmed into the instrument which could then be refined during ground calibration. The first analysis used gas cell observations in the ground campaign, which was essential for determining the approximate calibration so that this could be uploaded to the instrument and used for inflight calibrations and science observations at the beginning of the mission. The same gas cells were used as for the LNO calibration (Thomas et al., 2021, this issue), namely 5 x Specac 10 cm pass gas cells, containing 21 mbar CH 4 , 264 mbar CO, 93 mbar CO 2 , 26 mbar C 2 H 2 and 1000 mbar N 2 gases, illuminated by a LOT-Oriel 6363IR Infrared Globar operating at 1000K, with a peak emission at 3 μm.
It was more complicated to illuminate the SO channel, as the SO aperture is angled at 67 to the horizontal. To do this, the gas cells and Globar source were removed from the main calibration housing and mounted directly onto the supports inside the thermal vacuum chamber. This prevented closure of the chamber, and so the measurements were made in air at room temperature instead. The gas cells were measured and a provisional list of AOTF frequencies corresponding to each diffraction order were then produced and uploaded to the instrument.
As the mission progressed, and further calibration data was taken,a new spectral calibration was derived from in-flight solar observations for all diffraction orders . The AOTF shape, the AOTF-frequency-to-central-wavenumber relation, AOTF-frequency-to-diffraction-order relation and diffraction grating parameters were determined from in-flight data by , following the method of (Mahieux et al., 2008(Mahieux et al., , 2009) developed for SOIR. Here the laboratory observations were not used in the analysis, but were still essential for calibrationas the choice of detector rows, AOTF frequencies, etc. had to be known in advance in order to plan the inflight calibration observations.

Instrument line shape
The observed shape of an absorption line, as measured by the detector, is a convolution of its intrinsic spectral line shape and the instrument line shape (ILS, also known as the instrument line profile, ILP). The latter is a property of the spectrometer, and is a measure of how a sharp atmospheric spectral line is spread across multiple pixels. Ideally, the ILS is a well-defined shape, invariant with wavenumber and position on the detector. However initial investigations showed that spectral absorption lines appeared to be broader on the right hand side of the detector (pixels 160-320) than the left (pixels 0-160), and a correction was applied to account for this method that was utilised in previous papers ().
Implementation of an accurate ILS is essential for any simulation (i.e. retrieval forward model), otherwise the simulated line intensities and shapes will not be correct, causing systematic errors in the retrieval of atmospheric number densities. Earlier analyses overcame this by effectively splitting the detector pixels into two regimes, with different resolving powers (i.e. Δλ=λ) on the left and right sides of the detector. Work is still ongoing within the NOMAD team to definitively characterise the ILS, but in the interim period, recent H 2 O and HCl retrievals from the SO channel  have used a new approach as outlined below.
The instrumental line shape across the pixels can be further investigated using Martian CO 2 lines (and CO lines for higher orders) because their intrinsic widths are much narrower than the spectral resolution of the SO channel, and the lines are sufficiently spaced on the detector so that they can be individually resolved (e.g. Fig. 12 for order 149). Importantly, this allows us to fit the ILS as a function of pixel number by a mathematical function, since we have now acquired a statistically significant data set of atmospheric spectra. A similar method, using atmospheric CO 2 lines, was also used to characterise the ILS of SOIR Fig. 7. Results of the SO channel solar line scans. At the start, the boresight pointing vector is not well known, hence a large search grid is used to ensure that the solar disk is within the grid. Once the boresight is known, a small grid can be used to accurately define the pointing vector, which is essential for performing accurate solar occultation measurements. Note that the line scan is sometimes centred on the UVIS boresight vector, and hence the centre of the scan is not at the origin. instrument onboard Venus Express (Vandaele et al., 2013).
In Fig. 13, every absorption line in the spectral range of diffraction order 140 has been individually plotted for all spectra (here 40,985 lines in total) taken within a given tangent altitude range (here 20-60 km, where transmittance >30%). The centre of the peak of each absorption has been normalised in transmittance (y-axis) and wavenumber (x-axis). When superimposed, it is clear that the absorptions on the left of the detector (blue) are narrower than those at the centre and right of the detector (green). This could be due to a reflection within the optical system, or an issue such as a broken/cracked/dislodged mirror or lens. Hypothetically, this could cause the ILS, which should be a function with a single peak, to become a large and a small peak whose position changes slightly. On the left of the detector the two ILS peaks are aligned, hence the lines appear sharper; on the right there is an offset between the positions of the two, and so the overall ILS becomes a wider, more complicated shape. Here one formulation is presented showing an example of how the ILS can be approximated, which was successfully used in Aoki et al. (2021). This will continue to be refined over time, as more analysis is performed and more data is recorded.
In particular, the ILS appears to have an asymmetric shape for pixels 160-319. The shape for diffraction order m can be approximated by two Gaussian functions, F 1 (υ) and F 2 (υ), as a function of the centre wavenumber υ of pixel number p, using the following equations: Where the coefficients A 1 , B 1 , C 1 , A 2 , B 2 , C 2 are derived from linear fits to the pixel number e.g.
Where X ¼ A, B, C. The optimal fit parameters, calculated using a least-squares minimisation routine for diffraction order 140, are given in Table 4. The modelled ILS shapes for various pixel values are superimposed on the raw spectra in Fig. 13, and an example retrieval of SO spectra in given in Fig. 12, showing how the new ILS formulation is able to fit the SO spectra better. The ILS determined for order 140 was used successfully on nearby diffraction orders, particularly for retrievals of HCl (orders 127-130) and the many isolated lines of low altitude H 2 O . Knowledge of the ILS in these orders will also be used in future to further constrain the CH 4 detection limit (e.g. Knutsen et al., 2021), which has absorption lines in nearby orders also (typically orders 134 and 136).
Work is ongoing in the NOMAD team to define the ILS for all SO diffraction orders, from 119 to 195, ideally with as few coefficients as possible. Fig. 8. SO detector pixel illumination patterns, as measured during an in-flight line scan calibration. The spacecraft is slewed so that the FOV of each channel passes in and out of the Sun, while spectra are recorded by every pixel individually using a single AOTF frequency. A vertical column on the detector is chosen (here for spectral pixel 230) and the signal for each pixel is plotted. The region of the detector illuminated by radiation entering NOMAD is given by the full-width half-maximum, and the central detector row is defined as the centre of the illumination pattern. Gaps are observed as only 24 detector rows are read out at any one time, and so separate acquisitions are made to check the illumination on all rows.

Conclusions
For all instruments, aspects such as detector characterisation (e.g. bad pixels, slant determination), and spectral and radiometric calibration are essential. For spectrometers that perform solar occultations, additional characterisation is required: particularly pointing direction and detector illumination/saturation characterisation, as the FOV must remain fixed on the solar disk with all detector rows illuminated. Here we present the results from the first Martian year of calibration activities, explaining how the calibration observations were made, and how the resulting analyses have been monitored since the beginning of the mission to ensure that the channel remains well calibrated throughout. An accompanying paper, part 2, addresses similar aspects for LNO, the other infrared channel in NOMAD (Thomas et al., 2021, this issue).
We describe the procedure for determining the boresight pointing direction, by slewing the spacecraft around the solar disk and observing the illumination pattern on the detector rows. We also use this illumination pattern to determine the centre and edges of the region on the detector where the signal is the highest, so that only these rows are readout during solar occultations. The integration time at which the detector saturates was also determined for all diffraction orders; from this an optimal integration time was chosen. The bad detector pixels have been identified, first from ground calibration and subsequently from inflight calibrations and solar occultation observations. These continue to be monitored, with additional bad pixels added as they appear. Finally, the instrument line shape has been empirically fit as a function of pixel, showing that the ILS varies across the detector, and that when this variation is taken into account there is a better match between the forward model (simulated) spectra and the observations made by the SO channel.
Calibration is always ongoing process: the initial laboratory measurements were crucial to understanding basic aspects of the instrument, such as detector row selection, AOTF frequencies, which diffraction orders to select for different molecules, etc. These results were then used to define the initial observational parameters and plan further calibration observations, which were analysed to refine future observations, and so forth. The aim of some calibrations is to find and refine the best functions Fig. 10. SO bad pixel map for detector lines 108 to 144, prior to the start of the nominal science phase. The colour indicates the linearity (white is less linear, black is more linear, red is very non-linear or where the gradient is abnormal). The bad pixels stand out in red, while the detector manufacturing pattern is visible in the background values. The discontinuity at row 120 is due to two overlapping measurements taken at different times, when NOMAD had a slightly different temperature.  . 134 and 168), the retrievals were checked for self-consistency. The ILS derived here consists of a large primary Gaussian and a smaller secondary Gaussian function, and is effectively a single Gaussian across half the detector (pixels 0-160; Fig. 13). Uncertainties in the ILS can introduce systematic biases to the retrieval forward model and retrieved volume mixing ratios; this effect is particularly significant where atmospheric lines are saturated, as large changes in abundances exhibit only small changes in the spectra. One particular advantage of the SO channel is that multiple diffraction orders can be measured quasisimultaneously, so direct comparisons can be made between spectra containing saturated and non-saturated lines of the same molecule. Such consistency checks, selection of non-saturated lines, and the use of a simplified ILS formulation in all previous studies reduced systematic biases; better knowledge of the ILS improves retrieval accuracy over a wider range of saturation levels and therefore wider altitude ranges. Previous detection limit studies using SO spectra (e.g. Korablev et al., 2019;Knutsen et al., 2021) are largely unaffected by calibration, and for many diffraction orders the NOMAD team is confident of our retrievals. H 2 O, HDO and HCl, for example, will be accurate to within the retrieval error presented in the various publications (e.g. Aoki et al., 2019;Aoki et al., 2021;Liuzzi et al., 2020;Vandaele et al., 2019;Villanueva et al., 2021 etc.). The diffraction orders >185, e.g. where CO lines are present, are currently more difficult to calibrate, but improvements continue to be made, to be addressed by future publications by members of the NOMAD team and the scientific community.
The AOTF, blaze and ILS functions are occasionally refined, and new ways to parameterise the functions are explored as the SO channel continues to make more science and calibration observations, and effects   such as instrument temperature variations will be better accounted for by analysing repeated measurements taken at different temperatures. With the AOTF, blaze  and ILS (this work) functions now defined, and temperature-induced shifts in the spectral calibration (this work) and AOTF centre  now available, there is sufficient calibration knowledge available for members of the scientific community to run accurate retrievals on the SO dataset. The other aim of calibrations is to monitor the instrument and adapt to changesfor example if new bad pixels appear in the spectra or if the boresight pointing vector changes over time. A good example of this is shown in Fig. 6: it appears that detector bin 3 (red points) spectra have a lower relative signal in 2021, which indicates that the boresight has moved slightly. The boresight pointing vector has now been updated to improve future solar occultations. It is, therefore, essential that regular calibration observations are made, both to improve our knowledge of the instrument and to adapt to changes throughout the mission.
Lessons learnt during the NOMAD mission will also benefit future missions, in the same way that NOMAD has benefitted from the SOIR instrument. The VenSpec-H instrument, recently selected for launch in the early 2030s to Venus onboard ESA's EnVision mission, will be a highresolution spectrometer based on the SO/LNO channels of NOMAD, but adapted for detection of SO 2 , H 2 O and HDO gases above and below the clouds in the atmosphere of Venus.

Data availability
At the time of writing, SO occultation and UVIS occultation and nadir calibrated datasets are available on the ESA Planetary Science Archive (PSA; Besse et al., 2018) at https://psa.esa.int/for all data since the beginning of the nominal science mission (21 st April 2018) up to 2020, with more recent data delivered regularly. LNO, UVIS limb, and calibration datasets for all channels are under preparation and are expected to be released to the public soon. The peer-reviewed EAICD (experiment-to-archive interface document), written by the lead author of this work, is available on the ESA PSA and describes the data archived there in much more detail.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.