Esempio n. 1
0
    def median_filter(self, tod, medfilt_stepsize):
        """
        Calculate this AFTER removing the atmosphere.
        """
        filter_tod = np.array(
            medfilt.medfilt(tod.astype(np.float64),
                            np.int32(medfilt_stepsize)))

        return filter_tod[:tod.size]
Esempio n. 2
0
def median_filter(tod, medfilt_stepsize):
    """
    Calculate this AFTER removing the atmosphere.
    """
    if any(~np.isfinite(tod)):
        return np.zeros(tod.size)
    if tod.size < medfilt_stepsize:
        return np.zeros(tod.size) + np.nanmedian(tod)
    filter_tod = np.array(
        medfilt.medfilt(tod.astype(np.float64), np.int32(medfilt_stepsize)))

    return filter_tod[:tod.size]
Esempio n. 3
0
    def median_filter(self, tod):
        """
        Calculate this AFTER removing the atmosphere.
        """
        if tod.size > 2 * self.medfilt_stepsize:
            filter_tod = np.array(
                medfilt.medfilt(tod.astype(np.float64),
                                np.int32(self.medfilt_stepsize)))
        else:
            filter_tod = np.ones(tod.size) * np.nanmedian(tod)

        return filter_tod[:tod.size]