技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
pygmt【数据与研究】Make geographic maps and process geospatial grids with PyGMT and GMT, including projection, regions, grid registration and vector/raster export. Use for GMT cartography and map-ready scientific data; check the separate GMT shared library before plotting.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Produce a map whose projection, coordinate units and data coverage are explicit. PyGMT 0.19 requires Python 3.12+ and GMT 6.5+; the Python package alone does not install the GMT shared library. Use the documented isolated conda-forge setup with Ghostscript when exporting figures. Record PyGMT and GMT versions separately.
Establish geographic versus projected coordinates, horizontal CRS, longitude
convention and vertical datum. Choose region [west, east, south, north] and
projection deliberately. Decide pixel versus gridline registration and verify
coordinate ordering, spacing and NaN masks before gridding or image display.
Do not reinterpret projected metres as longitude/latitude degrees.
This example requires output_pdf to name a new output file. It uses no remote
relief or coastline dataset; the three locations are illustrative, not a survey.
# example: synthetic-map
import pygmt
figure = pygmt.Figure()
figure.basemap(region=[5, 10, 44, 48], projection="M10c",
frame=["af", "+tSynthetic locations"])
figure.plot(x=[6, 7.5, 9], y=[45, 46, 47], style="c0.18c",
fill="navy", pen="0.4p,black")
figure.savefig(output_pdf)
For actual gridded data, inspect spacing/registration before grdimage; choose
interpolation and color limits appropriate to units and scientific comparison.
Remote datasets such as Earth relief require documented resolution, cache,
license and download size. A cropped map does not prove the source data only
cover that region.
Reopen the exported file, check bounds, labels, orientation, missing-data areas and color scale. Compare control-point coordinates with the input, and sample known grid nodes through GMT when grid operations are involved. Provide the source data references, script, CRS/projection and export settings with the map.
See installation, tutorials and GMT grid conventions.