Open varenius opened 1 year ago
Sun coordinates are needed anyway and can be obtained as noted in #37 . Conversion between ecliptic / equatorial can be done as shown in https://astrophysicsandpython.com/2021/04/19/celestial-coordinate-conversions/#Equatorial_Ecliptic.
Functions to obtain the Sun's coordinates, and ecliptic --> equatorial conversion, was added in https://github.com/centowen/salsa/commit/09b9e492ec8b21798e478682ffe5d3620e0e29ec.
function for VLSR-correction calculation + (better) required coordinate functions added in https://github.com/centowen/salsa/commit/2e4ff3fc4c5d2b142fedec103df7993cd82a15c4.
Now remains actually applying the correction to measure spectra.
To interpret line spectra, such as HI emission, we need a common reference frame. One usual is the VLSR (see e.g. http://web.mit.edu/8.13/www/srt_software/vlsr.pdf, also attached here as vlsr.pdf), which was implemented in the old SALSA software at https://github.com/varenius/salsa/blob/main/Control_program/spectrum.py#L160.
There are issues with this implementation for switched spectra, see https://github.com/varenius/salsa/issues/20, where the correction's time dependence is currently ignored. However, doing a "proper" velocity correction for each sub-integration bin and then re-gridding all partial results to combine constructively seems to be beyond the scope of this application. After all, most measurements are less than 5 minutes, and we could simply document the limitation of using the telescope for long integrations.
In any case, the VLSR correction calculation seems to need ecliptic and Sun coordinates conversions, so these need to be added before the VLSR function can be ported from the old software.