How to use the pyinterp.grid.Grid2D 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 _load(cls, cube=False):
        ds = netCDF4.Dataset(cls.GRID)
        x_axis = pyinterp.core.Axis(ds.variables["lon"][::5], is_circle=True)
        y_axis = pyinterp.core.Axis(ds.variables["lat"][::5])
        mss = ds.variables["mss"][::5, ::5].T
        mss[mss.mask] = float("nan")
        if cube:
            z_axis = pyinterp.core.Axis(np.arange(2))
            mss = np.stack([mss.data] * len(z_axis)).transpose(1, 2, 0)
            return pyinterp.grid.Grid3D(x_axis, y_axis, z_axis, mss)
        return pyinterp.grid.Grid2D(x_axis, y_axis, mss.data)