Changeset 4451
- Timestamp:
- May 16, 2007, 12:09:53 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/coordinate_transforms/geo_reference.py
r4389 r4451 1 1 """ 2 2 3 """ 3 4 … … 52 53 changing. 53 54 """ 54 55 if zone is None: 56 zone = DEFAULT_ZONE 55 57 self.false_easting = false_easting 56 58 self.false_northing = false_northing … … 118 120 except: 119 121 pass 120 assert (self.false_easting == DEFAULT_FALSE_EASTING) 121 assert (self.false_northing == DEFAULT_FALSE_NORTHING) 122 123 assert(self.datum == DEFAULT_DATUM) 124 assert(self.projection == DEFAULT_PROJECTION) 125 assert (self.units == DEFAULT_UNITS) 122 if (self.false_easting != DEFAULT_FALSE_EASTING): 123 print "WARNING: False easting of %f specified." %self.false_easting 124 print "Default false easting is %f." %DEFAULT_FALSE_EASTING 125 print "ANUGA does not correct for differences in False Eastings." 126 127 if (self.false_northing != DEFAULT_FALSE_NORTHING): 128 print "WARNING: False northing of %f specified." \ 129 %self.false_northing 130 print "Default false northing is %f." %DEFAULT_FALSE_NORTHING 131 print "ANUGA does not correct for differences in False Northings." 132 133 if (self.datum.upper() != DEFAULT_DATUM.upper()): 134 print "WARNING: Datum of %s specified." \ 135 %self.datum 136 print "Default Datum is %s." %DEFAULT_DATUM 137 print "ANUGA does not correct for differences in datums." 138 139 if (self.projection.upper() != DEFAULT_PROJECTION.upper()): 140 print "WARNING: Projection of %s specified." \ 141 %self.projection 142 print "Default Projection is %s." %DEFAULT_PROJECTION 143 print "ANUGA does not correct for differences in Projection." 144 145 if (self.units.upper() != DEFAULT_UNITS.upper()): 146 print "WARNING: Units of %s specified." \ 147 %self.units 148 print "Default units is %s." %DEFAULT_UNITS 149 print "ANUGA does not correct for differences in units." 126 150 127 151 … … 301 325 outfile is the name of the file to be written to. 302 326 """ 327 geo_ref = ensure_geo_reference(origin) 328 geo_ref.write_NetCDF(outfile) 329 return geo_ref 330 331 def ensure_geo_reference(origin): 332 """ 333 Given a list/tuple of zone, xllcorner and yllcorner of a geo-ref object, 334 return a geo ref object. 335 336 If the origin is None, return None, so calling this function doesn't 337 effect code logic 338 """ 303 339 if isinstance(origin, Geo_reference): 304 340 geo_ref = origin 341 elif origin is None: 342 geo_ref = None 305 343 else: 306 geo_ref = apply(Geo_reference,origin) 307 geo_ref.write_NetCDF(outfile) 344 geo_ref = apply(Geo_reference,origin) 308 345 return geo_ref 346 309 347 310 348 #-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.