1
votes

I'm working with the Hammer projection defined in basemap (I use basemap's version instead on the one defined directly in maptplotlib due to the ability to change the lon_0 parameter).

But my goal is to represent sky maps generated from ground, so it doesn't make sense to plot the southern hemisphere of the map (ground).

https://dl.dropboxusercontent.com/u/66372761/skymap.png

What I would like (more or less)

https://dl.dropboxusercontent.com/u/66372761/skymap_crop.png

Is there any way to achieve this with this basemap module?. One option would be of course to save the image and then crop it with p.e. imagemagick, but this seems a bit ugly workaround, and the results would be far from perfect due to the axis labels and so.

I see that someone managed to get something similar with the custom projection of matplotlib, matplotlib: custom projection for hemisphere/wedge, but it's with the standard matplotlib, not with the basemap module.

PS. I'm using Python 2.7, matplotlib 1.3.1 and basemap 1.0.7.

Thanks in advance, Miguel

1

1 Answers

2
votes

Ordinarily, the way to show only part of the map is using the height, width, lat_0, and lon_0 parameters in the Basemap() constructor. However, the hammer projection ignores all but the lon_0 parameter, meaning the only way to crop the image in the way you want is to crop the image after it's created by basemap or use a different type of projection.