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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/smf.py

    r7276 r7317  
    4949import numpy as num
    5050
     51import anuga.utilities.log as log
     52
    5153
    5254def find_min(x0, wa, kappad, dx):
     
    143145    #a few temporary print statements
    144146    if verbose is True:
    145         print '\nThe slide ...'
    146         print '\tLength: ', length
    147         print '\tDepth: ', depth
    148         print '\tSlope: ', slope
    149         print '\tWidth: ', width
    150         print '\tThickness: ', thickness
    151         print '\tx0: ', x0
    152         print '\ty0: ', y0
    153         print '\tAlpha: ', alpha
    154         print '\tAcceleration: ', a0
    155         print '\tTerminal velocity: ', ut
    156         print '\tChar time: ', t0
    157         print '\tChar distance: ', s0
    158         print '\nThe tsunami ...'
    159         print '\tWavelength: ', w
    160         print '\t2D amplitude: ', a2D
    161         print '\t3D amplitude: ', a3D
    162         print '\tscale for eta(x,y):', scale
     147        log.critical('\nThe slide ...')
     148        log.critical('\tLength: %s' % str(length))
     149        log.critical('\tDepth: %s' % str(depth))
     150        log.critical('\tSlope: %s' % str(slope))
     151        log.critical('\tWidth: %s' % str(width))
     152        log.critical('\tThickness: %s' % str(thickness))
     153        log.critical('\tx0: %s' % str(x0))
     154        log.critical('\ty0: %s' % str(y0))
     155        log.critical('\tAlpha: %s' % str(alpha))
     156        log.critical('\tAcceleration: %s' % str(a0))
     157        log.critical('\tTerminal velocity: %s' % str(ut))
     158        log.critical('\tChar time: %s' % str(t0))
     159        log.critical('\tChar distance: %s' % str(s0))
     160        log.critical('\nThe tsunami ...')
     161        log.critical('\tWavelength: %s' % str(w))
     162        log.critical('\t2D amplitude: %s' % str(a2D))
     163        log.critical('\t3D amplitude: %s' % str(a3D))
     164        log.critical('\tscale for eta(x,y): %s' % str(scale))
    163165
    164166    #keep an eye on some of the assumptions built into the maths
     
    166168    if ((slope < 5) or (slope > 30)):
    167169        if verbose is True:
    168             print 'WARNING: slope out of range (5 - 30 degrees) ', slope
     170            log.critical('WARNING: slope out of range (5 - 30 degrees) %s'
     171                         % str(slope))
    169172    if ((depth/length < 0.06) or (depth/length > 1.5)):
    170173        if verbose is True:
    171             print  'WARNING: d/b out of range (0.06 - 1.5) ', depth/length
     174            log.critical('WARNING: d/b out of range (0.06 - 1.5) %s'
     175                         % str(depth/length))
    172176    if ((thickness/length < 0.008) or (thickness/length > 0.2)):
    173177        if verbose is True:
    174             print 'WARNING: T/b out of range (0.008 - 0.2) ', thickness/length
     178            log.critical('WARNING: T/b out of range (0.008 - 0.2) %s'
     179                         % str(thickness/length))
    175180    if ((gamma < 1.46) or (gamma > 2.93)):
    176181        if verbose is True:
    177             print 'WARNING: gamma out of range (1.46 - 2.93) ', gamma
     182            log.critical('WARNING: gamma out of range (1.46 - 2.93) %s'
     183                         % str(gamma))
    178184
    179185    return Double_gaussian(a3D, w, width, x0, y0, alpha, kappa, kappad, zsmall, dx, scale)
     
    286292    #a few temporary print statements
    287293    if verbose is True:
    288         print '\nThe slump ...'
    289         print '\tLength: ', length
    290         print '\tDepth: ', depth
    291         print '\tSlope: ', slope
    292         print '\tWidth: ', width
    293         print '\tThickness: ', thickness
    294         print '\tRadius: ', radius
    295         print '\tDphi: ', dphi
    296         print '\tx0: ', x0
    297         print '\ty0: ', y0
    298         print '\tAlpha: ', alpha
    299         print '\tAcceleration: ', a0
    300         print '\tMaximum velocity: ', um
    301         print '\tChar time: ', t0
    302         print '\tChar distance: ', s0
    303         print '\nThe tsunami ...'
    304         print '\tWavelength: ', w
    305         print '\t2D amplitude: ', a2D
    306         print '\t3D amplitude: ', a3D
    307         print '\tDelta x ', dx
    308         print '\tsmall ', zsmall
    309         print '\tKappa d ', kappad
    310         print '\tscale for eta(x,y):', scale
     294        log.critical('\nThe slump ...')
     295        log.critical('\tLength: %s' % str(length))
     296        log.critical('\tDepth: %s' % str(depth))
     297        log.critical('\tSlope: %s' % str(slope))
     298        log.critical('\tWidth: %s' % str(width))
     299        log.critical('\tThickness: %s' % str(thickness))
     300        log.critical('\tRadius: %s' % str(radius))
     301        log.critical('\tDphi: %s' % str(dphi))
     302        log.critical('\tx0: %s' % str(x0))
     303        log.critical('\ty0: %s' % str(y0))
     304        log.critical('\tAlpha: %s' % str(alpha))
     305        log.critical('\tAcceleration: %s' % str(a0))
     306        log.critical('\tMaximum velocity: %s' % str(um))
     307        log.critical('\tChar time: %s' % str(t0))
     308        log.critical('\tChar distance: %s' % str(s0))
     309        log.critical('\nThe tsunami ...')
     310        log.critical('\tWavelength: %s' % str(w))
     311        log.critical('\t2D amplitude: %s' % str(a2D))
     312        log.critical('\t3D amplitude: %s' % str(a3D))
     313        log.critical('\tDelta x %s' % str(dx))
     314        log.critical('\tsmall %s' % str(zsmall))
     315        log.critical('\tKappa d  %s' % str(kappad))
     316        log.critical('\tscale for eta(x,y): %s' % str(scale))
    311317
    312318    #keep an eye on some of the assumptions built into the maths
     
    314320    if ((slope < 10) or (slope > 30)):       
    315321        if verbose is True:
    316             print 'WARNING: slope out of range (10 - 30 degrees) ', slope
     322            log.critical('WARNING: slope out of range (10 - 30 degrees) %s'
     323                         % str(slope))
    317324    if ((depth/length < 0.34) or (depth/length > 0.5)):     
    318325        if verbose is True:
    319             print  'WARNING: d/b out of range (0.34 - 0.5) ', depth/length
     326            log.critical('WARNING: d/b out of range (0.34 - 0.5) %s'
     327                         % str(depth/length))
    320328    if ((thickness/length < 0.10) or (thickness/length > 0.15)):     
    321329        if verbose is True:
    322             print 'WARNING: T/b out of range (0.10 - 0.15) ', thickness/length
     330            log.critical('WARNING: T/b out of range (0.10 - 0.15) %s'
     331                         % str(thickness/length))
    323332    if ((radius/length < 1.0) or (radius/length > 2.0)):     
    324333        if verbose is True:
    325             print 'WARNING: R/b out of range (1 - 2) ', radius/length
     334            log.critical('WARNING: R/b out of range (1 - 2) %s'
     335                         % str(radius/length))
    326336    if ((dphi < 0.10) or (dphi > 0.52)):     
    327337        if verbose is True:
    328             print 'WARNING: del_phi out of range (0.10 - 0.52) ', dphi
     338            log.critical('WARNING: del_phi out of range (0.10 - 0.52) %s'
     339                         % str(dphi))
    329340    if ((gamma < 1.46) or (gamma > 2.93)):     
    330341        if verbose is True:
    331             print 'WARNING: gamma out of range (1.46 - 2.93) ', gamma
     342            log.critical('WARNING: gamma out of range (1.46 - 2.93) %s'
     343                         % str(gamma))
    332344
    333345    return Double_gaussian(a3D, w, width, x0, y0, alpha, kappa, kappad, zsmall, dx, scale)
Note: See TracChangeset for help on using the changeset viewer.