Changeset 1483 for trunk/python


Ignore:
Timestamp:
01/20/09 20:12:02 (16 years ago)
Author:
Malte Marquarding
Message:

added flag_nans to help with possible non-flagged NaNs in the data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1471 r1483  
    16921692            return fit.as_dict()
    16931693
     1694    def flag_nans(self):
     1695        """
     1696        Utility function to flag NaN values in the scantable.
     1697        """
     1698        import numpy
     1699        basesel = self.get_selection()
     1700        for i in range(self.nrow()):
     1701            sel = selector()+basesel
     1702            sel.set_scans(self.getscan(i))
     1703            sel.set_beams(self.getbeam(i))
     1704            sel.set_ifs(self.getif(i))
     1705            sel.set_polarisations(self.getpol(i))
     1706            self.set_selection(sel)
     1707            nans = numpy.isnan(self._getspectrum(0))
     1708        if numpy.any(nans):
     1709            bnans = [ bool(v) for v in nans]
     1710            self.flag(bnans)
     1711        self.set_selection(basesel)
     1712       
     1713
    16941714    def _add_history(self, funcname, parameters):
    16951715        if not rcParams['scantable.history']:
Note: See TracChangeset for help on using the changeset viewer.