matplotlib / matplotlib/basemap
Numerical precision issue in rotate_vector
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 817
- 派生
- 395
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hi,
I ran into a numerical precision issue when using the rotate_vector function with 32bit floats as input data. In this case, the lat/lon increments used to determine the relative rotation between map projection and the lat/lon grid is chosen too small. The result was a cristalline structure in the plotted wind barbs which patches of barbs pointing in the exact same direction.
https://github.com/matplotlib/basemap/blob/decfa95124dab76499734145d03b002b9db27477/lib/mpl_toolkits/basemap/__init__.py#L3118
Converting the input to 64bit floats solves the issue for me, as did an increase of the increment to 1.0e-4.
Best regards,
Clemens
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 lib/mpl_toolkits/basemap/__init__.py 中 issue 所引用的 rotate_vector 实现附近开始。使用 32 位浮点输入复现风羽伪影,将其与 64 位输入和提到的更大增量进行比较,并验证在不改变预期旋转行为的情况下,晶体状图案已被消除。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- matplotlib, python
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100