Changeset 6533 for branches/numpy/anuga/coordinate_transforms/redfearn.py
- Timestamp:
- Mar 17, 2009, 4:02:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy/anuga/coordinate_transforms/redfearn.py
r6517 r6533 37 37 return sign*dd, mm, ss 38 38 39 def redfearn(lat, lon, false_easting=None, false_northing=None, 40 zone=None, central_meridian=None, scale_factor=None): 39 def redfearn(lat, lon, false_easting=None, false_northing=None, zone=None): 41 40 """Compute UTM projection using Redfearn's formula 42 41 … … 48 47 If zone is specified reproject lat and long to specified zone instead of 49 48 standard zone 50 If meridian is specified, reproject lat and lon to that instead of zone. In this case51 zone will be set to -1 to indicate non-UTM projection52 53 Note that zone and meridian cannot both be specifed54 49 """ 55 50 … … 62 57 a = 6378137.0 #Semi major axis 63 58 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 69 60 zone_width = 6 #Degrees 70 61 … … 147 138 m = term1 + term2 + term3 + term4 #OK 148 139 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 154 141 if zone is None: 155 142 zone = int((lon - longitude_of_western_edge_zone0)/zone_width) 156 143 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 162 145 163 146 omega = (lon-central_meridian)*pi/180 #Relative longitude (radians)
Note: See TracChangeset
for help on using the changeset viewer.