Hi,
I'm working with data on the cubed sphere grid
(http://thatsmaths.files.wordpress.com/2012/10/cubed-sphere-grid.jpg).
Even though the data is interpolated on a regular lat-lon grid
for plotting, I would like to plot the edges of the 6 cube faces
for visual reference.
Moreover I would like this to be independent from the map projection type
and map center lon/lat, as you can see in this image:
https://www.dropbox.com/s/79rzhv1buhuk2b8/Desired_cubed_sphere_edges.png
But all I can get using Basemap is this:
https://www.dropbox.com/s/09j62d270znyego/Basemap_cubed_sphere_edges.png
which is definitely not what I would like to do.
This image is produced by the attached script cubed_sphere_edges.py .
Does anyone have any advice on how to solve this issue?
Any help would be really appreciated.
--
Pier Giuseppe Fogli
CMCC - Centro Euro-Mediterraneo sui Cambiamenti Climatici (www.cmcc.it)
Viale Aldo Moro, 44
40127 Bologna
ITALY
Phone: +39 051 3782606
FAX: +39 051 3782655
e-mail: piergiuseppe DOT fogli AT cmcc DOT it
skype: beppecmcc
from pylab import *
from mpl_toolkits.basemap import Basemap
def plot_cube(mp):
[y,x]=mp.gcpoints(45,-45,45,45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(135,-45,135,45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(225,-45,225,45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(315,-45,315,45,100)
mp.plot(y,x,'b',linewidth=1.5)
#
[y,x]=mp.gcpoints(45,-45,135,-45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(135,-45,225,-45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(225,-45,315,-45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(-45,-45,45,-45,100)
mp.plot(y,x,'b',linewidth=1.5)
#
[y,x]=mp.gcpoints(45,45,135,45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(135,45,225,45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(225,45,315,45,100)
mp.plot(y,x,'b',linewidth=1.5)
[y,x]=mp.gcpoints(-45,45,45,45,100)
mp.plot(y,x,'b',linewidth=1.5)
fh=figure()
ax1=subplot(3,2,1)
mp1=Basemap(projection='cyl',ax=ax1)
mp1.drawcoastlines()
mp1.drawparallels(arange(-90.,90.01,30.0))
mp1.drawmeridians(arange(0.,360.01,60.0))
plot_cube(mp1)
title('Equidistant Cylindrical [-180 180]')
ax1=subplot(3,2,2)
mp1=Basemap(projection='cyl',ax=ax1,lon_0=180.0)
mp1.drawcoastlines()
mp1.drawparallels(arange(-90.,90.01,30.0))
mp1.drawmeridians(arange(0.,360.01,60.0))
plot_cube(mp1)
title('Equidistant Cylindrical [0 360]')
ax1=subplot(3,2,3)
mp1=Basemap(projection='robin',ax=ax1,lon_0=-90.0)
mp1.drawcoastlines()
mp1.drawparallels(arange(-90.,90.01,30.0))
mp1.drawmeridians(arange(0.,360.01,60.0))
plot_cube(mp1)
title('Robinson [-270 90]')
ax1=subplot(3,2,4)
mp1=Basemap(projection='ortho',ax=ax1,lon_0=75.0,lat_0=28.0)
mp1.drawcoastlines()
mp1.drawparallels(arange(-90.,90.01,30.0))
mp1.drawmeridians(arange(0.,360.01,60.0))
plot_cube(mp1)
title('Orthographic [Origin= 28N 75E]')
ax1=subplot(3,2,5)
mp1=Basemap(projection='npstere',ax=ax1,lon_0=120.0,boundinglat=20.0)
mp1.drawcoastlines()
mp1.drawparallels(arange(-90.,90.01,30.0))
mp1.drawmeridians(arange(0.,360.01,60.0))
plot_cube(mp1)
title('Stereographic')
ax1=subplot(3,2,6)
mp1=Basemap(projection='moll',ax=ax1,lon_0=150.0)
mp1.drawcoastlines()
mp1.drawparallels(arange(-90.,90.01,30.0))
mp1.drawmeridians(arange(0.,360.01,60.0))
plot_cube(mp1)
title('Mollweid [lon_0=150E]')
savefig('Basemap_cubed_sphere_edges.png',format='png',dpi=100)
#show()
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users