spedas / bleeding_edge

IDL-based Space Physics Environment Data Analysis Software (bleeding edge)
http://www.spedas.org
Other
7 stars 0 forks source link

Develop code to infer THEMIS-E Bz component from Bx, By and particle data #160

Open jameswilburlewis opened 1 month ago

jameswilburlewis commented 1 month ago

With the latest Bz offset changes on THEMIS-E, we need a way to estimate the Bz component using particle data. From Vassilis:

As we discussed we would like to determine the field line direction from the ESA electrons in order to recover the Bz DSL component from the other two components. The goal is to obtain the angles theta and phi (latitude, azimuth) of that direction based on a principal axis analysis of electrons of a given energy, and do this as a function of energy. Each spin period, some energies may respond well, some may have noise and not respond well. We can only keep the energies that do respond well, and average the components of the unit vector to obtain the best direction.

Once we have theta, then we can find Bz = tan(theta)*sqrt(Bx^2+By^2) in DSL every spin period and create a corrected B_dsl product at spin resolution.

To obtain theta at a given energy, we compute the partial pressure tensor at that energy Pij. This can be done for each channel or a combination of channels, 3 at a time centered at one. So, 15 energies will provide 15-2= 13 channels, each with 3 energies. You may have to throw away the lowest few channels due to photoelectrons, so lets say 10 channels. Then use principal component analysis to determine 3 eigenvectors and eigenvalues for each channel. Two eigenvalues would be very similar (the electrons are gyrotropic) representing the P_perp, while the other is most dissimilar. The dissimilar eigenvalue would be P_par, and could be either below P_perp (the electron distribution would be like a pancake) or above P_perp (a cigar distribution) or equal (isotropic distribution, carries no information on B-direction). If the most dissimilar eigenvalue is (for example) < 20% away from the average of the other two most similar ones, then we can throw that point away. At the same time,nnnnn if the most similar eigenvalues are > 10% different from each other (value is an example), then again we throw away that point. These are 2 criteria for selecting potentially good B-direction solutions.

The collection of N good points at different energies results in N eigenvectors in DSL coord’s each time (1<N<10). You can average the few eigenvectors that satisfy these criteria to obtain a single eigenvector. You then determine theta and phi from that.

From the theta, you can determine Bz = tan(theta)*sqrt(Bx^2+By^2) in DSL as discussed above. A third criterion can be applied to check the validity of the solution. That is the eigenvector phi angle compared to that from atan(Bx, By). You can use that to determine how good the 2 criteria above are, and how much error to tolerate and still get N> at each time, in enough cases.

Let me now if this unclear. IDL has a built- in function for principal axis analysis, which is same as is used in minvar.pro (I think) based on Bij. You could see how it is implemented tjere.