A question on Basemap projection

Dear Jeffrey & ALL,

Are there any way to plot a Basemap using a standard Equidistant
Cylindrical Projection, but centered on the Pacific Basin instead of
the default plot? This can be done easily with all projections that
require just a center point at lat_0, long_0 (Robinson, Mollweide,
Orthographic, Geostationary) but could not figure out how to do this
in projections that require a bounding rectangle to be defined (as is
the case with the Equidistant Cylindrical).

Thanks in advance!

With best regards,

···

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

Mauro Cavalcanti wrote:

Dear Jeffrey & ALL,

Are there any way to plot a Basemap using a standard Equidistant
Cylindrical Projection, but centered on the Pacific Basin instead of
the default plot? This can be done easily with all projections that
require just a center point at lat_0, long_0 (Robinson, Mollweide,
Orthographic, Geostationary) but could not figure out how to do this
in projections that require a bounding rectangle to be defined (as is
the case with the Equidistant Cylindrical).

Thanks in advance!

With best regards,

Mauro: Just set the llrncrlat,urcrnrlon appropriately. For instance, llcrnrlon=0, urcrnrlon=360 will produce a map centered on the dateline while llcrnrlon=-180, urcrnrlon=180 will produce a map centered on Greenwich.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328

Dear Jeff,

2008/12/7 Jeff Whitaker <jswhit@...146...>:

Mauro: Just set the llrncrlat,urcrnrlon appropriately. For instance,
llcrnrlon=0, urcrnrlon=360 will produce a map centered on the dateline while
llcrnrlon=-180, urcrnrlon=180 will produce a map centered on Greenwich.

Thanks! I had not figured out that the decimal coordinates used by
Basemap range from 0 to 360 (and not just from -180 to 180). Using
this tip, I could also create a map centered on the Indian Ocean. BTW,
by varying the llcrnrlat and urcrnrlat, can one also create maps
centered on the North and South poles using a Equirectangular
projection?

With best regards,

···

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

Mauro Cavalcanti wrote:

Dear Jeff,

2008/12/7 Jeff Whitaker <jswhit@...146...>:
  

Mauro: Just set the llrncrlat,urcrnrlon appropriately. For instance,
llcrnrlon=0, urcrnrlon=360 will produce a map centered on the dateline while
llcrnrlon=-180, urcrnrlon=180 will produce a map centered on Greenwich.
    
Thanks! I had not figured out that the decimal coordinates used by
Basemap range from 0 to 360 (and not just from -180 to 180).

Mauro: I just updated SVN basemap so you can specify just lon_0 for all cylindrical projections (cyl,gall,merc,mill) to get a global map centered on lon_0 (implying llcrnrlat=-90,urcrnrlat=90,llcrnrlon=lon_0-180,urcrnrlon=lon_0+180).

Using
this tip, I could also create a map centered on the Indian Ocean. BTW,
by varying the llcrnrlat and urcrnrlat, can one also create maps
centered on the North and South poles using a Equirectangular
projection?
  

No. Cylindrical projections can't cross the poles.

-Jeff

···

With best regards,

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328

Mauro Cavalcanti wrote:

Dear Jeff,

2008/12/7 Jeff Whitaker <jswhit@...146...>:
  

Mauro: Just set the llrncrlat,urcrnrlon appropriately. For instance,
llcrnrlon=0, urcrnrlon=360 will produce a map centered on the dateline while
llcrnrlon=-180, urcrnrlon=180 will produce a map centered on Greenwich.
    
Thanks! I had not figured out that the decimal coordinates used by
Basemap range from 0 to 360 (and not just from -180 to 180). Using
this tip, I could also create a map centered on the Indian Ocean. BTW,
by varying the llcrnrlat and urcrnrlat, can one also create maps
centered on the North and South poles using a Equirectangular
projection?
  
Mauro: I realized that this is actually possible with the Cassini projection (the transverse aspect of the cylindrical equidistant).

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
width=20000000
m = Basemap(lon_0=0,lat_0=0,projection='cass',\
            width=0.75*width,height=2*width)
m.drawcoastlines()
m.fillcontinents(color='coral',lake_color='aqua')
m.drawparallels(range(-80,81,21))
m.drawmeridians(range(-180,181,60))
m.drawmapboundary(fill_color='aqua')
plt.show()

Don't know why you would actually do it though, if you want to show polar regions you should probably use the polar stereographic maps (npstere, spstere).

-Jeff

···

With best regards,

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328

Dear Jeff,

2008/12/8 Jeff Whitaker <jswhit@...146...>:

Mauro: I just updated SVN basemap so you can specify just lon_0 for all
cylindrical projections (cyl,gall,merc,mill) to get a global map centered on
lon_0 (implying
llcrnrlat=-90,urcrnrlat=90,llcrnrlon=lon_0-180,urcrnrlon=lon_0+180).

Excellent! Will however have to change my Basemap installation to the
SVN repository.

No. Cylindrical projections can't cross the poles.

Just figured this out, by trial-and-error. BTW, these explorations led
me to comment that biogeographers (almost all of them biologists like
myself) have seldom (or never!) paid attention to the question of map
projections! This by itself should merit a scientific paper!

So, Basemap may also be lending to scientific insights... Exciting, isn't it?

More soon.... :wink:

Best wishes,

···

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

Dear Jeff,

2008/12/8 Jeff Whitaker <jswhit@...146...>:

Mauro: I realized that this is actually possible with the Cassini
projection (the transverse aspect of the cylindrical equidistant).

Don't know why you would actually do it though, if you want to show polar
regions you should probably use the polar stereographic maps (npstere,
spstere).

I had not yet had time to try Cassini's before receiving your posting.
As Scott already pointed out, no doubt the polar projections are more
adequate to representing the poles (pretty obvious!). I just intended
to try making the most parsimonious use of the Basemap parameters :-).
The polar stereographic are nice, but what about the polar azimuthal,
that also look good? Just curious.

Best regards,

···

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."