Specify download parameters

2. Specify download parameters#

When fetching datasets with PolarToolkit, you can specify a variety of parameters. For gridded data for example you can subset a specific region of the grid to extract or resample the grid to a different resolution.

Import the fetch, regions and utils modules of PolarToolkit

[1]:
from polartoolkit import fetch, regions, utils

Download some ice velocity data for Antarctica using default settings and print out some info about the grid. Since there is also ice velocity data available for Greenland, we need to specify which hemisphere we want the data for.

[2]:
grid = fetch.ice_vel(hemisphere="south")
_ = utils.get_grid_info(grid, print_info=True)
grid spacing: 5000.0 m
grid region: (-2800000.0, 2795000.0, -2795000.0, 2800000.0)
grid zmin: 2.87566308543e-05
grid zmax: 4201.68994141
grid registration: g

Now lets do this again, but specify the parameters of the grid we would like. For example, we may want a finer resolution and a specify region, which we can specify with preset geographic regions in the regions module.

[3]:
grid = fetch.ice_vel(
    hemisphere="south",
    spacing=450,  # in meters
    region=regions.pine_island_glacier,
    verbose="q",  # mute warnings about incompatible region and spacing
)
_ = utils.get_grid_info(grid, print_info=True)
grid spacing: 450.0 m
grid region: (-1720350.0, -1479600.0, -380250.0, -69750.0)
grid zmin: 0.0341334976256
grid zmax: 4218.31591797
grid registration: g

As you can we, the returned xarray dataarray is now at a smaller spacing and only has data for a subset region.