Changeset 1629 for branches


Ignore:
Timestamp:
09/03/09 20:33:39 (15 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-1428)

Ready to Release: Yes

Interface Changes: Yes

What Interface Changed: The parameter 'form' is added to 'stats()'

Test Programs:

s=sd.scantable('SDFILENAME')
s.stats('max',form='3.2e')
# max values are output in user specified format.

Put in Release Notes: No

Module(s):

Description:

Enabled user specified output format to be printed.


File:
1 edited

Legend:

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

    r1627 r1629  
    390390            return workscan
    391391
    392     def stats(self, stat='stddev', mask=None):
     392    #def stats(self, stat='stddev', mask=None):
     393    def stats(self, stat='stddev', mask=None, form='3.3f'):
    393394        """
    394395        Determine the specified statistic of the current beam/if/pol
     
    400401            mask:    an optional mask specifying where the statistic
    401402                     should be determined.
     403            form:    format string to print statistic values
    402404        Example:
    403405            scan.set_unit('channel')
     
    439441                if rtnabc:
    440442                    statvals.append(qx['value'])
    441                     refstr = '(value: %3.3f' % (qy['value'])+' ['+qy['unit']+'])'
     443                    #refstr = '(value: %3.3f' % (qy['value'])+' ['+qy['unit']+'])'
     444                    refstr = ('(value: %'+form) % (qy['value'])+' ['+qy['unit']+'])'
    442445                    statunit= '['+qx['unit']+']'
    443446                else:
    444                     refstr = '(@ %3.3f' % (qx['value'])+' ['+qx['unit']+'])'
     447                    #refstr = '(@ %3.3f' % (qx['value'])+' ['+qx['unit']+'])'
     448                    refstr = ('(@ %'+form) % (qx['value'])+' ['+qx['unit']+'])'
    445449                    #statunit= ' ['+qy['unit']+']'
    446450            out += 'Scan[%d] (%s) ' % (axis[0], src)
     
    449453            if self.nif(-1) > 1: out +=  ' IF[%d] ' % (axis[2])
    450454            if self.npol(-1) > 1: out +=  ' Pol[%d] ' % (axis[3])
    451             out += '= %3.3f   ' % (statvals[i]) +refstr+'\n'
     455            #out += '= %3.3f   ' % (statvals[i]) +refstr+'\n'
     456            out += ('= %'+form) % (statvals[i]) +'   '+refstr+'\n'
    452457            out +=  "--------------------------------------------------\n"
    453458
Note: See TracChangeset for help on using the changeset viewer.