matplotlib / matplotlib/basemap

Broken Basemap rotpole projection

未关闭
#376 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
817
派生
395
PR 合并指标
30 天内没有已合并 PR

描述

Initally posted by a mistake to matplotlib/matplotlib
https://github.com/matplotlib/matplotlib/issues/9541
Here seems to be more relevant..

Bug report

Bug summary

Basemap can't plot rotated-pole maps that cross rotated-grid's 0-th meridian

Code for reproduction
Here is a simple code that produce two maps for non-rotated grid (zero-rotation).
One does not cross Greenwich meridian another one does.

# Paste your code here
#
#
#!/usr/bin/python
import matplotlib as mpl
mpl.use('AGG')

import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.basemap import Basemap
import os

figname="okay.png"
fig = plt.figure()
bmap = Basemap(projection='rotpole',
       llcrnrx=0, urcrnry=15,
       urcrnrx=25, llcrnry=-15,
       lon_0 = 0,
       o_lon_p = 0.,
       o_lat_p = 90.,
       resolution='c')

bmap.drawmapboundary(fill_color='aqua')
bmap.fillcontinents(color='coral',lake_color='aqua')
bmap.drawcoastlines(linewidth=0.5)
bmap.drawparallels(np.arange(-20,20,10.))
bmap.drawmeridians(np.arange(-40,40,10.))

mpl.pyplot.savefig(figname)


figname="broken.png"
fig.clf()



bmap = Basemap(projection='rotpole',
       llcrnrx=-25, urcrnry=15,
       urcrnrx=25, llcrnry=-15,
       lon_0 = 0,
       o_lon_p = 0.,
       o_lat_p = 90.,
       resolution='c')

bmap.drawmapboundary(fill_color='aqua')
bmap.fillcontinents(color='coral',lake_color='aqua')
bmap.drawcoastlines(linewidth=0.5)
bmap.drawparallels(np.arange(-20,20,10.))
bmap.drawmeridians(np.arange(-40,40,10.))

mpl.pyplot.savefig(figname)

Actual outcome
Here are two maps.. The second one is obviously broken.
okay
broken

Matplotlib version

  • Operating system: Python 2.7.1, python-matplotlib 1.5.1-1ubuntu1
  • Matplotlib version: 1.5.1-1ubuntu1
  • Python version: 2.7.1

Default Ubuntu 16.04.3 LTS installation

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先运行提供的复现脚本,并比较生成的两张地图。跟踪 Basemap 对于跨越旋转网格本初子午线的边界的 rotpole 投影处理;当两种情况下都能正确渲染地图边界、海岸线、大陆、纬线和经线时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
data-visualization
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。