Tools for analysing ion measurements from the Solar Wind Analyzer Proton and Alpha-Particle Sensor (SWA/PAS) instrument on Solar Orbiter. This repository implements a physics-informed Gaussian Mixture Model (GMM) pipeline for separating proton core, proton beam, and alpha-particle populations from 3D velocity distribution functions (VDFs), together with the code to generate a collared VDF based on the measurements.
If you find this repository useful, please consider giving it a ⭐.
Data includes: -swa-pas-3d, -swa-pas-vdf, -swa-pas-grnd-mom, -mag_srf
Or you can simply run the sunpy_soar_download.py. Just make sure you have set the time properly:
time_start
time_end
Inside the notebook, set
timeslice
Plot the VDF and visually determine the manual separation index:
dividing_idx
Run the code, it will save the results in a folder called (result/SO/yymmdd/hhmmss).
In the main function, set:
dt_seconds # resolution of PAS of the interval that you are studying
tstart
tend
Here, tstart should be the timeslice in GMM_Hao_Tutorial.ipynb. Make sure that the folder names match.
Use this if you are happy to sacrifice a bit accuracy and want to increase the speed of calculating.
Idea: To enable parallelisation while keeping temporal continuity, we process the time series in blocks (e.g. N = 15 slices ≈ 1 min at 4 s cadence).
- First timeslice is obtained via Hao_GMM_Tutorial.ipynb
- The next block of measurements, all use the results from Hao_GMM_Tutorial.ipynb as initial values.
- Take the average of this block's separation, and use it as initial value for the next block.
- Thus, blocks depend sequentially on each other, but slices within each block can be processed independently across multiple cores.
Set:
dt_seconds
tstart
tend
block_length
n_processes
We have offered some codes to easily get the timeseries data out of the GMM-separated results. The users can also write their own.
Get_tseries.py: Read the moments and concatenate them in a .csv file. Separation_plot.py: Plot the time_series and the separation results for each timeslice. Make_movie.py: Take the figures plotted by Separation_plot.py, and make a movie.
Please use generate_ALPS_input_collared.py
We get all the measured points from PAS, and interpolate them and merge the interpolation into a bi-Maxwellian distribution background. The background bi-Maxwellian distribution is called a "collar". Every step is carefully recorded, and the code is well documented.