jgieseler / solarmach

Python package of the multi-spacecraft longitudinal configuration plotter Solar-MACH
https://solarmach.readthedocs.io
BSD 3-Clause "New" or "Revised" License
28 stars 6 forks source link

Too different values in long_sector_vsw cause a plotting glitch #33

Closed jgieseler closed 1 year ago

jgieseler commented 1 year ago

https://github.com/jgieseler/solarmach/issues/32 added the option to fill the area of the plot between two Parker spirals with a given color. But when the solar wind speeds in long_sector_vsw differ to some extent, the plotting does not work as intended:

from solarmach import SolarMACH
body_list = ['STEREO-A', 'Earth', 'BepiColombo', 'PSP', 'Solar Orbiter', 'Mars']
vsw_list = [400, 400, 400, 400, 400, 400]
date = '2022-3-11 12:00:00'

sm = SolarMACH(date, body_list, vsw_list)
sm.plot(numbered_markers=True, long_sector=[290,328], long_sector_vsw=[400,700], long_sector_color='cyan')

issue32_bug

The problem can be seen a bit better when zoomed out to further distances:

issue32_bug2

The problem originates in the fact that plt.fill_between() fills the area between the two Parker spirals at a given radial distance. Maybe the problem could be solved if the filling wouldn't be done with respect to radial distance, but distance along the spiral line. Not sure how to implement that, though.

jgieseler commented 1 year ago

NB: Renamed fill_between to long_sector with https://github.com/jgieseler/solarmach/commit/f8ab303f8a95adf155c5683181b3a771dd45fe00