Anja Roesel wrote:
> Dear list,
>
> I am a matplotlib newbie and I have some simple problems with the
> coordinate reprojection.
>
> I have a landsat scene in UTM Projection and I would like to plot it in
> a polarstereograhic projection (it is in the Arctic)
>
> I tried it like this:
> m=Basemap(resolution='i',projection='npstere',lon_0=-45,boundinglat=70)
> XP,YP = m(X_utm,Y_utm)
>
> but the outcome is nonsense (an array with 1.0's)
> I am wondering if there is an option to specify the input parameters
> like utm zone etc.
>
> Thanks for any help and ideas!
> Anja
>   

Anja:  You need to pass the latitude and longitude values (in degrees) 
to the Basemap instance when converting to projection coordinates.  So, 
to convert from UTM coordinates to polar stereographic coordinates you 
will need to do something like this:

map1 = Basemap(<parameters for transverse mercator projection>)

lons, lats = map1(x, y, inverse=True) # x and y are projection 
coordinates on original UTM grid.

# lons and lats are now latitudes and longitudes of UTM grid (in degrees)

map2 =

Basemap(resolution='i',projection='npstere',lon_0=-45,boundinglat=70)

x, y = map2(lons, lats)

# x,y are now polar stereo coordinates of UTM grid.

Or, if you already have the latitudes and logintudes of the original UTM 
grid you can skip the first two lines and just pass those to the 
stereographic Basemap instance.

-Jeff

-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : jeffrey.s.whita...@noaa.gov
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to