The program extracts swarm electron/plasma density information from Level1b CDF files of the swarm satellites. You should enter the name of the path to the folder/directory in your computer (or external drive) containing the swarm CDF files in line 1 of the program, and indicate the path to the folder/directory where you want the outputs to be stored in line 2 of the program. Then run the program.
The program extracts the electron/plasma density data from the swarm CDF files and stores them as tables (in text files) in the folder which you have indicated in line 2 of the program.
The program also performs data cleaning by removing data where the Ne Flags are greater than 20, or where the LP Flags are equal to 9, or where the electron density values are negative. Swarm electron density measurements when the Ne Flags are greater than 20 correspond to estimates from low gain probe and the electron density estimates probably have larger random errors than the nominal high gain probes, while measurements when the LP Flags are equal to 9 correspond to measurements from duplicated harmonic mode because of on-going sweep, it is recommended to discard these duplicate data (Nielsen, 2021).
The program also computes the altitude of the swarm satellites from the radius information contained in the CDF file data. The CDF file data contains radius information (rad) of the swarm satellites, which is the distance of the swarm satellites from the centre of the Earth. The program first computes the geoid heights (N) for the latitude and longitude positions of the swarm satellites using MATLAB’s geoidheight function (Mathworks, 2023a). It uses MATLAB’s geocradius function (Mathworks, 2023b) to estimate the radius (h) of the ellipsoid Earth at the given latitude positions of the satellites. The mean sea level (H) is computed by subtracting N from h. Finally, the satellite altitudes above mean sea level are obtained by subtracting H from rad.
Mathworks (2023a). Geoidheight, Retrieved 8 May 2023 from https://ch.mathworks.com/help/aerotbx/ug/geoidheight.html
Mathworks (2023b). Geocradius, Retrieved 8 May 2023 from https://ch.mathworks.com/help/aerotbx/ug/geocradius.html
Nielsen, J. B. (2021). Swarm Level 1b Product Definition, National Space Institute Technical University of Denmark, SW-RS-DSC-SY-0007, Issue 5.26. Retrieved 8 May 2023 from https://earth.esa.int/eogateway/documents/20142/37627/Swarm-Level-1b-Product-Definition-Specification.