matplotlib / matplotlib/basemap

Is basemap.rotate_vector working correctly?

Open
#294 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
817
Forks
395
PR merge metrics
No merged PRs in 30d

Description

I have another indication that there might be something wrong in case of the rotpole projection, I'll try to make an example with that, later when I have some time. But for now please see the example below, should those to arrows be identical in this projection? (red is the rotated one and green is the original one) ...

![figure_1](https://cloud.githubusercontent.com/assets/900941/15077742/de969ba8-137d-11e6-8fa3-19008c40e539.png)

``` python

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

u = np.array([0.5, ])
v = np.array([0.5, ])

lon = -84
lat = 45

lon = np.array([lon, ])
lat = np.array([lat, ])

b = Basemap(lon_0=0)

urot, vrot = b.rotate_vector(u, v, lon, lat)
xx, yy = b(lon, lat)

b.quiver(xx, yy, urot, vrot, color="r")

b.quiver(xx, yy, u, v, color="g")

b.drawcoastlines()

```

Cheers

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Python reproduction and the Basemap.rotate_vector entry point, using the lon=-84 and lat=45 vectors shown. Run the example and inspect the returned components and plotted arrows for the stated projection. Done means establishing whether the arrows should match and documenting or correcting the behavior with a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.