1 Introduction

The Upper Thermosphere (U-T) is a region within the Ionosphere stretching from roughly 300–500 km. The U-T consists of a mixture of ionized and neutral particles, which are mainly Oxygen (O) and electrons (e). Atomic and molecular Nitrogen (N & N2), molecular Oxygen (O2) and Nitric Oxide (NO), are also present but in much lower abundancies, and their density decrease with increasing altitude [1]. Solar photons (hv) are the main source of O ionisation above 150 km via the reaction

$$O + hv \to O^{ + } + e^{ - }$$
(1)

so O+ is only created in the sunlit side of the U-T. The loss rate of O+ increases by a factor of two during solar maximum [2]. The other ion states are mainly created by collisional-ionisation which acts as a loss mechanism for O+ [1]. The energy provided by hv generally exceeds what is required for ionisation, so the released photoelectrons initially have more energy than their ambient counterparts. This state of the gas is short-lived however, as photoelectrons subsequently lose their energy in elastic collisions with the ambient electrons [2]. This heat transfer is so significant it raises the electron temperature well above that of the ions. At a mid-latitude dayside orbit during solar minimum, typical temperatures are ~ 1000 K for the ions and ~ 2400 K for the electrons [3, 4]. In the same region at night, ion and electron temperatures drop to ~ 650 K [4]. Ion bulk velocities at a height of 400 km range from 10 m/s at low latitudes and up to 800 m/s at high latitudes [5]. These drift velocities fluctuate with local time and solar and geomagnetic activity [6, 7].

Spacecraft Charging (SCh) is a process whereby a spacecraft charges to a negative or positive electric potential as a result of being immersed in a plasma and exposed to radiation. Space plasmas consist of free charged particles [8, 9], which accumulate on the surface of the spacecraft as it transits in space. In doing so, a potential difference forms and, depending on the polarity of the potential, ambient particles are either repelled or attracted to the spacecraft surface [8, 10]. The potential continues to change until all currents flowing onto and off the spacecraft are equal, in accordance with Kirchhoff’s current law. The law states that for every node in equilibrium, the sum of all incoming currents must equal the sum of all outgoing currents [8]. In SCh, Kirchhoff’s Law is represented by the current balance equation

$$I_{e\left( \phi \right)} - I_{s\left( \phi \right)} - I_{b\left( \phi \right)} - I_{ph\left( \phi \right)} - I_{i\left( \phi \right)} = 0$$
(2)

where Ie is the incoming current of ambient electrons, Ii is the incoming current of ambient ions, Is is outgoing current of secondary electrons, Ib is the outgoing current due to backscattered electron, Iph is the outgoing photo-electron current and,\(\upphi\) is the spacecraft electric potential. When equilibrium is reached, \(\upphi\) is a value that enables all the currents in Eq. (2) = 0. SCh is also a function of the size and shape of the spacecraft as well as its materials, capacitance, reflectivity and electrical design [8, 10].

In the mid to low latitudes of the U-T, the plasma regime is denser and cooler than the poles or in the Magnetosphere. Electron temperatures do not exceed 3000 K and densities are < 3e + 11 m−3. At such low energies, the electrons do not have enough energy to cause any backscattered or secondary electrons [11]. This means that the ambient electrons dominate the current balance Eq. (2) and the other currents can be largely neglected. The temperature and density characteristics also means that surface potentials are unlikely to exceed − 1 V [8]. That said, any potential,\(\upphi\) ≠ 0, can affect on-board instrumentation, such as ion spectrometers, by shifting the energy distribution of the particles to be measured [12]. This can lead to inaccuracies when calculating plasma parameters [13, 14], especially if the energy of the species to be measured is low (< 10 eV). From a science perspective, SCh can adversely affect the overall mission return. Though studied extensively for large-class missions, the impact of SCh on scientific small satellite missions remains virtually unknown.

In this paper, we present a set of diurnal spacecraft potentials derived from our spacecraft charging simulations. Then, we introduce our analysis of in-flight data from the Phoenix INMS, which includes correcting for SCh effects. We go on to calculate U-T densities, bulk speeds and temperatures using a least-squares fitting routine. Finally, we quantify the impact of SCh on plasma measurements by comparing corrected and uncorrected data.

2 Instrumentation and techniques

The Phoenix is a 2U CubeSat that launched from the International Space Station in 2017. Its payload was an Ion Neutral Mass Spectrometer (INMS) designed and built by the Mullard Space Science Laboratory, UCL [15]. The INMS on Phoenix was operational for ~ 40 days, returning data from an orbital inclination of 52° and an altitude of 360–380 km, placing it firmly in the U-T. The CubeSat bus is 10 × 10 × 20 cm and the INMS has a diameter of 8 cm and a depth of 3.3 cm. The INMS is a cylindrical electrostatic analyser that is designed to measure O, N, N2, O2 and NO in the U-T [15]. Figure 1 shows the exterior of the INMS as well as an internal schematic.

Fig. 1
figure 1

The Ion Neutral Mass Spectrometer. Left: A photo of the 1U instrument with apertures in white. Note these are illustrative and not to scale. Right: Schematic of internal functionality. Particles travel through a 5° aperture to the detector. When measuring ions, the filter and ionizer are switched off and the particles are electrostatically steered by the curved hemispheres in the analyzer chamber. Ions then ‘hit’ the detector and are registered as counts

The INMS can detect both ions and neutrals, although only the former were captured on Phoenix. Ions enter the INMS through the 5° aperture and travel unaffected through the ion filter and ionizer chambers. In the analyzer, they are electrostatically steered by the blue and red semi-circles, known as hemispheres, which have a voltage applied to them. To capture the full range of velocities in a particle distribution, the hemispherical voltage V is logarithmically increased every 10–20 ms. As there are 16 energy bins in the INMS, it takes 160–320 ms to perform a full sweep. A single sweep captures the entire O+ particle distribution as well as parts of N+, N2+, NO+ and O2+. The detector is a channel electron multiplier, which is optimised for low energy ions (< 50 eV). Phoenix operated in a y-thompson spin, which means that it was spinning on its pitch axis. This action means that we do not expect any motion in the yaw axis. The consequence of this is that we cannot measure a cross drift component which we expect to be present. Future work could take advantage of the spin to measure the vertical component of the ion drift.

2.1 Spacecraft model

To understand the impact of SCh on plasma measurements, we perform several SCh simulations. To enable this, we needed to first create a model of the spacecraft. The right panel of Fig. 2 shows the Phoenix and INMS in GMSH [16], a 3D finite element generator with meshing capabilities. The model adopts the same dimensions described above and each of the surfaces (Bus, INMS, Solar Panels, Aperture) are assigned to a different material in accordance with Phoenix specifications. The volume of the simulation is 40 × 40 × 60 cm, which is large enough to model the plasma dynamics, but small enough to avoid incurring a high computational cost.

Fig. 2
figure 2

The Phoenix CubeSat with INMS. Left: An artist impression of the real spacecraft. Right: A digital model of Phoenix in GMSH

2.2 Spacecraft charging simulations

The Spacecraft Plasma Interaction Software (SPIS) [17] is a specialist software for examining SCh and spacecraft-plasma interactions. At its core, SPIS iteratively solves the Poisson equation to determine the electric potential around the spacecraft

$$\nabla^{2} \phi = - \frac{\rho }{{\varepsilon_{0} }},$$
(3)

where \(\upphi\) is the electric potential, \(\rho\) is space charge density and \({\epsilon }_{0}\) is the permittivity of free space. SPIS numerically solves Eq. (3) in conjunction with a particle-in-cell (PIC) code to determine the self-consistent motion of the charged plasma particles in the environment of the spacecraft. The PIC code discretises the integration volume, and real particles are represented by virtual super-particles which are integrated according to the equations of motion for charged particles under action of the Lorentz force [18]. The use of super particles has huge computational benefits and we use 10–20 particles per cell. Electrons follow a Boltzmann fluid approach and ions adopt the PIC method. Ions must be modelled using PIC because of the mesothermal flow ordering:

$$v_{i} < v_{sc} < v_{e}$$
(4)

where vi is the typical ion velocity, vsc is the spacecraft velocity and ve is the typical electron velocity. In this regime, ions only have access to the ram side of the spacecraft. This flow creates a plasma wake in which there are no ions in the region immediately downstream of the spacecraft. This situation requires a kinetic approach for ions which can be achieved with the PIC method. Figure 3 illustrates the other steps in a SCh simulation, where Eq. (3) is solved in box #2 and the PIC method is applied in box #3.

Fig. 3
figure 3

A simplified overview of how SPIS works. User input is required for box #1, but the other steps can be automated. Adapted from [17]

We obtain the initial plasma temperatures and densities for box #1 from the Ionospheric Reference International (IRI) model. IRI is a global empirical model of the ionosphere, providing plasma parameters based on specific times and locations [3]. IRI acts as the primary benchmark for comparing our findings as we show in the “Results and discussion” section of this paper. Issues with the onboard computer (OBC) mean that utc, latitude, longitude and altitude values carry large uncertainties and are therefore not usable in the analysis. Subsequently, the density and temperature values we use in the simulations are averages. Table 1 shows the SPIS simulation parameters for Phoenix and its INMS.

Table 1 SPIS simulation parameters

The spacecraft velocity is set to 7.7 km/s and we calculated this with a two-line element method [19]. Ions are set to O+ which is the most abundant species in the U-T. Lastly, we set up the INMS as a virtual particle detector in SPIS. This function allows us to see the direct impact of spacecraft charging on the O+ distributions in addition to outputting an overall surface potential. It also allows for a like-for-like comparison between simulations and in-flight data, which is presented in the “Results and discussions” section.

2.3 Correction factors

The INMS returns ion counts as a function of sampling energy. To derive plasma parameters, we first link the hemispherical voltage, V, with the energy of the ions

$$E_{i} = kV$$
(5)

where Ei is the transmitted energy, and k is the proportionality constant. Velocity is calculated by

$$v_{i} = \sqrt {\frac{{2E_{i} }}{m}}$$
(6)

where m is the mass of the particle. Next, counts in each energy range are converted into phase space density (PSD)

$$f\left( v \right) = \frac{2N}{{t_{a} v_{i}^{4} G_{e} }}$$
(7)

where N is the ion count from the INMS, ta is the integration time per energy step (10 ms for the data analysed) and Ge is the instrument’s geometric factor equal to 6 × 10–4 cm2 sr eV/eV. A surface potential accelerates (decelerates) ions before they reach the INMS, effectively shifting the particle distribution into a higher (lower) energy bin [12]. When \({\upphi }_{sc}\) is known, it can be corrected for by re-shifting the distribution in energy space. A simple way to do this is to re-calculate the energy spectra with \({\upphi }_{sc}\) factored in [14]

$$E_{sc} = E_{i} + q\phi_{sc}$$
(8)

where q is the particle charge, and \({\upphi }_{sc}\) is the spacecraft potential provided by SPIS. Esc is then substituted into Eq. (6) to yield new velocity value, vs. This final step is crucial because vs is used in Maxwell–Boltzmann fitting routine described by Eq. (10) and its corresponding section. The transformation in Eq. (8) maps the PSD from the location of the measurement at the INMS to a location outside of the electrostatic sheath. This is in accordance with Liouville’s theorem which states that PSD is conserved along individual particle trajectories in phase space [14]. Liouville’s theorem only holds if collisions are negligible. The collisional mean-free path of particles in the U-T is large ~ 100 m [20], whereas we calculate the Debye length to be very small \({\uplambda }_{D}\) ~ 1 cm. This means Liouville’s theorem can be applied, but only at lengths up to the size of the electrostatic sheath [14], which is generally a few Debye lengths in size.

3 Results and discussion

3.1 SPIS

In Fig. 4, the outputs from our SPIS simulations are shown. In the dayside, the spacecraft surface potentials reach − 0.64 V, whereas at night they are − 0.19 V. Previous work has theorised and observed that spacecraft potentials may be negative both in sunlight and eclipse if the plasma density is sufficiently high [21,22,23]; however, our work goes further by observing a more negative potential in the dayside. This is part explained by the three-fold increase in the electron temperature during the day [3, 4, 8], and the knowledge that spacecraft charging is directly proportional to the electron temperature [8, 10]. The other reason is that the plasma density is 42% higher during the day (see Table 1), which means a significantly higher ambient electron current in Eq. (2). Therefore, a greater negative potential is required for the current balance to equal 0. As part of our analysis, we run several simulations with the sun in different positions with respect to the spacecraft. Whilst in the dayside, Phoenix experiences varying levels of sunlight on the surface, which means that the outward photoemission current varies. At a minimum, only the ram (or rear) direction is exposed to sunlight, which represents 0.1 m2 or 10% of the overall surface. At a maximum, the ram (or rear) and two sides are in sunlight, which represents 0.5 m2 or 50% of the overall surface. Despite this large variation, the surface potential only decreases by 0.03 eV from minimum to maximum, which is < 5% of the overall dayside potential. This is further evidence that the photoelectron current is negligible, as reported by Hastings [11].

Fig. 4
figure 4

SPIS simulations of Phoenix at day and night. Left: During the day potentials reach −0.64 V, but during the night they do not exceed −0.2 V. The white arrow indicates the flight direction. Right: Ions travel through the potential drop before reaching the aperture of the instrument, gaining kinetic energy as they do

The right panel of Fig. 4 shows a magnification of the INMS and its aperture, allowing for a closer examination of the sheath thickness. The figure shows that the sheath is approximately 3 × greater during the day than it is at night. Liouville’s theorem is only expected to hold at distances equivalent to the electrostatic sheath [14], therefore any ions beyond this point cannot be accurately shifted in phase space according to Eq. (8). This means that they must be removed from the analysis. Lastly, Fig. 4 also shows that ambient ions travel through a negative potential [qV] drop on their trajectory to the aperture of the INMS. In doing so, they gain kinetic energy [E] \(\to\) [E + qV] and the distribution shifts into a higher energy bin. Because V is smaller at night so too is the energy shift.

3.2 Inflight data

In keeping with the SPIS simulations, we also split the in-flight data based on diurnality. Owing to the issues with the OBC, we use the surface thermal monitors, which measure the spacecraft temperature at the time the INMS captures ions, to determine day and night. Figure 5 shows the spacecraft surface temperatures across seven selected dates. Those captured in May 2018 are designated as being in the dayside, whereas those in June are in the nightside (Fig.  4).

Fig. 5
figure 5

Surface thermal monitor data across the seven dates that make up the dayside and nightside split. “t1” and “t2” are bus sensors, and the sensor labelled as “inms” is within the INMS housing. Note the specific time is not known owing to issues with the OBC

The dayside temperature has a wider range because one side of the spacecraft is sunlit, whilst the other is in the shade, even though the whole spacecraft remains in the dayside. Figure 6 shows the number of counts per second captured on these dates as a function of energy. A full sweep consists of 16 bins, and therefore takes 160-320 ms.

Fig. 6
figure 6

Heatmap of INMS count rates across seven dates. The top four dates are in the dayside, the bottom 3 dates are in the nightside

The dates above the blue line are in the dayside and those below are in the nightside. The first observation is that the dayside count rates are considerably higher than the nightside count rates. This suggests that the O+ density is greater during the day than it is at night, which is in line with existing literature, as discussed in the “Introduction” [1, 24]. Secondly, in the nightside dates around 9 eV, there is a second cluster of count rates that are separate from the others. We hypothesise that this is a second species and for the given energy range, it could be NO+ or N2+. The former is more likely, but neither were expected at this altitude. It is possible that a second species is also present in the dayside, but it is less obvious because the corresponding energy range is covered by the increased O+ signal. SCh could also shift it beyond the range of the INMS (> 12 eV), although our SPIS simulations do not confirm this. The final observation from Fig. 6 is the location of the highest count rates with respect to energy. In all the dayside values the highest (peak) count rates are in the 5.3 eV energy bin, whereas at night, they peak at either 4.3 eV or 4.8 eV, resulting in a 1 eV range. To understand where we expect the O+ peak to be, we adopt a modified kinetic equation which incorporates bulk speed and spacecraft charging [25]

$$E = \frac{1}{2}m\left( {u_{sc} \pm u_{w} } \right)^{2} + q\phi_{sc}$$
(9)

where usc is the spacecraft velocity and uw is the ion bulk speed. Particles which travel in the opposite direction to the spacecraft are classified as a headwind and usc + uw applies. Those which travel in the same direction as the spacecraft are termed a tailwind and usc—uw applies. Our analysis places the uw term at between 60 and 120 m/s, which is enough to shift the peak energy. This range was calculated using the Horizonal Wind Model (HWM) which is an empirical and in-situ U-T model that computes the horizontal wind vector fields from sea level to around 450 km [26, 27]. In the mid-low latitudes, tidal forcing is more dominant than the electrodynamical forces. As the neutral to ion ratio is roughly 1000:1 at Phoenix’s operational altitudes, the ions collide and thermalise with the neutral particles, leading to approximately equal flow velocities. Therefore, we use the HWM as an indicator for the ion drifts which we measure with the INMS. To quantify the contributions to the 1 eV variation, we first assume there is no spacecraft potential \({\upphi }_{sc}=\) 0. We then factor in the spacecraft velocity and apply 120 m/s to Eq. (9). This results in O + energies of 5.08 eV (headwind) and 4.78 eV (tailwind). Applying the nightside potential of − 0.2 V shifts these energies to 5.28 eV and 4.98 eV. For the dayside, the shifted values are 5.74 eV and 5.44 eV. Therefore, the 1 eV observed could be caused by a dayside potential with a strong headwind, or by a nightside potential with a strong tailwind. Unfortunately, issues with the OBC means we cannot verify this, but future work will aim to do so.

The spinning of the spacecraft could also explain the variance. The simulations neglect the spinning of the spacecraft about its pitch axis, known as a y-Thompson spin. This spin can decrease the potential at the spacecraft centre, and increase it at the extremities [28], which is the location of the INMS. In that case, the energy shift could be slightly greater than the simulations suggest.

Lastly, we neglect the effect of the magnetic field. Although the electron gyro-radius is comparable to the CubeSat ~ 3 cm to 10 cm, SPIS simulations including a realistic value of the magnetic field reveal that it has little effect on the surface potential. We found that the spacecraft potentials increase slightly from − 0.669 V to − 0.665 V in presence of a magnetic field, and an increase has been reported in previous studies [29,30,31]. That said, such an increase does not noticeably affect the derivation of the ion moments.

3.3 Correcting for spacecraft charging

Once the spacecraft potential is known, the distribution can be corrected with the following procedure. First, the ion counts are converted to phase space density with Eq. (7). SCh corrections are applied with Eq. (8) and the particle distribution is shifted in accordance with Liouville’s theorem. The left panel of Fig. 7 illustrates the INMS data with and without SCh corrections, during day and night. Each curve is an aggregation of the different dates, so the dayside curve consists of four dates and the nightside of 3. The darker line in the middle of the aggregated data is the median value for each energy, and the shaded regions represents a confidence interval of 90%. The confidence is automatically calculated by the plotting routine based on the aggregated data. Confidence appears to decrease in higher energy ranges, but this is a feature of logarithmic statistics in higher energy ranges.

Fig. 7
figure 7

Left: INMS observations split into dayside (purple) and nightside (orange) with (solid) and without (dotted) SCh corrections. The darker line denotes the median of the values and the shaded areas are an automatically generated confidence interval set to 90%. Right: SPIS simulations of dayside and nightside distribution functions at the instrument (SCh applied) and beyond the sheath (No SCh). The black dotted line represents 4.9 eV, calculated as the energy for O + using Eq. (9)

The right panel also shows the distribution during the day and night, but this is a simulated output from SPIS using the virtual particle detector function. The vertical axis has been removed because it is in arbitrary units. The right panel represents the effects in a slightly different way to the left. Instead of viewing a distribution as corrected or uncorrected, SPIS calculates a distribution at the instrument and at the simulation boundary. Therefore, it shows what the distribution would be without the presence of SCh. Correction yes = Outside Sheath and correction no = INMS.

The dayside shift is greater than the nightside shift in both the INMS data and the simulation. This is because SCh is greater during the day (see Fig. 4), so the peak shifts into a higher energy bin [32]. The vertical black dotted line at 4.9 eV in the right panel of Fig. 7 is the peak energy of O + according to Eq. (9) with uw = 0. As seen, the outside sheath peak and dayside / nightside O+ positions match up exactly. There is no black dotted line in the left panel because the INMS data also include a wind-vector and instrument noise. As a result, we expect some misalignment between the dayside and nightside data; however, this misalignment is lessened after SCh corrections. At this stage, the contribution of the wind vector cannot be accurately factored in because it can contribute to a higher and lower energy shift (see Eq. (9)).

3.4 Fitting routine

A key science objective for Phoenix is to derive plasma parameters from the U-T, which includes the density, bulk speed and temperature. To do this, we apply a Levenberg-Marquadt least squares fitting routine [33] to the phase space density, and the assumption that the particles follow Maxwell–Boltzmann, or Maxwellian, distribution. The Maxwellian is represented by

$$f\left( {v_{s} } \right) = n\left( {\frac{m}{{2\pi K_{b} T}}} \right)^{3/2} \exp \left( { - \frac{{m\left( {v_{s} - v_{0} } \right)^{2} }}{{2K_{b} T}}} \right)$$
(10)

where vs is the corrected velocity described in the correction factors section, Kb is Boltzmann’s Constant, and n, v0 and T are the plasma density, bulk velocity and temperature respectively. The Levenberg–Marquardt algorithm is specifically designed to solve non-linear curve fitting problems [33, 34]. It does this by minimising the sum of the squares of the residuals between a model function and a set of data points which are the Maxwellian and INMS data, respectively. We use the LMFIT module for Python to achieve the least-squares fit [35]. The method requires free parameters to optimise the fit, which we assign to n, v0 and T. The quality of the fit, and therefore the credibility of the plasma parameters, is quantitatively assessed with the reduced chi squared \({\upchi }_{v}^{2}\) metric

$$\chi_{v}^{2} = \mathop \sum \limits_{i}^{N} r_{i}^{2} / \left( {N - N_{v} } \right)$$
(11)

where ri is the residual error after the least-squares optimisation, N is the number of data points, and Nv is the number of variable parameters. A smaller \({\chi }_{v}^{2}\) indicates a better fit and we reject any fits where \({\chi }_{v}^{2} > 0.1\). To simplify the model and to improve convergence times, we constrain the possible values of n, T, v0, by placing upper and lower bounds. This is shown in Table 2.

Table 2 Initial parameters and constraints for LMFIT routine

Figure 8 illustrates the fitting routine applied to the four dates that make up the dayside group. The final optimised parameters are listed within the subplots. Any blue points which are not bound to the Maxwellian fit serve to illustrate that additional ions have been captured. In this energy range, we suspect the presence of a second species or a non-Maxwellian tail, which is discussed in more detail below

Fig. 8
figure 8

Maxwell–Boltzmann least squares fitting routine applied to dayside INMS data. The black curve is the Maxwellian described by Eq. (10) and the blue points are the PSD data from the Phoenix-INMS. The closer the alignment between the line and the dots, the better the fit. The fit is quantitatively described in Table 2

Figure 8 shows that on the 19th, 21st and 22nd of May 2018, the O + appears to follow a Maxwellian distribution across the entire measured energy range. However, on the 25th, the INMS captures some additional points in the 8–10 eV region, which could be the presence of either NO+ or N2+. At present, this cannot be investigated further owing to the small number of ion counts. Pitch corresponds to the spacecraft pitch angle when the distribution was captured.

A pitch = 0 indicates the Phoenix is facing the horizon, pitch < 0 = downward pointing and, pitch > 0 = upward pointing. All four dates capture peak distribution whilst facing downward, which could suggest a sky-pointing vertical wind component. All dayside densities align with those reported by Huba and IRI [3, 24], and the error in the values varies from 20 to 26% (See Table 3). Our HWM analysis reveals that bulk speeds are between 60 and 120 m/s, and the parameterised v0 is greater than this across all dates. The fit error in these estimates however is excellent at ±  < 1%.

Temperatures across all four dates are lower than the ~ 1000 K reported by Otsuka and IRI [3, 4]. The temperature error estimation is ±  < 14% for all dates. Figure 9 applies the same fitting routine but to the three nightside dates.

Fig. 9
figure 9

Maxwell–Boltzmann least squares fitting routine applied to nightside INMS data

Firstly, the quality of the fits is generally poorer across the nightside dates as indicated by Table 3. It is also clear that the consistency and distribution of points differs from the dayside distributions. The 20th of June reveals a distribution that is increasingly non-Maxwellian in the high-energy tail (above 6 eV). This date exhibits the characteristics of a suprathermal tail and therefore might be better described by a kappa distribution [36]. Kappa distributions have been applied to a wide range of plasma environments, including the solar wind and magnetosphere [37], because they often better represent the collisionless nature of space plasmas [38]. Suprathermal deviations from the Maxwellian generally exist in low-density regimes or in the high-energy part of the PDF where collisions are rare [37]. It is also possible that the points around the 8–10 eV represent an additional species. Similarly to the dayside two of the three dates exhibit a sky pointing component to the bulk speed as the spacecraft pitch angle is < 0. Like the dayside data, all densities are within an order of magnitude of the benchmark data but carry lower confidence values (see Table 3). Nightside bulk speed confidence is also very high at ±  < 1%. Lastly, like the dayside data, all temperatures are below the expected range outlined in Table 1 and the routine estimates all errors to be < 25%. The lower confidence in the parameterised density and temperature likely results from the lower number of points, N, to fit from.

Table 3 Density errors and reduced chi squared values from the Maxwell–Boltzmann fitting routine

The final stage is to quantify the impact of SCh on the fitting routine. Figure 10 illustrates the density, bulk speed and temperature values with and without the SCh corrections (see Fig. 7). The left-hand column shows the dayside values, and the right-hand column shows the nightside values. The black dotted lines denotes the expected range: density and temperature is informed by [3,4,5, 24], and bulk speeds from our own HWM analysis and [5].

Fig. 10
figure 10

The contribution of spacecraft charging on the fitting routine. Left: Dayside data. Right: Nightside data. Black dotted lines indicate the expected ranges based on previous work [1, 3, 4, 24]. Future work will aim to compare with specific dates from IRI

The dayside densities are higher than expected and the deviation increases with corrections. The same pattern exists in the nightside, but the parameterised density is lower to start with, so the correction improves the measurement. Table 3 shows that some of the density values carry moderate error values (> 40%), so it is possible that the values are much closer (or even further) to the benchmark. With SCh corrections, all the bulk speeds are closer to the expected range of 60–120 m/s. One explanation could be that the surface potential on Phoenix was greater than in the SPIS simulations. Knudsen et al. [39] apply a − 1 V charging correction to the Electric Field Instrument (EFI) payload on SWARM, which operates ~ 80 km higher than Phoenix at ~ 460 km and is in a near-polar orbit. Our own analysis of the SWARM EFI data reveals that the surface potentials can reach up to − 2 V. Applying a − 1 V correction to the Phoenix data results in negative bulk speeds, which suggests the correction factor is too high. Appling a − 0.75 V correction results in bulk speeds that are 125 m/s, 50 m/s and 98 m/s for the 19th, 21st and 22nd of May respectively, which is in better agreement with our HWM analysis. Increasing the charging correction has no impact on the density or temperature. All temperatures are also closer to the benchmark when charging corrections are applied, but the routine seems to underestimate across all dates. However, when Phoenix temperatures are compared with EFI data from SWARM, it reveals that temperatures may be lower than the values provided by IRI (Fig. 11).

Fig. 11
figure 11

Comparison between SWARM and Phoenix, and whether they are in the same or opposite hemisphere

When both missions are in the same hemisphere, the comparison is more reliable, because the plasma conditions are more similar for both missions. As seen, the temperatures on the 19th, 22nd and 25th are similar across both missions and all are below the 1000 K low benchmark provided by IRI. This will be explored further when data from the SOAR CubeSat mission becomes available.

One of the fundamental limitations of using the INMS to derive plasma parameters is its ram-only capture mode, which means that the data is only recorded in one dimension. For comparison, the Electron Analyser System (EAS) on Solar Orbiter samples the full three-dimensional velocity space [40]. This increased dimensionality and a larger effective area—which results in better statistics—equates to more accurate fitting results. There is however a trade-off in terms of increased computational and mathematical complexity. A possible solution could be to utilise the Phoenix’s rotation, or y-Thompson spin, to increase the dimensionality. A parallel angle could be selected to represent data captured at a pitch angle of 0° and an oblique angle could be used for data at every other angle [41]. Although this approach will still result in a smaller coverage of velocity space than in the full 3D geometry, it would double the dimensionality and we expect that this would improve the accuracy of our fitted parameters. That said, more dimensions equates to longer sampling time and, depending on the plasma scales, this could actually lead to less accurate fitting. This method is currently being explored and may feature in future works.

Another influence on the parameters is whether to fit in linear or logarithmic space. Our analysis reveals that the former improves the bulk speeds with respect to the benchmark, whereas the latter improves the densities and temperatures. We chose to fit in log space because it better represents the phase space density which is distributed over multiple orders of magnitude. Wellbrock et al. [38] present an alternative method to derive the density of negative ions (at Titan) by dividing the counts by the spacecraft velocity and instrument area [42]

$$n = \frac{c}{{A\epsilon u_{sc} }}$$
(12)

where n is the ion density, c is the number of counts, A is the effective area of the instrument, \({\varvec{\upepsilon}}\) is the detector efficiency, and \({u}_{sc}\) is the spacecraft velocity. In a first attempt to apply Wellbrock’s method, we calculate densities in the range of 1e + 9 m−3, which are lower than we predicted. We anticipate that this could be due to inaccurate A or \({\varvec{\upepsilon}}\) values and this is currently under investigation.

4 Conclusion

In this paper, we present a method for quantifying the impact of spacecraft charging on thermospheric plasma measurements. We observe that a 2U CubeSat in the upper thermosphere charges to a negative surface potential in both the dayside and nightside. Although negative surface potentials in the ionosphere have been reported before, we simulate dayside potentials which are more negative than those in the nightside. This is counter to other charging mechanisms, whereby the presence of a photoelectric current leads to a positive surface potential in the dayside. We both simulate this condition and observe it with in-flight data, providing a strong case for the existence of diurnally invariant negative charging. The reason for this is a three-fold increase in electron temperatures and a > 40% increase in densities during the day when compared to the night. All of which means a greater surface potential is required to balance the increased ambient electron current.

We factor out the effects of spacecraft charging by correcting the phase-space density for the spacecraft electric potential. To do this, we assume that phase-space diffusion is not occurring within the electrostatic sheath and therefore phase space is conserved in accordance with Liouville’s theorem. We neglect ions whose trajectory starts beyond the sheath. A Levenberg–Marquardt least squares fitting routine is employed to derive the plasma parameters. Fitted densities are within an order of magnitude of the expected benchmark, day: 1e + 11 m−3 and night: 7e + 10 m−3 but all carry errors of at least 20%. All the parameterised bulk speeds are above the expected range of 60–120 m/s, but are closer to this benchmark with corrections applied. It is possible that the surface potentials are more negative than simulated, which would lead to bulk speeds that are closer to the IRI benchmark. Temperatures are below the empirical model but are in-line with in-situ data from SWARM. All temperatures are improved with charging factored in. Density is primarily compared with the International Reference Ionosphere model, temperature with IRI plus SWARM data, and bulk speeds with the Horizontal Wind Model. One of the key limitations of the Ion Neutral Mass Spectrometer is its ram-only capture mode and we are working on methods to improve its dimensionality.

To the best of our knowledge, this is the first-time ion moments have been successfully derived with a CubeSat-based spectrometer. At the time of writing, a new CubeSat mission called SOAR has launched and is currently in the commissioning phase. SOAR carries the same INMS as Phoenix, but with an additional time-of-flight capability. SOAR will be inserted into the same orbit as Phoenix so it provides an excellent opportunity to further validate the findings and to continue the study of the upper thermosphere.