def to_tiff(self, filename):
if self.datatype is None:<EOL><INDENT>self.datatype = gdal_array.NumericTypeCodeToGDALTypeCode(self.raster.data.dtype)<EOL>if self.datatype is None:<EOL><INDENT>if self.raster.data.dtype.name.find('<STR_LIT:int>') !=- <NUM_LIT:1>:<EOL><INDENT>self.raster = self.raster.astype(np.int32)<EOL>self.datatype = gdal_array.NumericTypeCodeToGDALTypeCode(self.raster.data.dtype)<EOL><DEDENT>else:<EOL><INDENT>self.raster = self.raster.astype(np.float64)<EOL>self.datatype = gdal_array.NumericTypeCodeToGDALTypeCode(self.raster.data.dtype)<EOL><DEDENT><DEDENT><DEDENT>self.raster.data[self.raster.mask] = self.nodata_value<EOL>create_geotiff(filename, self.raster, gdal.GetDriverByName('<STR_LIT>'), self.nodata_value,<EOL>self.shape[<NUM_LIT:1>], self.shape[<NUM_LIT:0>], self.geot, self.projection, self.datatype)<EOL>
geo.to_tiff(filename)

Saves GeoRaster as geotiff filename.tif with type datatype

If GeoRaster does not have datatype, then it tries to assign a type.
You can assign the type yourself by setting
 geo.datatype = 'gdal.GDT_'+type