Anja Roesel wrote: > Thanks Jeff, that's actually what I wanted to know. > Unfortunately I guess, there is a small difference between Transverse > Mercator and Universal Transverse Mercator Projections > Do I have the possibility to define somewere the UTM zone and the Datum > of my Projection. > I tried it like Jeff suggested, > > map1 = Basemap(projection='tmerc', > resolution='i',llcrnrlon=-128.3841365,llcrnrlat=68.3952899,urcrnrlon=-121.5846218,urcrnrlat=70.7793990, > lon_0=-124.98437915,lat_0=69.587344449999989) > > lons,lats = map1(X_utm,Y_utm,inverse='True') > > but the lons and lats > look like this: > > In [53]: lons > Out[53]: > array([[-124.98437915, -124.98437915, -124.98437915, ..., -124.98437915, > -124.98437915, -124.98437915], > [-124.98437915, -124.98437915, -124.98437915, ..., -124.98437915, > -124.98437915, -124.98437915], > [-124.98437915, -124.98437915, -124.98437915, ..., -124.98437915, > -124.98437915, -124.98437915], > ..., > [-124.98437915, -124.98437915, -124.98437915, ..., -124.98437915, > -124.98437915, -124.98437915], > [-124.98437915, -124.98437915, -124.98437915, ..., -124.98437915, > -124.98437915, -124.98437915], > [-124.98437915, -124.98437915, -124.98437915, ..., -124.98437915, > -124.98437915, -124.98437915]]) > > In [54]: lats > Out[54]: > array([[ 90., 90., 90., ..., 90., 90., 90.], > [ 90., 90., 90., ..., 90., 90., 90.], > [ 90., 90., 90., ..., 90., 90., 90.], > ..., > [ 90., 90., 90., ..., 90., 90., 90.], > [ 90., 90., 90., ..., 90., 90., 90.], > [ 90., 90., 90., ..., 90., 90., 90.]]) > > Has anyone an idea? > > Anja: Basemap measures X and Y in meters from the lower left corner of the plot. I don't know how your X_utm and Y_utm are defined, or what units they are. You also may have to specify the major and minor radii of the earth to exactly match the UTM projection definition you are using. Basemap cannot define a UTM projection, the the pyproj module inside basemap does. If you know the UTM zone you could do, for example:
from mpl_toolkits.basemap import pyproj p = pyproj.Proj(proj='utm',zone=10,ellps='WGS84') lons, lats = p(X_utm,Y_utm,inverse=True) you would still need to be careful about the units of X_utm and Y_utm and the ellipse definition, however. -Jeff ------------------------------------------------------------------------------ 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