Ignore:
Timestamp:
May 20, 2009, 3:45:43 PM (15 years ago)
Author:
rwilson
Message:

Back-merge of changes to fix validation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/coordinate_transforms/geo_reference.py

    r6546 r7062  
    5858        if zone is None:
    5959            zone = DEFAULT_ZONE
    60         self.false_easting = false_easting
    61         self.false_northing = false_northing       
     60        self.false_easting = int(false_easting)
     61        self.false_northing = int(false_northing)
    6262        self.datum = datum
    6363        self.projection = projection
    64         self.zone = zone       
     64        self.zone = int(zone)
    6565        self.units = units
    66         self.xllcorner = xllcorner
    67         self.yllcorner = yllcorner       
     66        self.xllcorner = float(xllcorner)
     67        self.yllcorner = float(yllcorner)
    6868           
    6969        if NetCDFObject is not None:
     
    9999
    100100    def read_NetCDF(self, infile):
    101         self.xllcorner = infile.xllcorner[0]
    102         self.yllcorner = infile.yllcorner[0]
    103         self.zone = infile.zone[0]
    104 
    105        
    106         # Fix some assertion failures
    107         if type(self.zone) == num.ArrayType and self.zone.shape == ():
    108             self.zone = self.zone[0]
    109         if type(self.xllcorner) == num.ArrayType and self.xllcorner.shape == ():
    110             self.xllcorner = self.xllcorner[0]
    111         if type(self.yllcorner) == num.ArrayType and self.yllcorner.shape == ():
    112             self.yllcorner = self.yllcorner[0]
    113 
    114         assert (type(self.xllcorner) == types.FloatType or\
    115                 type(self.xllcorner) == types.IntType)
    116         assert (type(self.yllcorner) == types.FloatType or\
    117                 type(self.yllcorner) == types.IntType)
    118         assert (type(self.zone) == types.IntType)
    119        
     101        self.xllcorner = float(infile.xllcorner[0])
     102        self.yllcorner = float(infile.yllcorner[0])
     103        self.zone = int(infile.zone[0])
     104
    120105        try:
    121             self.false_easting = infile.false_easting[0]
    122             self.false_northing = infile.false_northing[0]
    123        
    124             self.datum = infile.datum       
     106            self.false_easting = int(infile.false_easting[0])
     107            self.false_northing = int(infile.false_northing[0])
     108
     109            self.datum = infile.datum
    125110            self.projection = infile.projection
    126111            self.units = infile.units
    127112        except:
    128113            pass
     114
    129115        if (self.false_easting != DEFAULT_FALSE_EASTING):
    130116            print "WARNING: False easting of %f specified." %self.false_easting
Note: See TracChangeset for help on using the changeset viewer.