DamienIrving / climate-analysis

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

iris/cartopy for pole and wind rotation #19

Closed DamienIrving closed 8 years ago

DamienIrving commented 9 years ago

I might be able to replace coordinate_rotation.py by using iris.analysis.cartography.rotate_pole and iris.analysis.cartography.rotate_winds. This would do away with the need to use the css library that comes with UV-CDAT, thus solving #7.

Both these iris functions call cartopy.crs.RotatedGeodetic(), which makes use of the widely used PROJ.4 Cartographic Projections library.

To make life easier, I may need to write a function which converts between cdms2 transient variables and iris cubes.

DamienIrving commented 9 years ago

There are python bindings for PROJ.4 (pyproj), however cartopy actually uses the C code (see the main crs module).

It's also worth noting that PROJ.4 is maintained by the Open Source Geospatial Foundation. All the documentation seems to be at the Trac page but the latest code is at their GitHub repo.

DamienIrving commented 9 years ago

It turns out that I didn't need rotate_pole to plot the search box - I could just say that the input grid was a RotatedPole grid and pass that input grid to plot_map.py.

For the rotated wind field, rotate_winds will give me the new wind values and the details of the coordinates on the rotated grid. I need to figure out how to then regrid that data, using those details, to a regularly spaced rotated grid.

DamienIrving commented 8 years ago

I did end up using iris for pole rotation.