Changeset 1593 for trunk/python


Ignore:
Timestamp:
07/02/09 15:46:52 (15 years ago)
Author:
Malte Marquarding
Message:

tidy up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1590 r1593  
    3535        if average is None:
    3636            average = rcParams['scantable.autoaverage']
    37         if parallactify is None:
    38             parallactify = rcParams['scantable.parallactify']
     37        parallactify = parallactify or rcParams['scantable.parallactify']
    3938        varlist = vars()
    4039        from asap._asap import stmath
     
    107106        """
    108107        from os import path
    109         if format is None: format = rcParams['scantable.save']
     108        format = format or rcParams['scantable.save']
    110109        suffix = '.'+format.lower()
    111110        if name is None or name == "":
     
    173172        try:
    174173            bsel = self.get_selection()
    175             sel = selector()
    176             sel.set_scans(allscans)
     174            sel = selector(scans=allscans)
    177175            self.set_selection(bsel+sel)
    178176            scopy = self._copy()
     
    184182            else:
    185183                raise
    186 
    187184
    188185    def get_scan(self, scanid=None):
     
    256253        """
    257254        info = Scantable._summary(self, True)
    258         #if verbose is None: verbose = rcParams['scantable.verbosesummary']
    259255        if filename is not None:
    260256            if filename is "":
     
    356352            scan.stats(stat='mean', mask=m)
    357353        """
    358         if mask == None:
    359             mask = []
     354        mask = mask or []
    360355        if not self._check_ifs():
    361356            raise ValueError("Cannot apply mask as the IFs have different "
     
    595590            scan.set_freqframe('BARY')
    596591        """
    597         if frame is None: frame = rcParams['scantable.freqframe']
     592        frame = frame or rcParams['scantable.freqframe']
    598593        varlist = vars()
    599594        valid = ['REST', 'TOPO', 'LSRD', 'LSRK', 'BARY', \
     
    664659        """
    665660        varlist = vars()
    666         if mask is None:
    667             mask = []
     661        mask = mask or []
    668662        try:
    669663            self._flag(mask)
     
    822816            source and IF basis, use scantable.set_selection() before using
    823817            this function.
    824             # provide your scantable is call scan
     818            # provide your scantable is called scan
    825819            selection = selector()
    826820            selection.set_name("ORION*")
     
    961955        """
    962956        varlist = vars()
    963         if weight is None: weight = 'TINT'
    964         if mask is None: mask = ()
    965         if scanav: scanav = "SCAN"
    966         else: scanav = "NONE"
     957        weight = weight or 'TINT'
     958        mask = mask or ()
     959        scanav = (scanav and 'SCAN') or 'NONE'
    967960        scan = (self, )
    968961        try:
     
    1004997        self._math._setinsitu(insitu)
    1005998        varlist = vars()
    1006         if jyperk is None: jyperk = -1.0
    1007         if d is None: d = -1.0
    1008         if eta is None: eta = -1.0
     999        jyperk = jyperk or -1.0
     1000        d = d or -1.0
     1001        eta = eta or -1.0
    10091002        s = scantable(self._math._convertflux(self, d, eta, jyperk))
    10101003        s._add_history("convert_flux", varlist)
     
    10561049        self._math._setinsitu(insitu)
    10571050        varlist = vars()
    1058         if poly is None:
    1059             poly = ()
     1051        poly = poly or ()
    10601052        from os.path import expandvars
    10611053        filename = expandvars(filename)
    10621054        s = scantable(self._math._gainel(self, poly, filename, method))
    10631055        s._add_history("gain_el", varlist)
    1064         if insitu: self._assign(s)
    1065         else: return s
     1056        if insitu:
     1057            self._assign(s)
     1058        else:
     1059            return s
    10661060
    10671061    @print_log_dec
     
    10841078        self._math._setinsitu(insitu)
    10851079        varlist = vars()
    1086         if reftime is None: reftime = ""
     1080        reftime = reftime or ""
    10871081        s = scantable(self._math._freq_align(self, reftime, method))
    10881082        s._add_history("freq_align", varlist)
     
    11651159        """
    11661160        varlist = vars()
    1167         if mask is None:
    1168             mask = ()
     1161        mask = mask or ()
    11691162        s = scantable(self._math._averagepol(self, mask, weight.upper()))
    11701163        s._add_history("average_pol", varlist)
     
    11831176        """
    11841177        varlist = vars()
    1185         if mask is None:
    1186             mask = ()
     1178        mask = mask or ()
    11871179        s = scantable(self._math._averagebeams(self, mask, weight.upper()))
    11881180        s._add_history("average_beam", varlist)
     
    15921584                            remove:   Output = Toff * (on/off) - Ton
    15931585        """
    1594         if mask is None: mask = ()
     1586        mask = mask or ()
    15951587        varlist = vars()
    15961588        on = scantable(self._math._mx_extract(self, 'on'))
Note: See TracChangeset for help on using the changeset viewer.