How to use the pyinterp.core.Axis 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)
github CNES / pangeo-pyinterp / tests / core / test_trivariate.py View on Github external
def load_data(cls):
        with netCDF4.Dataset(cls.GRID) as ds:
            z = np.flip(ds.variables['tcw'][:].T, axis=1)
            z[z.mask] = float("nan")

            return core.Grid3DFloat64(
                core.Axis(ds.variables['longitude'][:], is_circle=True),
                core.Axis(np.flip(ds.variables['latitude'][:])),
                core.Axis(ds.variables['time'][:]), z.data)
github CNES / pangeo-pyinterp / tests / test_cartesian.py View on Github external
def _load_data(cls):
        with netCDF4.Dataset(cls.GRID) as ds:
            z = ds.variables['tcw'][:].T
            z[z.mask] = float("nan")
            return core.cartesian.Trivariate(
                core.Axis(ds.variables['longitude'][:], is_circle=True),
                core.Axis(ds.variables['latitude'][:]),
                core.Axis(ds.variables['time'][:]), z.data)
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)