Skip to content

优化弯曲箭头绘制#32

Open
decadeneo wants to merge 2 commits intoQianyeSu:mainfrom
decadeneo:main
Open

优化弯曲箭头绘制#32
decadeneo wants to merge 2 commits intoQianyeSu:mainfrom
decadeneo:main

Conversation

@decadeneo
Copy link
Copy Markdown
Contributor

新增功能

1. numpy数组接口 (curved_quiver_numpy)

  • 直接使用numpy数组绘制弯曲箭头,无需xarray Dataset
  • 自动检测网格规则性
  • 支持不规则网格的自动插值

2. 垂直剖面绘制 (curved_quiver_profile)

  • 专门用于垂直剖面(distance, height)格式的弯曲箭头
  • 支持自定义单位标注
  • 适用于气象学、海洋学等剖面分析

3. 不规则网格支持

  • 新增 _is_regular_grid() 检查网格规则性
  • 新增 _interpolate_to_regular_grid() 插值到规则网格
  • 使用scipy.interpolate.griddata实现

改进

  • 箭头密度默认值提升(示例中使用2.5),使曲线更明显
  • 修复剖面图Y轴方向问题

依赖

新增可选依赖:scipy(用于不规则网格插值)

向后兼容性

  • 原有 curved_quiver() 函数完全不受影响
  • 新功能为纯新增,无破坏性改动

- Add curved_quiver_numpy() for direct numpy array input
- Add curved_quiver_profile() for vertical profile plotting
- Add grid regularity checking and interpolation utilities
- Support irregular grids via scipy interpolation
- Add comprehensive documentation and unit tests"
Added functions to check grid regularity and interpolate to a regular grid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant