Ignore:
Timestamp:
Jul 22, 2009, 9:22:11 AM (15 years ago)
Author:
rwilson
Message:

Replaced 'print' statements with log.critical() calls.

Location:
anuga_core/source/anuga/coordinate_transforms
Files:
6 edited

Legend:

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

    r7276 r7317  
    1414                                             ParsingError, ShapeError
    1515from anuga.config import netcdf_float, netcdf_int, netcdf_float32
     16import anuga.utilities.log as log
    1617
    1718import numpy as num
     
    153154
    154155        if self.false_easting != DEFAULT_FALSE_EASTING:
    155             print "WARNING: False easting of %f specified." % self.false_easting
    156             print "Default false easting is %f." % DEFAULT_FALSE_EASTING
    157             print "ANUGA does not correct for differences in False Eastings."
     156            log.critical("WARNING: False easting of %f specified."
     157                         % self.false_easting)
     158            log.critical("Default false easting is %f." % DEFAULT_FALSE_EASTING)
     159            log.critical("ANUGA does not correct for differences in "
     160                         "False Eastings.")
    158161
    159162        if self.false_northing != DEFAULT_FALSE_NORTHING:
    160             print ("WARNING: False northing of %f specified."
    161                    % self.false_northing)
    162             print "Default false northing is %f." % DEFAULT_FALSE_NORTHING
    163             print "ANUGA does not correct for differences in False Northings."
     163            log.critical("WARNING: False northing of %f specified."
     164                         % self.false_northing)
     165            log.critical("Default false northing is %f."
     166                         % DEFAULT_FALSE_NORTHING)
     167            log.critical("ANUGA does not correct for differences in "
     168                         "False Northings.")
    164169
    165170        if self.datum.upper() != DEFAULT_DATUM.upper():
    166             print "WARNING: Datum of %s specified." % self.datum
    167             print "Default Datum is %s." % DEFAULT_DATUM
    168             print "ANUGA does not correct for differences in datums."
     171            log.critical("WARNING: Datum of %s specified." % self.datum)
     172            log.critical("Default Datum is %s." % DEFAULT_DATUM)
     173            log.critical("ANUGA does not correct for differences in datums.")
    169174
    170175        if self.projection.upper() != DEFAULT_PROJECTION.upper():
    171             print "WARNING: Projection of %s specified." % self.projection
    172             print "Default Projection is %s." % DEFAULT_PROJECTION
    173             print "ANUGA does not correct for differences in Projection."
     176            log.critical("WARNING: Projection of %s specified."
     177                         % self.projection)
     178            log.critical("Default Projection is %s." % DEFAULT_PROJECTION)
     179            log.critical("ANUGA does not correct for differences in "
     180                         "Projection.")
    174181
    175182        if self.units.upper() != DEFAULT_UNITS.upper():
    176             print "WARNING: Units of %s specified." % self.units
    177             print "Default units is %s." % DEFAULT_UNITS
    178             print "ANUGA does not correct for differences in units."
     183            log.critical("WARNING: Units of %s specified." % self.units)
     184            log.critical("Default units is %s." % DEFAULT_UNITS)
     185            log.critical("ANUGA does not correct for differences in units.")
    179186
    180187################################################################################
  • anuga_core/source/anuga/coordinate_transforms/lat_long_UTM_conversion.py

    r4450 r7317  
    127127    #UTMZone was originally returned here.  I don't know what the
    128128    #letter at the end was for.
    129     #print "UTMZone", UTMZone
    130129    return (ZoneNumber, UTMEasting, UTMNorthing)
    131130
  • anuga_core/source/anuga/coordinate_transforms/redfearn.py

    r6424 r7317  
    6767    else:
    6868        K0 = scale_factor
    69     #print 'scale', K0
    7069    zone_width = 6                      #Degrees
    7170
  • anuga_core/source/anuga/coordinate_transforms/test_geo_reference.py

    r7276 r7317  
    121121        lofl = [[3.0,311.0], [677.0,6.0]]
    122122        new_lofl = g.change_points_geo_ref(lofl)
    123         #print "lofl",lofl
    124         #print "new_lofl",new_lofl
    125123
    126124        self.failUnless(type(new_lofl) == types.ListType, ' failed')
     
    137135        lofl = [[3.0,388.0]]
    138136        new_lofl = g.change_points_geo_ref(lofl)
    139         #print "lofl",lofl
    140         #print "new_lofl",new_lofl
    141137
    142138        self.failUnless(type(new_lofl) == types.ListType, ' failed')
     
    152148        lofl = [3.0,345.0]
    153149        new_lofl = g.change_points_geo_ref(lofl)
    154         #print "lofl",lofl
    155         #print "new_lofl",new_lofl
    156150
    157151        self.failUnless(type(new_lofl) == types.ListType, ' failed')
     
    168162        lofl = num.array([[3.0,323.0], [6.0,645.0]])
    169163        new_lofl = g.change_points_geo_ref(lofl)
    170         #print "4 lofl",lofl
    171         #print "4 new_lofl",new_lofl
    172164
    173165        self.failUnless(isinstance(new_lofl, num.ndarray), ' failed')
     
    183175        lofl = num.array([[3.0,323.0]])
    184176
    185        
    186         #print "5 lofl before",lofl         
    187177        new_lofl = g.change_points_geo_ref(lofl.copy())
    188         #print "5 lofl",lofl
    189         #print "5 new_lofl",new_lofl
    190178
    191179        self.failUnless(isinstance(new_lofl, num.ndarray), ' failed')
     
    203191        lofl = num.array([355.0,3.0])
    204192        new_lofl = g.change_points_geo_ref(lofl.copy())       
    205         #print "lofl",lofl
    206         #print "new_lofl",new_lofl
    207193
    208194        self.failUnless(isinstance(new_lofl, num.ndarray), ' failed')
     
    221207        lofl = [[3.0,30.0], [67.0,6.0]]
    222208        new_lofl = g.change_points_geo_ref(lofl,points_geo_ref=points_geo_ref)
    223         #print "lofl",lofl
    224         #print "new_lofl",new_lofl
    225209
    226210        self.failUnless(type(new_lofl) == types.ListType, ' failed')
  • anuga_core/source/anuga/coordinate_transforms/test_lat_long_UTM_conversion.py

    r7276 r7317  
    5757        lat = degminsec2decimal_degrees(-37,57,03.7203)
    5858        lon = degminsec2decimal_degrees(144,25,29.5244)
    59         #print lat, lon
    6059
    6160        zone, easting, northing = LLtoUTM(lat,lon)
     
    7776
    7877        zone, easting, northing = LLtoUTM(lat,lon)
    79         #print zone, easting, northing
    8078
    8179        assert zone == 52
     
    112110        zone, easting, northing = LLtoUTM(lat,lon)
    113111
    114         #print zone, easting, northing
    115112
    116113        assert zone == 56
  • anuga_core/source/anuga/coordinate_transforms/test_redfearn.py

    r7276 r7317  
    7171        lat = degminsec2decimal_degrees(-37,57,03.7203)
    7272        lon = degminsec2decimal_degrees(144,25,29.5244)
    73         #print lat, lon
    7473
    7574        zone, easting, northing = redfearn(lat,lon)
     
    8685
    8786        zone, easting, northing = redfearn(lat,lon)
    88         #print zone, easting, northing
    8987
    9088        assert zone == 52
     
    116114       
    117115        zone, easting, northing = redfearn(lat,lon)
    118 
    119         #print zone, easting, northing
    120116
    121117        assert zone == 56
     
    452448        points = [[lat_gong, lon_gong], [lat_2, lon_2]]
    453449        points, zone = convert_from_latlon_to_utm(points=points)
    454         #print "points",points
    455450        assert num.allclose(points[0][0], 308728.009)
    456451        assert num.allclose(points[0][1], 6180432.601)
Note: See TracChangeset for help on using the changeset viewer.