Changeset 436 for trunk/python


Ignore:
Timestamp:
02/14/05 19:44:43 (20 years ago)
Author:
kil064
Message:

arg. 'all' -> 'allaxes' to be consistent with asapmath.py
use same doc. fragment from asapmath.py as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r432 r436  
    213213        return i,j,k
    214214
    215     def stats(self, stat='stddev', mask=None, all=None):
     215    def stats(self, stat='stddev', mask=None, allaxes=None):
    216216        """
    217217        Determine the specified statistic of the current beam/if/pol
     
    223223            mask:    an optional mask specifying where the statistic
    224224                     should be determined.
    225             all:     if true show all (default or .asaprc) rather
    226                      that the cursor selected spectrum of Beam/IF/Pol
    227 
     225            allaxes: if True apply to all spectra. Otherwise
     226                     apply only to the selected (beam/pol/if)spectra only.
     227                     The default is taken from .asaprc (True if none)
    228228        Example:
    229229            scan.set_unit('channel')
     
    231231            scan.stats(stat='mean', mask=m)
    232232        """
    233         if all is None: all = rcParams['scantable.allaxes']
     233        if allaxes is None: allaxes = rcParams['scantable.allaxes']
    234234        from asap._asap import stats as _stats
    235235        from numarray import array,zeros,Float
     
    238238        axes = ['Beam','IF','Pol','Time']
    239239
    240         if all:
     240        beamSel,IFSel,polSel = (self.getbeam(),self.getif(),self.getpol())
     241        if allaxes:
    241242            n = self.nbeam()*self.nif()*self.npol()*self.nrow()
    242243            shp = [self.nbeam(),self.nif(),self.npol(),self.nrow()]
     
    254255            if self._vb:
    255256                self._print_values(retval,stat,tm)
     257            self.setbeam(beamSel)
     258            self.setif(IFSel)
     259            self.setpol(polSel)
    256260            return retval
    257261
    258262        else:
    259             i,j,k = (self.getbeam(),self.getif(),self.getpol())
    260263            statval = _stats(self,mask,stat,-1)
    261264            out = ''
     
    263266                tm = self._gettime(l)
    264267                out += 'Time[%s]:\n' % (tm)
    265                 if self.nbeam() > 1: out +=  ' Beam[%d] ' % (i)
    266                 if self.nif() > 1: out +=  ' IF[%d] ' % (j)
    267                 if self.npol() > 1: out +=  ' Pol[%d] ' % (k)
     268                if self.nbeam() > 1: out +=  ' Beam[%d] ' % (beamSel)
     269                if self.nif() > 1: out +=  ' IF[%d] ' % (IFSel)
     270                if self.npol() > 1: out +=  ' Pol[%d] ' % (polSel)
    268271                out += '= %3.3f\n' % (statval[l])
    269272                out +=  "--------------------------------------------------\n"
     
    277280            return retval
    278281
    279     def stddev(self,mask=None, all=None):
     282    def stddev(self,mask=None, allaxes=None):
    280283        """
    281284        Determine the standard deviation of the current beam/if/pol
     
    285288            mask:    an optional mask specifying where the standard
    286289                     deviation should be determined.
    287             all:    optional flag to show all or a cursor selected
     290            allaxes: optional flag to show all or a cursor selected
    288291                     spectrum of Beam/IF/Pol. Default is all or taken
    289292                     from .asaprc
     
    294297            scan.stddev(mask=m)
    295298        """
    296         if all is None: all = rcParams['scantable.allaxes']
    297         return self.stats(stat='stddev',mask=mask, all=all);
    298 
    299     def get_tsys(self, all=None):
     299        if allaxes is None: allaxes = rcParams['scantable.allaxes']
     300        return self.stats(stat='stddev',mask=mask, allaxes=allaxes);
     301
     302    def get_tsys(self, allaxes=None):
    300303        """
    301304        Return the System temperatures.
    302305        Parameters:
    303             all:    optional parameter to get the Tsys values for all
    304                     Beams/IFs/Pols (default) or just the one selected
    305                     with scantable.set_cursor()
    306                     [True or False]
     306           allaxes:     if True apply to all spectra. Otherwise
     307                        apply only to the selected (beam/pol/if)spectra only.
     308                        The default is taken from .asaprc (True if none)
    307309        Returns:
    308310            a list of Tsys values.
    309311        """
    310         if all is None: all = rcParams['scantable.allaxes']
     312        if allaxes is None: allaxes = rcParams['scantable.allaxes']
    311313        from numarray import array,zeros,Float
    312314        axes = ['Beam','IF','Pol','Time']
    313315
    314         if all:
     316        if allaxes:
    315317            n = self.nbeam()*self.nif()*self.npol()*self.nrow()
    316318            shp = [self.nbeam(),self.nif(),self.npol(),self.nrow()]
     
    585587        return
    586588
    587     def rotate_xyphase (self, angle, all=None):
     589    def rotate_xyphase (self, angle, allaxes=None):
    588590        """
    589591        Rotate the phase of the XY correlation.  This is done in situ
     
    592594        Parameters:
    593595            angle:   The angle (degrees) to rotate (add) by.
    594             all:     if true operate on all axes (default or .asaprc) rather
    595                      than the cursor selected spectrum of Beam/IF
     596            allaxes: If True apply to all spectra. Otherwise
     597                     apply only to the selected (beam/pol/if)spectra only.
     598                     The default is taken from .asaprc (True if none)
    596599        Examples:
    597600            scan.rotate_xyphase(2.3)
    598601        """
    599         if all is None: all = rcParams['scantable.allaxes']
    600         sdtable._rotate_xyphase(self, angle, all)
     602        if allaxes is None: allaxes = rcParams['scantable.allaxes']
     603        sdtable._rotate_xyphase(self, angle, allaxes)
    601604           
    602605    def plot(self, what='spectrum',col='Pol', panel=None):
Note: See TracChangeset for help on using the changeset viewer.