[basemap] stereographic projection bounding boxes

I've been playing around with stereographic projections, and it appears
that the bounding-box for the 'stere' projection isn't computed. Being
blissfully unaware of all the complexities involved, I thought I'd send
this email to see if there's an easy way to deal with the situation.

Basically, I'm trying to plot on an equatorial stereographic projection
created like so:

m=Basemap(projection='stere', lat_ts = 0.0, lat_0 = 0, lon_0 = 90.0)

This creates a projection that seems to work well, but the problem is
that the [ll|ur]crn* attributes aren't set to anything useful, meaning
that lots of the nice basemap goodies aren't working (drawmeridians, etc.)

(Note: I don't really understand what the lat_ts is doing -- the
docstring says it is the "natural origin". I can't find reference to
this at http://en.wikipedia.org/wiki/Stereographic_projection . I guess
this is related to the discussion of "scale error at the extremities"
at
http://www.remotesensing.org/geotiff/proj_list/oblique_stereographic.html
, and thus I assume that if lat_ts is set to lat_0, the scale factor
will be 1 at the point of tangency. )

So, the question is, can some default bounding box be computed for
equatorial (and possibly oblique) stereographic projections in any
reasonable way? It would be nice to make plots like those found on the
wikipedia page.

Cheers!
Andrew

Andrew Straw wrote:

I've been playing around with stereographic projections, and it appears
that the bounding-box for the 'stere' projection isn't computed. Being
blissfully unaware of all the complexities involved, I thought I'd send
this email to see if there's an easy way to deal with the situation.

Basically, I'm trying to plot on an equatorial stereographic projection
created like so:

m=Basemap(projection='stere', lat_ts = 0.0, lat_0 = 0, lon_0 = 90.0)

This creates a projection that seems to work well, but the problem is
that the [ll|ur]crn* attributes aren't set to anything useful, meaning
that lots of the nice basemap goodies aren't working (drawmeridians, etc.)
  

Andrew: The [ll|ur]crn* have default values which don't work very well for the stereographic projection (-90,+90,-180,+180). You'll have to set them yourself when you create the Basemap instance.

(Note: I don't really understand what the lat_ts is doing -- the
docstring says it is the "natural origin". I can't find reference to
this at http://en.wikipedia.org/wiki/Stereographic_projection . I guess
this is related to the discussion of "scale error at the extremities"
at http://www.remotesensing.org/geotiff/proj_list/oblique_stereographic.html
, and thus I assume that if lat_ts is set to lat_0, the scale factor
will be 1 at the point of tangency. )
  

AFAICT, lat_ts is the latitude of 'true scale', whatever that means. I set the docstring based upon the info at http://www.remotesensing.org/geotiff/proj_list/polar_stereographic.html.

So, the question is, can some default bounding box be computed for
equatorial (and possibly oblique) stereographic projections in any
reasonable way? It would be nice to make plots like those found on the
wikipedia page.
  
You should be able to make all those plots without too much difficulty - just some trial and error in choosing the corners of the plot region. If you are making a polar stereographic projection, you can use projection='npstere' or 'spstere' and set the bounding latitude (the latitude that is tangent to the plot boundary - see the polarmaps.py example) and Basemap will determine the corners for you automatically. I don't know of any obvious way to do this for the equatorial case - it's pretty hard to guess what the user might want. I welcome any suggestions though.

-Jeff

···

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

Jeff Whitaker wrote:

You should be able to make all those plots without too much difficulty -
just some trial and error in choosing the corners of the plot region.
If you are making a polar stereographic projection, you can use
projection='npstere' or 'spstere' and set the bounding latitude (the
latitude that is tangent to the plot boundary - see the polarmaps.py
example) and Basemap will determine the corners for you automatically.
I don't know of any obvious way to do this for the equatorial case -
it's pretty hard to guess what the user might want. I welcome any
suggestions though.

-Jeff

Dear Jeff,

Thanks for your quick reply.

I ended up setting my boundaries by simply using the projection to plot my points, letting matplotlib plot the x,y points (without basemap to set the axes limits), and then taking the limits automatically computed by matplotlib and passing them through the inverse projection to get the lon,lat coordinates of the box. Now, on my next pass through, I'm using these as the bounding box information.

As always, basemap is working very well.

Cheers!
Andrew