当前位置: 首页>>代码示例>>Python>>正文


Python Grid.from_netcdf方法代码示例

本文整理汇总了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)
开发者ID:OceanPARCELS,项目名称:parcels,代码行数:9,代码来源:example_ofam.py

示例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)
开发者ID:nathanieltarshish,项目名称:parcels,代码行数:9,代码来源:example_globcurrent.py

示例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))
开发者ID:OceanPARCELS,项目名称:parcels-examples,代码行数:15,代码来源:test_ofam_grid.py

示例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))
开发者ID:OceanPARCELS,项目名称:parcels-examples,代码行数:15,代码来源:test_globcurrent.py


注:本文中的parcels.Grid.from_netcdf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。