コード例 #1
0
ファイル: example_ofam.py プロジェクト: OceanPARCELS/parcels
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
0
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
0
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
0
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))
コード例 #5
0
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)
コード例 #6
0
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)