How to use the pyinterp.fill.loess function in pyinterp

To help you get started, we’ve selected a few pyinterp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CNES / pangeo-pyinterp / tests / test_fill.py View on Github external
def test_loess(self):
        grid = self._load()
        filled0 = pyinterp.fill.loess(grid, num_threads=0)
        filled1 = pyinterp.fill.loess(grid, num_threads=1)
        data = np.copy(grid.array)
        data[np.isnan(data)] = 0
        filled0[np.isnan(filled0)] = 0
        filled1[np.isnan(filled1)] = 0
        self.assertEqual((filled0 - filled1).mean(), 0)
        self.assertEqual(np.ma.fix_invalid(grid.array - filled1).mean(), 0)
        self.assertNotEqual((data - filled1).mean(), 0)
github CNES / pangeo-pyinterp / tests / test_fill.py View on Github external
def test_loess_3d(self):
        grid = self._load(True)
        filled0 = pyinterp.fill.loess(grid, num_threads=0)
        filled0[np.isnan(filled0)] = 0
        self.assertEqual((filled0[:, :, 0] - filled0[:, :, 1]).mean(), 0)
github CNES / pangeo-pyinterp / tests / test_fill.py View on Github external
def test_loess(self):
        grid = self._load()
        filled0 = pyinterp.fill.loess(grid, num_threads=0)
        filled1 = pyinterp.fill.loess(grid, num_threads=1)
        data = np.copy(grid.array)
        data[np.isnan(data)] = 0
        filled0[np.isnan(filled0)] = 0
        filled1[np.isnan(filled1)] = 0
        self.assertEqual((filled0 - filled1).mean(), 0)
        self.assertEqual(np.ma.fix_invalid(grid.array - filled1).mean(), 0)
        self.assertNotEqual((data - filled1).mean(), 0)