The package abstracts away some complexity of using the Python packages cartopy/matplotlib for creating global heatmaps / intensity maps of a quantity.
Opinionated recommendation: avoid dependency hell and use conda to create a virtual environment and install cartopy (with precompiled binaries).
conda install cartopyInstall this package within the virtual environment:
pip install .Import the module and call the plot function as shown below:
import map_plotter
map_plotter.plot(
lons_g, lats_g,
variable, units="m/s",
variable_vector,
img_name="image.png",
save=True, plot=True,
title="something", zlims=[0,10])Whereby:
lons_gandlats_grepresent 2D matrices / grids of longitudes and latitudes.variableis the matrix of scalar values to be plotted (same grid dimensions).variable_vectoris the matrix of values of tuples (u,v) to be plotted (same grid dimensions). If both variable and variable_vector specified, quiver plot is overload onto intensity plot.unitsandimg_name(self explanatory, units apply to scalar variable intensity plot).save&plotboolean flags to save the file and plot to screen, respectively.zlimsdefine the color scale minimum and maximum.
Install testing dependencies:
pip install -r tests/requirements.txtRun the test script to visualize ocean current data:
python tests/check_map.pyA map is displayed, and a PNG file is generated in the tests/ directory.
Figure 1: Total electron content of the ionosphere for given date-time as nowcast by the NOAA WAM-IPE model
