本文整理汇总了Python中parcels.Grid.from_netcdf方法的典型用法代码示例。如果您正苦于以下问题:Python Grid.from_netcdf方法的具体用法?Python Grid.from_netcdf怎么用?Python Grid.from_netcdf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parcels.Grid
的用法示例。
在下文中一共展示了Grid.from_netcdf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_ofam_grid
# 需要导入模块: from parcels import Grid [as 别名]
# 或者: from parcels.Grid import from_netcdf [as 别名]
def set_ofam_grid():
filenames = {'U': "examples/OFAM_example_data/OFAM_simple_U.nc",
'V': "examples/OFAM_example_data/OFAM_simple_V.nc"}
variables = {'U': 'u', 'V': 'v'}
dimensions = {'lat': 'yu_ocean', 'lon': 'xu_ocean', 'depth': 'st_ocean',
'time': 'Time'}
return Grid.from_netcdf(filenames, variables, dimensions)
示例2: set_globcurrent_grid
# 需要导入模块: from parcels import Grid [as 别名]
# 或者: from parcels.Grid import from_netcdf [as 别名]
def set_globcurrent_grid():
filenames = {'U': "examples/GlobCurrent_example_data/20*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc",
'V': "examples/GlobCurrent_example_data/20*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc"}
variables = {'U': 'eastward_eulerian_current_velocity', 'V': 'northward_eulerian_current_velocity'}
dimensions = {'lat': 'lat', 'lon': 'lon',
'time': 'time'}
return Grid.from_netcdf(filenames, variables, dimensions)
示例3: test_ofam_grid
# 需要导入模块: from parcels import Grid [as 别名]
# 或者: from parcels.Grid import from_netcdf [as 别名]
def test_ofam_grid(filepath):
filenames = {'U': path.join(filepath, "OFAM_simple_U.nc"),
'V': path.join(filepath, "OFAM_simple_V.nc")}
variables = {'U': 'u', 'V': 'v'}
dimensions = {'lat': 'yu_ocean', 'lon': 'xu_ocean', 'depth': 'st_ocean',
'time': 'Time'}
grid = Grid.from_netcdf(filenames, variables, dimensions)
assert(grid.U.lon.size == 2001)
assert(grid.U.lat.size == 601)
assert(grid.U.data.shape == (4, 601, 2001))
assert(grid.V.lon.size == 2001)
assert(grid.V.lat.size == 601)
assert(grid.V.data.shape == (4, 601, 2001))
示例4: test_globcurrent_grid
# 需要导入模块: from parcels import Grid [as 别名]
# 或者: from parcels.Grid import from_netcdf [as 别名]
def test_globcurrent_grid():
filenames = {'U': "examples/GlobCurrent_example_data/20*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc",
'V': "examples/GlobCurrent_example_data/20*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc"}
variables = {'U': 'eastward_eulerian_current_velocity', 'V': 'northward_eulerian_current_velocity'}
dimensions = {'lat': 'lat', 'lon': 'lon',
'time': 'time'}
grid = Grid.from_netcdf(filenames, variables, dimensions)
assert(grid.U.lon.size == 81)
assert(grid.U.lat.size == 41)
assert(grid.U.data.shape == (365, 41, 81))
assert(grid.V.lon.size == 81)
assert(grid.V.lat.size == 41)
assert(grid.V.data.shape == (365, 41, 81))