Closed carleyjmartin closed 1 year ago
Matplotlib version: 3.5.3
The red/blue representation is correct.
import matplotlib.pyplot as plt import pydarn
file = "20150308.1400.03.cly.fitacf"
SDarn_read = pydarn.SuperDARNRead(file) fitacf_data = SDarn_read.read_fitacf()
ax, , , , = pydarn.Fan.plot_fan(fitacf_data, scan_index=1, lowlat=60, zmin=-1000, zmax=1000, boundary=True, radar_label=True, groundscatter=True, ball_and_stick=True, len_factor=300, coastline=True, parameter="v") plt.show()
ax, , , , = pydarn.Fan.plot_fan(fitacf_data, scan_index=1, lowlat=50, zmin=-1000, zmax=1000, boundary=True, radar_label=True, groundscatter=True, ball_and_stick=True, len_factor=300, coastline=True, parameter="v", coords=pydarn.Coords.GEOGRAPHIC, projs=pydarn.Projs.GEO) plt.show()
ax, , , , = pydarn.Fan.plot_fan(fitacf_data, scan_index=1, lowlat=50, zmin=-1000, zmax=1000, boundary=True, radar_label=True, groundscatter=True, ball_and_stick=False, coastline=True, parameter="v") plt.show()
ax, , , , = pydarn.Fan.plot_fan(fitacf_data, scan_index=1, lowlat=50, zmin=-1000, zmax=1000, boundary=True, radar_label=True, coastline=True, parameter="v", coords=pydarn.Coords.GEOGRAPHIC, projs=pydarn.Projs.GEO) plt.show()
ax, , , , = pydarn.Fan.plot_fan(fitacf_data, scan_index=1, lowlat=50, zmin=-1000, zmax=1000, boundary=True, radar_label=True, coastline=True, parameter="v",ball_and_stick=True, len_factor=200, coords=pydarn.Coords.AACGM, projs=pydarn.Projs.POLAR) plt.show()
I was getting some errors, which are resolved by updating my matplotlib on Anaconda.
Scope
This PR adds the option to plot ball and stick plots via fan plots using the new keyword
ball_and_stick=True
andlen_factor=300
. There is also some new code ingeo.py
that calculates the azimuth direction from Xueling and Shibaji (thank you!) from the radar to the gate position which calculates the stick part when plotting velocity. I have not used them to replace any current geo functions as they're slightly different and the module probably needs a nice tidy in it's own PR when we want to release this. I've also only used the code required, but we can add to and expand as we need it, rather than add it all in and then end up needing a whole rewrite down the line. Ran through flake8 and modification lines added.I can never remember if blue (+ve) is towards or away from the radar, in this version it just works out that blue is towards, let me know if that is correct cause I always get it wrong.
issue: to close #144
Approval
Number of approvals: 2 including a look over the code
Test
matplotlib version: 3.6.3 Note testers: please indicate what version of matplotlib you are using
Following code tests the mag and geo plots, and then back to the normal fan plot to make sure nothing has changed.
Top two make these plots: