Ignore:
Timestamp:
Mar 17, 2009, 4:02:54 PM (14 years ago)
Author:
rwilson
Message:

Revert back to 6481, prior to auto-merge of trunk and numpy branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/coordinate_transforms/redfearn.py

    r6517 r6533  
    3737    return sign*dd, mm, ss
    3838
    39 def redfearn(lat, lon, false_easting=None, false_northing=None,
    40              zone=None, central_meridian=None, scale_factor=None):
     39def redfearn(lat, lon, false_easting=None, false_northing=None, zone=None):
    4140    """Compute UTM projection using Redfearn's formula
    4241
     
    4847    If zone is specified reproject lat and long to specified zone instead of
    4948    standard zone
    50     If meridian is specified, reproject lat and lon to that instead of zone. In this case
    51     zone will be set to -1 to indicate non-UTM projection
    52 
    53     Note that zone and meridian cannot both be specifed
    5449    """
    5550
     
    6257    a = 6378137.0                       #Semi major axis
    6358    inverse_flattening = 298.257222101  #1/f
    64     if scale_factor is None:
    65         K0 = 0.9996                         #Central scale factor   
    66     else:
    67         K0 = scale_factor
    68     #print 'scale', K0
     59    K0 = 0.9996                         #Central scale factor   
    6960    zone_width = 6                      #Degrees
    7061
     
    147138    m = term1 + term2 + term3 + term4 #OK
    148139
    149     if zone is not None and central_meridian is not None:
    150         msg = 'You specified both zone and central_meridian. Provide only one of them'
    151         raise Exception, msg
    152    
    153     # Zone
     140    #Zone
    154141    if zone is None:
    155142        zone = int((lon - longitude_of_western_edge_zone0)/zone_width)
    156143
    157     # Central meridian
    158     if central_meridian is None:
    159         central_meridian = zone*zone_width+longitude_of_central_meridian_zone0
    160     else:
    161         zone = -1
     144    central_meridian = zone*zone_width+longitude_of_central_meridian_zone0
    162145
    163146    omega = (lon-central_meridian)*pi/180 #Relative longitude (radians)
Note: See TracChangeset for help on using the changeset viewer.