DamienIrving / climate-analysis

Code used for the analysis and visualisation of climate data during my PhD
MIT License
40 stars 19 forks source link

Streamline plotting with iris/cartopy #21

Closed DamienIrving closed 9 years ago

DamienIrving commented 9 years ago

There seems to be a bug with my plotting of streamlines in plot_map.py. Whenever the input and output projections are the same (e.g. PlateCarree_Dateline), it only plots half the hemisphere.

(Unlike the contour and contourf plots which use the smarter iris.plot library, for streamplots you have to still use matplotlib and thus specify the input projection using the transform keyword argument.)

DamienIrving commented 9 years ago

I solved this by forcing the input streamline data to have longitude bounds -180 to 180. It seems the system can't handle 0 to 360 correctly.

DamienIrving commented 9 years ago

The solution to this problem is explained here. Cartopy can handle input data of any longitude range, so you never have to edit the default central_longitude when specifying the input projection.