Changeset 516 for trunk/python


Ignore:
Timestamp:
02/28/05 16:56:53 (20 years ago)
Author:
vor010
Message:

LineFinder/automatic baseline fitter: a bug related to multiple-row scantable handling has been corrected.
Help is changed to describe a new interface. Parameter checking + vector to tuple conversion for the edge parameter have been added

Location:
trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplinefind.py

    r514 r516  
    1515       else:
    1616          print "No lines found!"
    17        sc2=poly_baseline(sc,fl.get_mask(),7)
     17       sc2=sc.poly_baseline(fl.get_mask(),7)
    1818   
    1919    The algorithm involves a simple threshold criterion. The line is
     
    7979        if not scan:
    8080           raise RuntimeError, 'Please give a correct scan'
     81        from asap import _is_sequence_or_number as _is_valid
     82
     83        if not _is_valid(edge, int):
     84           raise RuntimeError, "Parameter 'edge' as to be an integer or \
     85           a pair of integers"
     86
    8187        if len(edge)>2:
    8288           raise RuntimeError, "The edge parameter should have two \
     
    8490        if mask is None:
    8591            from numarray import ones
    86             self.finder.setscan(scan,ones(scan.nchan()),edge)
     92            self.finder.setscan(scan,ones(scan.nchan()),tuple(edge))
    8793        else:   
    88             self.finder.setscan(scan,mask,edge)
     94            self.finder.setscan(scan,mask,tuple(edge))
    8995        return
    9096    def find_lines(self,nRow=0):
     
    121127        else:
    122128            return self.finder.getlinerangesinchannels()
    123 
  • trunk/python/scantable.py

    r513 r516  
    11031103
    11041104        Example:
    1105             sc2=auto_poly_baseline(order=7)
     1105            scan2=scan.auto_poly_baseline(order=7)
    11061106        """
    11071107        if insitu is None: insitu = rcParams['insitu']
     
    11121112       
    11131113        if not _is_valid(edge, int):
    1114             print "Parameter 'edge' as to be an integer or a pair of integers"
    1115             return
     1114            raise RuntimeError, "Parameter 'edge' has to be an integer or a \
     1115            pair of integers specified as a tuple"
    11161116       
    11171117        # setup fitter
Note: See TracChangeset for help on using the changeset viewer.