Ignore:
Timestamp:
08/06/09 15:48:39 (15 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-729, CAS-1147

Ready to Release: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

  1. Added level parameter to print_log()
  2. Replaced casalog.post() to asaplog.push() + print_log().


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/python/asapfitter.py

    r1612 r1614  
    44from asap import _n_bools
    55from asap import mask_and
    6 from taskinit import *
     6from asap import asaplog
    77
    88class fitter:
     
    6161            if rcParams['verbose']:
    6262                #print msg
    63                 casalog.post( msg, 'WARN' )
     63                asaplog.push(msg)
     64                print_log('ERROR')
    6465                return
    6566            else:
     
    108109            if rcParams['verbose']:
    109110                #print msg
    110                 casalog.post( msg, 'WARN' )
     111                asaplog.push(msg)
     112                print_log('ERROR')
    111113                return
    112114            else:
     
    138140            if rcParams['verbose']:
    139141                #print msg
    140                 casalog.post( msg, 'WARN' )
     142                asaplog.push(msg)
     143                print_log('ERROR')
    141144                return
    142145            else:
     
    175178            if rcParams['verbose']:
    176179                #print msg
    177                 casalog.post( msg, 'WARN' )
     180                print_log()
     181                asaplog.push(msg)
     182                print_log('ERROR')
    178183            else:
    179184                raise
     
    234239            if rcParams['verbose']:
    235240                #print msg
    236                 casalog.post( msg, 'WARN' )
     241                asaplog.push(msg)
     242                print_log('ERROR')
    237243                return
    238244            else:
     
    277283            if rcParams['verbose']:
    278284                #print msg
    279                 casalog.post( msg, 'WARN' )
     285                asaplog.push(msg)
     286                print_log('ERROR')
    280287                return
    281288            else:
     
    289296            if rcParams['verbose']:
    290297                #print msg
    291                 casalog.post( msg, 'WARN' )
     298                asaplog.push(msg)
     299                print_log('ERROR')
    292300                return
    293301            else:
     
    331339            if rcParams['verbose']:
    332340                #print msg
    333                 casalog.post( msg, 'WARN' )
     341                asaplog.push(msg)
     342                print_log('ERROR')
    334343                return
    335344            else:
     
    355364            if rcParams['verbose']:
    356365                #print msg
    357                 casalog.post( msg, 'WARN' )
     366                asaplog.push(msg)
     367                print_log('ERROR')
    358368                return
    359369            else:
     
    386396        if rcParams['verbose']:
    387397            #print fpars
    388             casalog.post( fpars )
     398            asaplog.push(fpars)
     399            print_log()
    389400        return {'params':cpars, 'fixed':cfixed, 'formatted': fpars,
    390401                'errors':cerrs}
     
    428439        if rcParams['verbose']:
    429440            #print self._format_pars(pars,fixed,None)
    430             casalog.post( self._format_pars(pars,fixed,None) )
     441            asaplog.push(self._format_pars(pars,fixed,None))
     442            print_log()
    431443        return pars
    432444
     
    439451            if rcParams['verbose']:
    440452                #print msg
    441                 casalog.post( msg, 'WARN' )
     453                asaplog.push(msg)
     454                print_log('ERROR')
    442455                return
    443456            else:
     
    453466            if rcParams['verbose']:
    454467                #print msg
    455                 casalog.post( msg, 'WARN' )
     468                asaplog.push(msg)
     469                print_log('ERROR')
    456470                return
    457471            else:
     
    460474        if rcParams['verbose']:
    461475            #print 'Chi^2 = %3.3f' % (ch2)
    462             casalog.post( 'Chi^2 = %3.3f' % (ch2) )
     476            asaplog.push( 'Chi^2 = %3.3f' % (ch2) )
     477            print_log()
    463478        return ch2
    464479
     
    471486            if rcParams['verbose']:
    472487                #print msg
    473                 casalog.post( msg, 'WARN' )
     488                asaplog.push(msg)
     489                print_log('ERROR')
    474490                return
    475491            else:
     
    485501            if rcParams['verbose']:
    486502                #print msg
    487                 casalog.post( msg, 'WARN' )
     503                asaplog.push(msg)
     504                print_log('ERROR')
    488505                return
    489506            else:
     
    494511            if rcParams['verbose']:
    495512                #print msg
    496                 casalog.post( msg, 'WARN' )
     513                asaplog.push(msg)
     514                print_log('ERROR')
    497515                return
    498516            else:
     
    613631            if rcParams['verbose']:
    614632                #print msg
    615                 casalog.post( msg, 'WARN' )
     633                asaplog.push(msg)
     634                print_log('ERROR')
    616635                return
    617636            else:
Note: See TracChangeset for help on using the changeset viewer.