Ignore:
Timestamp:
Jan 13, 2009, 1:17:54 PM (15 years ago)
Author:
rwilson
Message:

Change Numeric imports to general form - ready to change to NumPy?.

File:
1 edited

Legend:

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

    r5736 r6149  
    88
    99import types, sys
    10 from Numeric import array, Float, ArrayType, reshape, allclose
    1110from anuga.utilities.numerical_tools import ensure_numeric
    1211from anuga.utilities.anuga_exceptions import ANUGAError, TitleError, ParsingError, \
    1312     ShapeError
     13
     14import Numeric as num
    1415
    1516
     
    9899       
    99100        # Fix some assertion failures
    100         if type(self.zone) == ArrayType and self.zone.shape == ():
     101        if type(self.zone) == num.ArrayType and self.zone.shape == ():
    101102            self.zone = self.zone[0]
    102         if type(self.xllcorner) == ArrayType and self.xllcorner.shape == ():
     103        if type(self.xllcorner) == num.ArrayType and self.xllcorner.shape == ():
    103104            self.xllcorner = self.xllcorner[0]
    104         if type(self.yllcorner) == ArrayType and self.yllcorner.shape == ():
     105        if type(self.yllcorner) == num.ArrayType and self.yllcorner.shape == ():
    105106            self.yllcorner = self.yllcorner[0]
    106107
     
    172173           
    173174        # Fix some assertion failures
    174         if(type(self.zone) == ArrayType and self.zone.shape == ()):
     175        if(type(self.zone) == num.ArrayType and self.zone.shape == ()):
    175176            self.zone = self.zone[0]
    176         if type(self.xllcorner) == ArrayType and self.xllcorner.shape == ():
     177        if type(self.xllcorner) == num.ArrayType and self.xllcorner.shape == ():
    177178            self.xllcorner = self.xllcorner[0]
    178         if type(self.yllcorner) == ArrayType and self.yllcorner.shape == ():
     179        if type(self.yllcorner) == num.ArrayType and self.yllcorner.shape == ():
    179180            self.yllcorner = self.yllcorner[0]
    180181   
     
    196197            is_list = True
    197198
    198         points = ensure_numeric(points, Float)
     199        points = ensure_numeric(points, num.Float)
    199200       
    200201        if len(points.shape) == 1:
     
    202203            msg = 'Single point must have two elements'
    203204            assert len(points) == 2, msg
    204             points = reshape(points, (1,2))
     205            points = num.reshape(points, (1,2))
    205206
    206207        msg = 'Points array must be two dimensional.\n'
     
    239240        """
    240241
    241         return allclose([self.xllcorner, self.yllcorner], 0)
     242        return num.allclose([self.xllcorner, self.yllcorner], 0)
    242243
    243244       
     
    255256            is_list = True
    256257
    257         points = ensure_numeric(points, Float)
     258        points = ensure_numeric(points, num.Float)
    258259        if len(points.shape) == 1:
    259260            #One point has been passed
     
    295296            is_list = True
    296297
    297         points = ensure_numeric(points, Float)
     298        points = ensure_numeric(points, num.Float)
    298299        if len(points.shape) == 1:
    299300            #One point has been passed
Note: See TracChangeset for help on using the changeset viewer.