Index: branches/numpy/anuga/coordinate_transforms/geo_reference.py
===================================================================
--- branches/numpy/anuga/coordinate_transforms/geo_reference.py	(revision 7038)
+++ branches/numpy/anuga/coordinate_transforms/geo_reference.py	(revision 7061)
@@ -87,12 +87,12 @@
         if zone is None:
             zone = DEFAULT_ZONE
-        self.false_easting = false_easting
-        self.false_northing = false_northing
+        self.false_easting = int(false_easting)
+        self.false_northing = int(false_northing)
         self.datum = datum
         self.projection = projection
-        self.zone = zone
+        self.zone = int(zone)
         self.units = units
-        self.xllcorner = xllcorner
-        self.yllcorner = yllcorner        
+        self.xllcorner = float(xllcorner)
+        self.yllcorner = float(yllcorner)
             
         if NetCDFObject is not None:
@@ -101,5 +101,4 @@
         if ASCIIFile is not None:
             self.read_ASCII(ASCIIFile, read_title=read_title)
-
             
         # Set flag for absolute points (used by get_absolute)    
@@ -139,27 +138,27 @@
     # @param infile Handle to open NetCDF file.
     def read_NetCDF(self, infile):
-        self.xllcorner = infile.xllcorner[0]
-        self.yllcorner = infile.yllcorner[0]
-        self.zone = infile.zone[0]
-
-        # Fix some assertion failures
-        if isinstance(self.zone, num.ndarray) and self.zone.shape == ():
-            self.zone = self.zone[0]
-        if (isinstance(self.xllcorner, num.ndarray) and
-                self.xllcorner.shape == ()):
-            self.xllcorner = self.xllcorner[0]
-        if (isinstance(self.yllcorner, num.ndarray) and
-                self.yllcorner.shape == ()):
-            self.yllcorner = self.yllcorner[0]
-
-        assert (self.xllcorner.dtype.kind in num.typecodes['Float'] or
-                self.xllcorner.dtype.kind in num.typecodes['Integer'])
-        assert (self.yllcorner.dtype.kind in num.typecodes['Float'] or
-                self.yllcorner.dtype.kind in num.typecodes['Integer'])
-        assert (self.zone.dtype.kind in num.typecodes['Integer'])
+        self.xllcorner = float(infile.xllcorner[0])
+        self.yllcorner = float(infile.yllcorner[0])
+        self.zone = int(infile.zone[0])
+
+##        # Fix some assertion failures
+##        if isinstance(self.zone, num.ndarray) and self.zone.shape == ():
+##            self.zone = self.zone[0]
+##        if (isinstance(self.xllcorner, num.ndarray) and
+##                self.xllcorner.shape == ()):
+##            self.xllcorner = self.xllcorner[0]
+##        if (isinstance(self.yllcorner, num.ndarray) and
+##                self.yllcorner.shape == ()):
+##            self.yllcorner = self.yllcorner[0]
+##
+##        assert (self.xllcorner.dtype.kind in num.typecodes['Float'] or
+##                self.xllcorner.dtype.kind in num.typecodes['Integer'])
+##        assert (self.yllcorner.dtype.kind in num.typecodes['Float'] or
+##                self.yllcorner.dtype.kind in num.typecodes['Integer'])
+##        assert (self.zone.dtype.kind in num.typecodes['Integer'])
 
         try:
-            self.false_easting = infile.false_easting[0]
-            self.false_northing = infile.false_northing[0]
+            self.false_easting = int(infile.false_easting[0])
+            self.false_northing = int(infile.false_northing[0])
 
             self.datum = infile.datum
Index: branches/numpy/anuga/coordinate_transforms/test_geo_reference.py
===================================================================
--- branches/numpy/anuga/coordinate_transforms/test_geo_reference.py	(revision 7038)
+++ branches/numpy/anuga/coordinate_transforms/test_geo_reference.py	(revision 7061)
@@ -637,4 +637,90 @@
         self.failUnless(num.alltrue(new_points == points))
 
+    def test_georef_types(self):
+        '''Ensure that attributes of a georeference are of correct type.
+        
+        zone            int
+        false_easting   int
+        false_northing  int
+        xllcorner       float
+        yllcorner       float
+        '''
+
+        from Scientific.IO.NetCDF import NetCDFFile
+
+        # ensure that basic instance attributes are correct
+        g = Geo_reference(56, 1.8, 1.8)
+        self.failUnless(isinstance(g.zone, int),
+                        "geo_ref .zone should be 'int' type, "
+                        "was '%s' type" % type(g.zone))  
+        self.failUnless(isinstance(g.false_easting, int),
+                        "geo_ref .false_easting should be int type, "
+                        "was '%s' type" % type(g.false_easting))  
+        self.failUnless(isinstance(g.false_northing, int),
+                        "geo_ref .false_northing should be int type, "
+                        "was '%s' type" % type(g.false_northing))
+        self.failUnless(isinstance(g.xllcorner, float),
+                        "geo_ref .xllcorner should be float type, "
+                        "was '%s' type" % type(g.xllcorner))
+        self.failUnless(isinstance(g.yllcorner, float),
+                        "geo_ref .yllcorner should be float type, "
+                        "was '%s' type" % type(g.yllcorner))
+
+        # now write fikle, read back and check types again
+        file_name = tempfile.mktemp(".geo_referenceTest")
+        
+        out_file = NetCDFFile(file_name, netcdf_mode_w)
+        g.write_NetCDF(out_file)
+        out_file.close()
+        
+        in_file = NetCDFFile(file_name, netcdf_mode_r)
+        new_g = Geo_reference(NetCDFObject=in_file)
+        in_file.close()
+        os.remove(file_name)
+
+        self.failUnless(isinstance(new_g.zone, int),
+                        "geo_ref .zone should be 'int' type, "
+                        "was '%s' type" % type(new_g.zone))  
+        self.failUnless(isinstance(new_g.false_easting, int),
+                        "geo_ref .false_easting should be int type, "
+                        "was '%s' type" % type(new_g.false_easting))  
+        self.failUnless(isinstance(new_g.false_northing, int),
+                        "geo_ref .false_northing should be int type, "
+                        "was '%s' type" % type(new_g.false_northing))
+        self.failUnless(isinstance(new_g.xllcorner, float),
+                        "geo_ref .xllcorner should be float type, "
+                        "was '%s' type" % type(new_g.xllcorner))
+        self.failUnless(isinstance(new_g.yllcorner, float),
+                        "geo_ref .yllcorner should be float type, "
+                        "was '%s' type" % type(new_g.yllcorner))
+        
+    def test_georef_types_coerceable(self):
+        '''Ensure that attributes of a georeference are of correct type.
+        
+        zone            int
+        false_easting   int
+        false_northing  int
+        xllcorner       float
+        yllcorner       float
+        '''
+
+        # now provide wrong types but coerceable
+        g = Geo_reference(56.0, '1.8', '1.8')
+        self.failUnless(isinstance(g.zone, int),
+                        "geo_ref .zone should be 'int' type, "
+                        "was '%s' type" % type(g.zone))  
+        self.failUnless(isinstance(g.false_easting, int),
+                        "geo_ref .false_easting should be int type, "
+                        "was '%s' type" % type(g.false_easting))  
+        self.failUnless(isinstance(g.false_northing, int),
+                        "geo_ref .false_northing should be int type, "
+                        "was '%s' type" % type(g.false_northing))
+        self.failUnless(isinstance(g.xllcorner, float),
+                        "geo_ref .xllcorner should be float type, "
+                        "was '%s' type" % type(g.xllcorner))
+        self.failUnless(isinstance(g.yllcorner, float),
+                        "geo_ref .yllcorner should be float type, "
+                        "was '%s' type" % type(g.yllcorner))
+
         
 #-------------------------------------------------------------
