SuperDARN / pydarn

Python library for visualizing SuperDARN Data
GNU Lesser General Public License v3.0
31 stars 11 forks source link

Fixed `map_info=False` not working #375

Closed billetd closed 6 months ago

billetd commented 6 months ago

Scope

Setting map_info=False when using plot_mapdata() didn't work previously because it would cause parameters (like the number of points and the cross-polar-cap potential) to not be stored into variables, causing the code to break at the return statement. This PR fixes the keyword when set to False by only checking it after those values are stored in variables. I also added map_info to the docstring, because it wasn't there before.

Approval

1

Test

import pydarn
import matplotlib.pyplot as plt

mapfile = '20231004.n.map'
SDarn_read = pydarn.SuperDARNRead(mapfile)
map_data = SDarn_read.read_map()

pydarn.Maps.plot_mapdata(map_data, record=0, lowlat=50, map_info=False)
plt.show()

Gives:

Screenshot 2024-02-13 at 10 09 49 AM