Add feature to transform in-situ magnetic field vector components from one reference frame representation to another #7389
Labels
coordinates
Affects the coordinates submodule
Effort Medium
Requires a moderate time investment
Feature Request
New feature wanted!
Package Intermediate
Requires some knowledge of the internal structure of SunPy
Priority Medium
Non-urgent action required
Solar Physics Knowledge
This requires some basic understanding of solar physics
Describe the feature
To compare timeseries from Solar Orbiter in-situ observations of magnetic field in the spacecraft's RTN reference frame to magnetic field observations in a different reference frame, you need to be able to convert the components of the magnetic field vector to a common reference frame.$v = a_0 e_r + a_1 e_t + a_2 e_n$ in the basis $(e_r, e_t, e_n)$ , can be equally represented by $v = b_0 e_x + b_1 e_y + b_2 e_z$ in the alternate basis $(e_x, e_y, e_z)$ .$(b_0, b_1, b_2)$ given $(a_0, a_1, a_2)$ and the two frames defined in SPICE kernels.
The sunpy.coordinates.spice module has a method to transform position coordinates from one reference frame to another, but I can't find a method to transform the representation of a vector field in one coordinate frame to another.
For example, a vector
The feature I am requesting is a method to compute the change of basis matrix required to find the components
Proposed solution
spiceypy's pxform method gives the change of basis matrix$M$ such that $b_j = M_{i,j} a_i$ from frames defined in loaded SPICE kernels. It would be good to integrate that functionality with the rest of the sunpy.coordinates.spice module, and frames defined therein.
What do people think? I'm happy to work on a way to implement this, if there is a wider need for it.
The text was updated successfully, but these errors were encountered: