CubeSat measurements of thermospheric plasma: spacecraft charging effects on a plasma analyzer

Spacecraft charging affects the accuracy of in-situ plasma measurements in space. We investigate the impact of spacecraft charging on upper thermospheric plasma measurements captured by a 2U CubeSat called Phoenix. Using the Spacecraft Plasma Interactions Software (SPIS), we simulate dayside surface potentials of − 0.6 V, and nightside potentials of − 0.2 V. We also observe this charging mechanism in the distribution function captured by the Ion and Neutral Mass Spectrometer (INMS) on-board Phoenix. Whilst negative charging in the dense ionosphere is known, the diurnal variation in density and temperature has resulted in dayside potentials that are smaller than at night. We apply charging corrections in accordance with Liouville’s theorem and employ a least-squares fitting routine to extract the plasma density, bulk speed, and temperature. Our routine returns densities that are within an order of magnitude of the benchmarks above, but they carry errors of at least 20%. All bulk speeds are greater than the expected range of 60–120 m/s and this could be due to insufficient charging corrections. Our parameterised ion temperatures are lower than our empirical benchmark but are in-line with other in-situ measurements. Temperatures are always improved when spacecraft charging corrections are applied. We mostly attribute the shortcomings of the findings to the ram-only capture mode of the INMS. Future work will improve the fitting routine and continue to cross-check with other in-flight data.


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 & N 2 ), molecular Oxygen (O 2 ) 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 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 collisionalionisation 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 where I e is the incoming current of ambient electrons, I i is the incoming current of ambient ions, I s is outgoing current of secondary electrons, I b is the outgoing current due to backscattered electron, I ph is the outgoing photo-electron current and,ϕ is the spacecraft electric potential. When equilibrium is reached, ϕ 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,ϕ ≠ 0, can affect onboard 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.

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, N 2 , O 2 and NO in the U-T [15]. Figure 1 shows the exterior of the INMS as well as an internal schematic.
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.

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.

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 where ϕ is the electric potential, is space charge density and 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: where v i is the typical ion velocity, v sc is the spacecraft velocity and v e 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.
We obtain the initial plasma temperatures and densities for box #1 from the Ionospheric Reference International   [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.
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.

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 where E i is the transmitted energy, and k is the proportionality constant. Velocity is calculated by where m is the mass of the particle. Next, counts in each energy range are converted into phase space density (PSD) where N is the ion count from the INMS, t a is the integration time per energy step (10 ms for the data analysed) and G e is the instrument's geometric factor equal to 6 × 10 -4 cm 2 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 ϕ 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 ϕ sc factored in [14] where q is the particle charge, and ϕ sc is the spacecraft potential provided by SPIS. E sc is then substituted into Eq. (6) to yield new velocity value, v s . This final step is crucial because v s 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 λ 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.

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 m 2 or 10% of the overall surface. At a maximum, the ram (or rear) and two sides are in sunlight, which represents 0.5 m 2 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]. 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] → [E + qV] and the distribution shifts into a higher energy bin. Because V is smaller at night so too is the energy shift.

Inflight data
In keeping with the SPIS simulations, we also split the inflight 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). 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.
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] where u sc is the spacecraft velocity and u w is the ion bulk speed. Particles which travel in the opposite direction to the spacecraft are classified as a headwind and u sc + u w applies. Those which travel in the same direction as the spacecraft are termed a tailwind and u sc-u w applies. Our analysis places the u w 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 ϕ 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 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 Fig. 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 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.

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.
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 u w = 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)).

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 where v s is the corrected velocity described in the correction factors section, K b is Boltzmann's Constant, and n, v 0 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, v 0 and T. The quality of the fit, and therefore the credibility of the plasma parameters, is quantitatively assessed with the reduced chi squared χ 2 v metric where r i is the residual error after the least-squares optimisation, N is the number of data points, and N v is the number of variable parameters. A smaller 2 v indicates a better fit and we reject any fits where 2 v > 0.1 . To simplify the model and to improve convergence times, we constrain the possible values of n, T, v 0 , by placing upper and lower bounds. This is shown in Table 2. 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,   Table 2 we suspect the presence of a second species or a non-Maxwellian tail, which is discussed in more detail below 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 v 0 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.
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. 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 Fig. 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 temperature is informed by [3][4][5]24], and bulk speeds from our own HWM analysis and [5].
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).
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] where n is the ion density, c is the number of counts, A is the effective area of the instrument, 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 values and this is currently under investigation.

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 (12) n = c A u sc Fig. 11 Comparison between SWARM and Phoenix, and whether they are in the same or opposite hemisphere 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 CubeSatbased spectrometer. At the time of writing, a new Cube-Sat 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.