Changes between Version 4 and Version 5 of CowsFramework/CowsInstallation/MigrationToPython2.6


Ignore:
Timestamp:
22/09/10 13:53:30 (9 years ago)
Author:
astephen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CowsFramework/CowsInstallation/MigrationToPython2.6

    v4 v5  
    4141 
    4242These are called by the web app generated by the wmsviz controller when you click the "Make Figure" button in the right-hand panel. 
     43 
     44=== Basemap problem with Transverse Mercator projection === 
     45 
     46One of the cowsserver dependencies is [browse:qesdi/geoplot]. Within geoplot, an instance is created of the '''mpl_toolkit.basemap.Basemap''' class with the "tmerc" (Transverse Mercator) projection. The actual code is (see: http://proj.badc.rl.ac.uk/ndg/browser/qesdi/geoplot/trunk/lib/geoplot/grid_builder_national.py#L32): 
     47 
     48{{{ 
     4932      nationalGrid = basemap.Basemap(projection='tmerc', 
     5033                                     lon_0=trueOrigin[0], 
     5134                                     lat_0=trueOrigin[1], 
     5235                                     llcrnrlon=trueOrigin[0], llcrnrlat=trueOrigin[1], 
     5336                                     urcrnrlon=10, urcrnrlat=10, 
     5437                                     resolution=None) 
     55}}} 
     56 
     57This fails when moving to basemap 1.0 and matplotlib 1.0. When investigating the problem it seems to lie in the definition of the major and minor axes for the ellipsoid. This can be explicitly expressed using the '''rsphere''' argument when instantiating {{{Basemap}}}. 
     58geoplot (latest trunk - under qesdi) - investigate fix in rsphere usage!!!! 
     59 
     60See http://mapserver.org/errors.html#msprocessprojection-projection-library-error-major-axis-or-radius-0-not-given for some discussion of this issue. According to the matplotlib/basemap documents the '''rsphere''' argument can be: 
     61 
     62 1. A float/int of the earth's radius (DEFAULT = 6370997m) 
     63 2. A sequence of (major_axis, minor_axis) - I got segmentation faults when I tried making these similar, so I used option 3... 
     64 3. The documentation says '''Note: sometimes an ellipsoid is specified by the major axis and an inverse flattening parameter (if). The minor axis (b) can be computed from the major axis (a) and the inverse flattening parameter using the formula if = a/(a-b).'''  
     65 
     66It is therefore unclear numbers to use. I have set it to {{{rsphere=(6370997, 1)}}} for now because the following values of rsphere failed: 
     67 
     68 * a single integer - complains about "major axis or radius 0 not given" 
     69 * (6370997, 6370997) - segmentation fault 
     70 * (6370997, <something similar to 6370997>) - segmentation fault 
     71 
     72After making this change we get plots working but there may be errors in this assumption! 
    4373 
    4474=== Possible alternative to metacarta coastlines ===