############################ Map Projection (using PyGMT) ############################ Compared to Cartopy package, PyGMT provides higher resolution map projection. Monthly dataset --------------- Read data and calculate the monthly average as if you were `programming with the Cartopy pakage `__. .. literalinclude:: programs/maps.temp.py :language: python :lines: 61-62 Monthly temperature plots on a map ---------------------------------- Pygmt install ============= The map projection uses `PyGMT `__ package. You can simply command ``$ conda install -n env_weclim -c conda-forge pygmt``. The information on PyGMT installation is available `here `__. Map plots ========= The background map can be drawn using the following commends: .. literalinclude:: programs/maps.pygmt.py :language: python :lines: 5 .. literalinclude:: programs/maps.pygmt.py :language: python :lines: 10-78 ``dat`` are temperature data for all locations including longitude ``lons`` and latitude ``lats`` information. ``maxlat`` ``minlat`` ``maxlon`` ``minlon`` are the range of map area. ``fig.coast(borders=["2/0.5p,red"])`` : `borders options `__ are 1 (National boundaries), 2 (State boundaries within the America), 3 (Marine boundaries), and a (All boundaries). ``fig.basemap(frame=["a", f'WSne+t"{titleX}"'])`` : ``Wsne`` is `the title positioning `__. Sample program for maps ======================== Source file: :download:`maps.pygmt.py ` Create animation ---------------- PNG files can be converted to animated images (gif file). .. literalinclude:: programs/animate.txt :lines: 1 Here, ``-delay N`` is the frame rate of N/100 (seconds) and ``-loop M`` is the number of loop of the animation image. You can check the animation image as ``$ animate XX.gif``. Gallery ------- Monthly temperature at each weather station (oC) (Click to see the animation). .. image:: SRC/TAIR.pygmt.gif :height: 300