예제 #1
0
def regrid_to_max_resolution(cubes, **kwargs):
    msg = (_INTERPOLATE_DEPRECATION_WARNING + '\n' +
           'Please replace usage of '
           'iris.analysis.interpolate.regrid_to_max_resolution() '
           'with iris.cube.Cube.regrid().')
    _warn_deprecated(msg)
    return oldinterp.regrid_to_max_resolution(cubes, **kwargs)
예제 #2
0
    def test_regrid_max_resolution(self):
        low = Cube(np.arange(12).reshape((3, 4)))
        cs = GeogCS(6371229)
        low.add_dim_coord(DimCoord(np.array([-1, 0, 1], dtype=np.int32), 'latitude', units='degrees', coord_system=cs), 0)
        low.add_dim_coord(DimCoord(np.array([-1, 0, 1, 2], dtype=np.int32), 'longitude', units='degrees', coord_system=cs), 1)

        med = Cube(np.arange(20).reshape((4, 5)))
        cs = GeogCS(6371229)
        med.add_dim_coord(DimCoord(np.array([-1, 0, 1, 2], dtype=np.int32), 'latitude', units='degrees', coord_system=cs), 0)
        med.add_dim_coord(DimCoord(np.array([-2, -1, 0, 1, 2], dtype=np.int32), 'longitude', units='degrees', coord_system=cs), 1)

        high = Cube(np.arange(30).reshape((5, 6)))
        cs = GeogCS(6371229)
        high.add_dim_coord(DimCoord(np.array([-2, -1, 0, 1, 2], dtype=np.int32), 'latitude', units='degrees', coord_system=cs), 0)
        high.add_dim_coord(DimCoord(np.array([-2, -1, 0, 1, 2, 3], dtype=np.int32), 'longitude', units='degrees', coord_system=cs), 1)

        cubes = regrid_to_max_resolution([low, med, high], mode='nearest')
        self.assertCMLApproxData(cubes, ('regrid', 'low_med_high.cml'))
예제 #3
0
def regrid_to_max_resolution(cubes, **kwargs):
    msg = (_INTERPOLATE_DEPRECATION_WARNING + '\n' + 'Please replace usage of '
           'iris.analysis.interpolate.regrid_to_max_resolution() '
           'with iris.cube.Cube.regrid().')
    _warn_deprecated(msg)
    return oldinterp.regrid_to_max_resolution(cubes, **kwargs)