matplotlib / matplotlib/basemap

Broken Basemap rotpole projection

Offen
#376 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
817
Forks
395
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

```python
# 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](https://user-images.githubusercontent.com/11734464/31892556-0344a5dc-b812-11e7-9add-5593f9cd81af.png)
![broken](https://user-images.githubusercontent.com/11734464/31892567-08f9db78-b812-11e7-8534-7ccb1889e3a6.png)

**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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das bereitgestellte Reproduktionsskript auszuführen und die beiden erzeugten Karten zu vergleichen. Verfolge Basemaps Behandlung der rotpole-Projektion für Grenzen, die den Nullmeridian des gedrehten Gitters überschreiten; fertig ist die Aufgabe, wenn beide Fälle Kartengrenzen, Küstenlinien, Kontinente, Parallelen und Meridiane korrekt darstellen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.